From 0fb4083d38752d4b9f6d95748d41aa6a01795d6b Mon Sep 17 00:00:00 2001 From: Stefan Feuerhahn Date: Fri, 28 Jul 2017 16:21:40 +0200 Subject: [PATCH] first commit --- .gitignore | 24 + asn1/iso-acse-layer/compile.sh | 5 + asn1/iso-acse-layer/iso-acse-layer.asn | 272 + asn1/iso-presentation-layer/compile.sh | 5 + .../iso-presentation-layer.asn | 143 + asn1/mms/compile.sh | 5 + asn1/mms/mms.asn | 723 +++ asn1/mms/more-asn1-files/mms-epfl.asn | 3468 ++++++++++++ asn1/mms/more-asn1-files/mms-ioserver.asn | 1920 +++++++ asn1/mms/more-asn1-files/mms-iso.asn | 4767 +++++++++++++++++ asn1/mms/more-asn1-files/mms-sisco.asn | 2203 ++++++++ asn1/mms/more-asn1-files/mms-stefan.asn | 318 ++ asn1/mms/more-asn1-files/mms-uniroma.asn | 2217 ++++++++ build.gradle | 297 + configuration.gradle | 125 + doc/CHANGELOG.txt | 242 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54783 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 172 + gradlew.bat | 84 + license/NOTICE | 16 + license/apache-license-2.0.txt | 202 + .../openiec61850-console-client | 20 + .../openiec61850-console-client.bat | 6 + run-scripts/console-server/logback.xml | 16 + .../openiec61850-console-server | 37 + .../openiec61850-console-server.bat | 6 + run-scripts/console-server/sample-model.icd | 293 + .../gui-client/openiec61850-gui-client | 39 + .../gui-client/openiec61850-gui-client.bat | 6 + src/asn1/iso-acse-layer/compile.sh | 5 + src/asn1/iso-acse-layer/iso-acse-layer.asn | 272 + src/asn1/iso-presentation-layer/compile.sh | 5 + .../iso-presentation-layer.asn | 143 + src/asn1/mms/compile.sh | 5 + src/asn1/mms/mms.asn | 723 +++ src/asn1/mms/more-asn1-files/mms-epfl.asn | 3468 ++++++++++++ src/asn1/mms/more-asn1-files/mms-ioserver.asn | 1920 +++++++ src/asn1/mms/more-asn1-files/mms-iso.asn | 4767 +++++++++++++++++ src/asn1/mms/more-asn1-files/mms-sisco.asn | 2203 ++++++++ src/asn1/mms/more-asn1-files/mms-stefan.asn | 318 ++ src/asn1/mms/more-asn1-files/mms-uniroma.asn | 2217 ++++++++ src/build.gradle | 297 + src/configuration.gradle | 125 + src/doc/CHANGELOG.txt | 242 + src/docs/asciidoc/common-settings.txt | 33 + src/docs/asciidoc/images/banner.png | Bin 0 -> 75043 bytes src/docs/asciidoc/openiec61850-doc.adoc | 438 ++ src/docs/asciidoc/openmuc-asciidoc.css | 398 ++ src/docs/asciidoc/pdf-theme.yml | 54 + src/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54783 bytes src/gradle/wrapper/gradle-wrapper.properties | 6 + src/gradlew | 172 + src/gradlew.bat | 84 + src/license/NOTICE | 16 + src/license/apache-license-2.0.txt | 202 + .../internal/acse/asn1/AAREApdu.java | 606 +++ .../internal/acse/asn1/AARQApdu.java | 677 +++ .../internal/acse/asn1/ACSEApdu.java | 183 + .../internal/acse/asn1/ACSERequirements.java | 24 + .../acse/asn1/AEInvocationIdentifier.java | 30 + .../internal/acse/asn1/AEQualifier.java | 105 + .../internal/acse/asn1/AEQualifierForm2.java | 30 + .../josistack/internal/acse/asn1/AETitle.java | 105 + .../internal/acse/asn1/AETitleForm2.java | 24 + .../acse/asn1/APInvocationIdentifier.java | 30 + .../josistack/internal/acse/asn1/APTitle.java | 105 + .../internal/acse/asn1/APTitleForm2.java | 24 + .../acse/asn1/ApplicationContextName.java | 24 + .../acse/asn1/ApplicationContextNameList.java | 144 + .../internal/acse/asn1/AssociateResult.java | 30 + .../acse/asn1/AssociateSourceDiagnostic.java | 145 + .../acse/asn1/AssociationInformation.java | 144 + .../acse/asn1/AuthenticationValue.java | 166 + .../acse/asn1/ImplementationData.java | 20 + .../internal/acse/asn1/MechanismName.java | 24 + .../internal/acse/asn1/Myexternal.java | 355 ++ .../internal/acse/asn1/Myexternal2.java | 355 ++ .../internal/acse/asn1/OidValues.java | 12 + .../internal/acse/asn1/RLREApdu.java | 178 + .../internal/acse/asn1/RLRQApdu.java | 178 + .../acse/asn1/ReleaseRequestReason.java | 30 + .../acse/asn1/ReleaseResponseReason.java | 30 + .../presentation/asn1/AbstractSyntaxName.java | 22 + .../internal/presentation/asn1/CPAPPDU.java | 416 ++ .../internal/presentation/asn1/CPType.java | 482 ++ .../asn1/CalledPresentationSelector.java | 16 + .../asn1/CallingPresentationSelector.java | 16 + .../presentation/asn1/ContextList.java | 387 ++ .../presentation/asn1/DefaultContextName.java | 141 + .../presentation/asn1/FullyEncodedData.java | 127 + .../presentation/asn1/ModeSelector.java | 118 + .../internal/presentation/asn1/PDVList.java | 310 ++ .../PresentationContextDefinitionList.java | 16 + ...esentationContextDefinitionResultList.java | 16 + .../asn1/PresentationContextIdentifier.java | 28 + .../asn1/PresentationRequirements.java | 22 + .../asn1/PresentationSelector.java | 18 + .../presentation/asn1/ProtocolVersion.java | 22 + .../asn1/RespondingPresentationSelector.java | 16 + .../internal/presentation/asn1/Result.java | 28 + .../presentation/asn1/ResultList.java | 294 + .../presentation/asn1/SimplyEncodedData.java | 18 + .../presentation/asn1/TransferSyntaxName.java | 22 + .../internal/presentation/asn1/UserData.java | 123 + .../asn1/UserSessionRequirements.java | 22 + .../internal/mms/asn1/AccessResult.java | 136 + .../internal/mms/asn1/AlternateAccess.java | 240 + .../mms/asn1/AlternateAccessSelection.java | 1164 ++++ .../internal/mms/asn1/BasicIdentifier.java | 20 + .../internal/mms/asn1/ConcludeRequestPDU.java | 20 + .../internal/mms/asn1/ConfirmedErrorPDU.java | 202 + .../mms/asn1/ConfirmedRequestPDU.java | 165 + .../mms/asn1/ConfirmedResponsePDU.java | 165 + .../mms/asn1/ConfirmedServiceRequest.java | 292 + .../mms/asn1/ConfirmedServiceResponse.java | 282 + .../openiec61850/internal/mms/asn1/Data.java | 683 +++ .../internal/mms/asn1/DataAccessError.java | 30 + .../asn1/DefineNamedVariableListRequest.java | 165 + .../asn1/DefineNamedVariableListResponse.java | 20 + .../asn1/DeleteNamedVariableListRequest.java | 445 ++ .../asn1/DeleteNamedVariableListResponse.java | 171 + .../internal/mms/asn1/FloatingPoint.java | 20 + .../internal/mms/asn1/GetNameListRequest.java | 369 ++ .../mms/asn1/GetNameListResponse.java | 306 ++ ...GetNamedVariableListAttributesRequest.java | 18 + ...etNamedVariableListAttributesResponse.java | 173 + .../GetVariableAccessAttributesRequest.java | 114 + .../GetVariableAccessAttributesResponse.java | 178 + .../internal/mms/asn1/Identifier.java | 20 + .../internal/mms/asn1/InformationReport.java | 296 + .../internal/mms/asn1/InitiateErrorPDU.java | 18 + .../internal/mms/asn1/InitiateRequestPDU.java | 462 ++ .../mms/asn1/InitiateResponsePDU.java | 462 ++ .../internal/mms/asn1/Integer16.java | 30 + .../internal/mms/asn1/Integer32.java | 30 + .../internal/mms/asn1/Integer8.java | 30 + .../internal/mms/asn1/MMSString.java | 20 + .../internal/mms/asn1/MMSpdu.java | 339 ++ .../internal/mms/asn1/ObjectClass.java | 108 + .../internal/mms/asn1/ObjectName.java | 319 ++ .../mms/asn1/ParameterSupportOptions.java | 24 + .../internal/mms/asn1/ReadRequest.java | 178 + .../internal/mms/asn1/ReadResponse.java | 309 ++ .../internal/mms/asn1/RejectPDU.java | 543 ++ .../internal/mms/asn1/ServiceError.java | 645 +++ .../mms/asn1/ServiceSupportOptions.java | 24 + .../internal/mms/asn1/TimeOfDay.java | 20 + .../internal/mms/asn1/TypeDescription.java | 1227 +++++ .../internal/mms/asn1/TypeSpecification.java | 108 + .../internal/mms/asn1/UnconfirmedPDU.java | 133 + .../internal/mms/asn1/UnconfirmedService.java | 108 + .../internal/mms/asn1/Unsigned16.java | 30 + .../internal/mms/asn1/Unsigned32.java | 30 + .../internal/mms/asn1/Unsigned8.java | 30 + .../internal/mms/asn1/UtcTime.java | 20 + .../mms/asn1/VariableAccessSpecification.java | 143 + .../internal/mms/asn1/VariableDefs.java | 298 ++ .../mms/asn1/VariableSpecification.java | 114 + .../internal/mms/asn1/WriteRequest.java | 296 + .../internal/mms/asn1/WriteResponse.java | 268 + .../openmuc/josistack/AcseAssociation.java | 956 ++++ .../josistack/AcseAssociationListener.java | 27 + .../josistack/ByteBufferInputStream.java | 59 + .../org/openmuc/josistack/ClientAcseSap.java | 112 + .../openmuc/josistack/DecodingException.java | 39 + .../org/openmuc/josistack/ServerAcseSap.java | 140 + .../org/openmuc/jositransport/ClientTSap.java | 174 + .../org/openmuc/jositransport/ServerTSap.java | 220 + .../openmuc/jositransport/ServerThread.java | 147 + .../openmuc/jositransport/TConnection.java | 683 +++ .../jositransport/TConnectionListener.java | 33 + .../openmuc/openiec61850/AcseListener.java | 43 + .../java/org/openmuc/openiec61850/Array.java | 170 + .../openiec61850/BasicDataAttribute.java | 113 + .../openmuc/openiec61850/BdaBitString.java | 102 + .../org/openmuc/openiec61850/BdaBoolean.java | 92 + .../org/openmuc/openiec61850/BdaCheck.java | 79 + .../openmuc/openiec61850/BdaDoubleBitPos.java | 98 + .../openmuc/openiec61850/BdaEntryTime.java | 134 + .../org/openmuc/openiec61850/BdaFloat32.java | 117 + .../org/openmuc/openiec61850/BdaFloat64.java | 124 + .../org/openmuc/openiec61850/BdaInt16.java | 92 + .../org/openmuc/openiec61850/BdaInt16U.java | 92 + .../org/openmuc/openiec61850/BdaInt32.java | 92 + .../org/openmuc/openiec61850/BdaInt32U.java | 92 + .../org/openmuc/openiec61850/BdaInt64.java | 92 + .../org/openmuc/openiec61850/BdaInt8.java | 92 + .../org/openmuc/openiec61850/BdaInt8U.java | 92 + .../openmuc/openiec61850/BdaOctetString.java | 110 + .../org/openmuc/openiec61850/BdaOptFlds.java | 170 + .../org/openmuc/openiec61850/BdaQuality.java | 250 + .../openiec61850/BdaReasonForInclusion.java | 120 + .../openmuc/openiec61850/BdaTapCommand.java | 99 + .../openmuc/openiec61850/BdaTimestamp.java | 244 + .../openiec61850/BdaTriggerConditions.java | 113 + .../org/openmuc/openiec61850/BdaType.java | 48 + .../openiec61850/BdaUnicodeString.java | 112 + .../openiec61850/BdaVisibleString.java | 123 + .../java/org/openmuc/openiec61850/Brcb.java | 59 + .../openiec61850/ClientAssociation.java | 1772 ++++++ .../openiec61850/ClientEventListener.java | 48 + .../org/openmuc/openiec61850/ClientSap.java | 341 ++ .../ConstructedDataAttribute.java | 88 + .../openiec61850/DataDefinitionResParser.java | 274 + .../org/openmuc/openiec61850/DataSet.java | 148 + .../java/org/openmuc/openiec61850/Fc.java | 71 + .../openmuc/openiec61850/FcDataObject.java | 97 + .../org/openmuc/openiec61850/FcModelNode.java | 250 + .../openmuc/openiec61850/HexConverter.java | 155 + .../openmuc/openiec61850/LogicalDevice.java | 43 + .../org/openmuc/openiec61850/LogicalNode.java | 133 + .../org/openmuc/openiec61850/ModelNode.java | 182 + .../openmuc/openiec61850/ObjectReference.java | 174 + .../java/org/openmuc/openiec61850/Rcb.java | 115 + .../java/org/openmuc/openiec61850/Report.java | 151 + .../openmuc/openiec61850/ReportEntryData.java | 92 + .../openiec61850/SclParseException.java | 31 + .../org/openmuc/openiec61850/SclParser.java | 1060 ++++ .../openiec61850/ServerAssociation.java | 1637 ++++++ .../openiec61850/ServerEventListener.java | 38 + .../org/openmuc/openiec61850/ServerModel.java | 399 ++ .../org/openmuc/openiec61850/ServerSap.java | 419 ++ .../openmuc/openiec61850/ServiceError.java | 129 + .../openmuc/openiec61850/ServiceSupport.java | 31 + .../java/org/openmuc/openiec61850/Urcb.java | 397 ++ .../openiec61850/app/ConsoleClient.java | 276 + .../openiec61850/app/ConsoleServer.java | 247 + .../openiec61850/clientgui/BasicDataBind.java | 70 + .../openiec61850/clientgui/ClientGui.java | 445 ++ .../clientgui/DataObjectTreeCellRenderer.java | 51 + .../clientgui/DataObjectTreeNode.java | 222 + .../clientgui/DataSetTreeNode.java | 82 + .../openiec61850/clientgui/DataTreeNode.java | 41 + .../clientgui/ServerModelParser.java | 137 + .../openiec61850/clientgui/SettingsFrame.java | 210 + .../clientgui/databind/BooleanDataBind.java | 51 + .../clientgui/databind/CheckDataBind.java | 60 + .../databind/DoubleBitPosDataBind.java | 50 + .../clientgui/databind/EntryTimeDataBind.java | 57 + .../clientgui/databind/Float32DataBind.java | 52 + .../clientgui/databind/Float64DataBind.java | 52 + .../clientgui/databind/Int16DataBind.java | 51 + .../clientgui/databind/Int16UDataBind.java | 51 + .../clientgui/databind/Int32DataBind.java | 51 + .../clientgui/databind/Int32UDataBind.java | 51 + .../clientgui/databind/Int64DataBind.java | 51 + .../clientgui/databind/Int8DataBind.java | 51 + .../clientgui/databind/Int8UDataBind.java | 51 + .../databind/OctetStringDataBind.java | 57 + .../clientgui/databind/OptfldsDataBind.java | 88 + .../clientgui/databind/QualityDataBind.java | 105 + .../databind/ReasonForInclusionDataBind.java | 76 + .../databind/TapCommandDataBind.java | 50 + .../clientgui/databind/TextFieldDataBind.java | 93 + .../clientgui/databind/TimeStampDataBind.java | 89 + .../databind/TriggerConditionDataBind.java | 72 + .../databind/UnicodeStringDataBind.java | 63 + .../databind/VisibleStringDataBind.java | 64 + .../openiec61850/clientgui/util/Counter.java | 37 + .../openiec61850/internal/cli/Action.java | 21 + .../internal/cli/ActionException.java | 23 + .../internal/cli/ActionListener.java | 9 + .../internal/cli/ActionProcessor.java | 120 + .../internal/cli/CliParameter.java | 47 + .../internal/cli/CliParameterBuilder.java | 61 + .../internal/cli/CliParseException.java | 23 + .../openiec61850/internal/cli/CliParser.java | 136 + .../internal/cli/FlagCliParameter.java | 36 + .../internal/cli/IntCliParameter.java | 45 + .../internal/cli/LongCliParameter.java | 45 + .../internal/cli/StringCliParameter.java | 41 + .../internal/cli/StringListCliParameter.java | 72 + .../internal/cli/ValueCliParameter.java | 32 + .../internal/scl/AbstractDataAttribute.java | 88 + .../internal/scl/AbstractElement.java | 56 + .../internal/scl/AbstractType.java | 35 + .../openiec61850/internal/scl/Bda.java | 28 + .../openmuc/openiec61850/internal/scl/Da.java | 80 + .../openiec61850/internal/scl/DaType.java | 46 + .../openmuc/openiec61850/internal/scl/Do.java | 49 + .../openiec61850/internal/scl/DoType.java | 54 + .../openiec61850/internal/scl/EnumType.java | 60 + .../openiec61850/internal/scl/EnumVal.java | 58 + .../openiec61850/internal/scl/LnSubDef.java | 32 + .../openiec61850/internal/scl/LnType.java | 50 + .../openiec61850/internal/scl/Sdo.java | 48 + .../internal/scl/TypeDefinitions.java | 88 + .../openiec61850/internal/scl/Util.java | 112 + .../openiec61850/internal/scl/Value.java | 23 + .../openiec61850-console-client | 20 + .../openiec61850-console-client.bat | 6 + src/run-scripts/console-server/logback.xml | 16 + .../openiec61850-console-server | 37 + .../openiec61850-console-server.bat | 6 + .../console-server/sample-model.icd | 293 + .../gui-client/openiec61850-gui-client | 39 + .../gui-client/openiec61850-gui-client.bat | 6 + src/test/java/.gitignore | 0 .../openmuc/josistack/ClientServerITest.java | 157 + .../openmuc/josistack/SiemensClientITest.java | 106 + .../jositransport/ClientServerITest.java | 181 + .../integrationtests/ClientServerITest.java | 521 ++ .../integrationtests/ClientServerITest2.java | 241 + .../integrationtests/SclTests.java | 19 + src/test/resources/openiec61850sample01.icd | 298 ++ src/test/resources/testModel.icd | 188 + src/test/resources/testModel2.icd | 1049 ++++ 308 files changed, 76352 insertions(+) create mode 100644 .gitignore create mode 100755 asn1/iso-acse-layer/compile.sh create mode 100644 asn1/iso-acse-layer/iso-acse-layer.asn create mode 100755 asn1/iso-presentation-layer/compile.sh create mode 100644 asn1/iso-presentation-layer/iso-presentation-layer.asn create mode 100755 asn1/mms/compile.sh create mode 100644 asn1/mms/mms.asn create mode 100644 asn1/mms/more-asn1-files/mms-epfl.asn create mode 100644 asn1/mms/more-asn1-files/mms-ioserver.asn create mode 100644 asn1/mms/more-asn1-files/mms-iso.asn create mode 100644 asn1/mms/more-asn1-files/mms-sisco.asn create mode 100644 asn1/mms/more-asn1-files/mms-stefan.asn create mode 100644 asn1/mms/more-asn1-files/mms-uniroma.asn create mode 100644 build.gradle create mode 100644 configuration.gradle create mode 100644 doc/CHANGELOG.txt create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 license/NOTICE create mode 100644 license/apache-license-2.0.txt create mode 100755 run-scripts/console-client/openiec61850-console-client create mode 100644 run-scripts/console-client/openiec61850-console-client.bat create mode 100644 run-scripts/console-server/logback.xml create mode 100755 run-scripts/console-server/openiec61850-console-server create mode 100644 run-scripts/console-server/openiec61850-console-server.bat create mode 100644 run-scripts/console-server/sample-model.icd create mode 100755 run-scripts/gui-client/openiec61850-gui-client create mode 100644 run-scripts/gui-client/openiec61850-gui-client.bat create mode 100755 src/asn1/iso-acse-layer/compile.sh create mode 100644 src/asn1/iso-acse-layer/iso-acse-layer.asn create mode 100755 src/asn1/iso-presentation-layer/compile.sh create mode 100644 src/asn1/iso-presentation-layer/iso-presentation-layer.asn create mode 100755 src/asn1/mms/compile.sh create mode 100644 src/asn1/mms/mms.asn create mode 100644 src/asn1/mms/more-asn1-files/mms-epfl.asn create mode 100644 src/asn1/mms/more-asn1-files/mms-ioserver.asn create mode 100644 src/asn1/mms/more-asn1-files/mms-iso.asn create mode 100644 src/asn1/mms/more-asn1-files/mms-sisco.asn create mode 100644 src/asn1/mms/more-asn1-files/mms-stefan.asn create mode 100644 src/asn1/mms/more-asn1-files/mms-uniroma.asn create mode 100644 src/build.gradle create mode 100644 src/configuration.gradle create mode 100644 src/doc/CHANGELOG.txt create mode 100644 src/docs/asciidoc/common-settings.txt create mode 100644 src/docs/asciidoc/images/banner.png create mode 100644 src/docs/asciidoc/openiec61850-doc.adoc create mode 100644 src/docs/asciidoc/openmuc-asciidoc.css create mode 100644 src/docs/asciidoc/pdf-theme.yml create mode 100644 src/gradle/wrapper/gradle-wrapper.jar create mode 100644 src/gradle/wrapper/gradle-wrapper.properties create mode 100755 src/gradlew create mode 100644 src/gradlew.bat create mode 100644 src/license/NOTICE create mode 100644 src/license/apache-license-2.0.txt create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AAREApdu.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AARQApdu.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ACSEApdu.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ACSERequirements.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEInvocationIdentifier.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEQualifier.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEQualifierForm2.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AETitle.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AETitleForm2.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APInvocationIdentifier.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APTitle.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APTitleForm2.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ApplicationContextName.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ApplicationContextNameList.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociateResult.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociateSourceDiagnostic.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociationInformation.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AuthenticationValue.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ImplementationData.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/MechanismName.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/Myexternal.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/Myexternal2.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/OidValues.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/RLREApdu.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/RLRQApdu.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ReleaseRequestReason.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ReleaseResponseReason.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/AbstractSyntaxName.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CPAPPDU.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CPType.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CalledPresentationSelector.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CallingPresentationSelector.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ContextList.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/DefaultContextName.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/FullyEncodedData.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ModeSelector.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PDVList.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextDefinitionList.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextDefinitionResultList.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextIdentifier.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationRequirements.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationSelector.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ProtocolVersion.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/RespondingPresentationSelector.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/Result.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ResultList.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/SimplyEncodedData.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/TransferSyntaxName.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/UserData.java create mode 100644 src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/UserSessionRequirements.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AccessResult.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AlternateAccess.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AlternateAccessSelection.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/BasicIdentifier.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConcludeRequestPDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedErrorPDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedRequestPDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedResponsePDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedServiceRequest.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedServiceResponse.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Data.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DataAccessError.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DefineNamedVariableListRequest.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DefineNamedVariableListResponse.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DeleteNamedVariableListRequest.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DeleteNamedVariableListResponse.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/FloatingPoint.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNameListRequest.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNameListResponse.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNamedVariableListAttributesRequest.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNamedVariableListAttributesResponse.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetVariableAccessAttributesRequest.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetVariableAccessAttributesResponse.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Identifier.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InformationReport.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateErrorPDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateRequestPDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateResponsePDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer16.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer32.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer8.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/MMSString.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/MMSpdu.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ObjectClass.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ObjectName.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ParameterSupportOptions.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ReadRequest.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ReadResponse.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/RejectPDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ServiceError.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ServiceSupportOptions.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TimeOfDay.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TypeDescription.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TypeSpecification.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UnconfirmedPDU.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UnconfirmedService.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned16.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned32.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned8.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UtcTime.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableAccessSpecification.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableDefs.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableSpecification.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/WriteRequest.java create mode 100644 src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/WriteResponse.java create mode 100644 src/main/java/org/openmuc/josistack/AcseAssociation.java create mode 100644 src/main/java/org/openmuc/josistack/AcseAssociationListener.java create mode 100644 src/main/java/org/openmuc/josistack/ByteBufferInputStream.java create mode 100644 src/main/java/org/openmuc/josistack/ClientAcseSap.java create mode 100644 src/main/java/org/openmuc/josistack/DecodingException.java create mode 100644 src/main/java/org/openmuc/josistack/ServerAcseSap.java create mode 100644 src/main/java/org/openmuc/jositransport/ClientTSap.java create mode 100644 src/main/java/org/openmuc/jositransport/ServerTSap.java create mode 100644 src/main/java/org/openmuc/jositransport/ServerThread.java create mode 100644 src/main/java/org/openmuc/jositransport/TConnection.java create mode 100644 src/main/java/org/openmuc/jositransport/TConnectionListener.java create mode 100644 src/main/java/org/openmuc/openiec61850/AcseListener.java create mode 100644 src/main/java/org/openmuc/openiec61850/Array.java create mode 100644 src/main/java/org/openmuc/openiec61850/BasicDataAttribute.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaBitString.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaBoolean.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaCheck.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaDoubleBitPos.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaEntryTime.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaFloat32.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaFloat64.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaInt16.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaInt16U.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaInt32.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaInt32U.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaInt64.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaInt8.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaInt8U.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaOctetString.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaOptFlds.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaQuality.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaReasonForInclusion.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaTapCommand.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaTimestamp.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaTriggerConditions.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaType.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaUnicodeString.java create mode 100644 src/main/java/org/openmuc/openiec61850/BdaVisibleString.java create mode 100644 src/main/java/org/openmuc/openiec61850/Brcb.java create mode 100644 src/main/java/org/openmuc/openiec61850/ClientAssociation.java create mode 100644 src/main/java/org/openmuc/openiec61850/ClientEventListener.java create mode 100644 src/main/java/org/openmuc/openiec61850/ClientSap.java create mode 100644 src/main/java/org/openmuc/openiec61850/ConstructedDataAttribute.java create mode 100644 src/main/java/org/openmuc/openiec61850/DataDefinitionResParser.java create mode 100644 src/main/java/org/openmuc/openiec61850/DataSet.java create mode 100644 src/main/java/org/openmuc/openiec61850/Fc.java create mode 100644 src/main/java/org/openmuc/openiec61850/FcDataObject.java create mode 100644 src/main/java/org/openmuc/openiec61850/FcModelNode.java create mode 100644 src/main/java/org/openmuc/openiec61850/HexConverter.java create mode 100644 src/main/java/org/openmuc/openiec61850/LogicalDevice.java create mode 100644 src/main/java/org/openmuc/openiec61850/LogicalNode.java create mode 100644 src/main/java/org/openmuc/openiec61850/ModelNode.java create mode 100644 src/main/java/org/openmuc/openiec61850/ObjectReference.java create mode 100644 src/main/java/org/openmuc/openiec61850/Rcb.java create mode 100644 src/main/java/org/openmuc/openiec61850/Report.java create mode 100644 src/main/java/org/openmuc/openiec61850/ReportEntryData.java create mode 100644 src/main/java/org/openmuc/openiec61850/SclParseException.java create mode 100644 src/main/java/org/openmuc/openiec61850/SclParser.java create mode 100644 src/main/java/org/openmuc/openiec61850/ServerAssociation.java create mode 100644 src/main/java/org/openmuc/openiec61850/ServerEventListener.java create mode 100644 src/main/java/org/openmuc/openiec61850/ServerModel.java create mode 100644 src/main/java/org/openmuc/openiec61850/ServerSap.java create mode 100644 src/main/java/org/openmuc/openiec61850/ServiceError.java create mode 100644 src/main/java/org/openmuc/openiec61850/ServiceSupport.java create mode 100644 src/main/java/org/openmuc/openiec61850/Urcb.java create mode 100644 src/main/java/org/openmuc/openiec61850/app/ConsoleClient.java create mode 100644 src/main/java/org/openmuc/openiec61850/app/ConsoleServer.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/BasicDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/ClientGui.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/DataObjectTreeCellRenderer.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/DataObjectTreeNode.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/DataSetTreeNode.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/DataTreeNode.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/ServerModelParser.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/SettingsFrame.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/BooleanDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/CheckDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/DoubleBitPosDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/EntryTimeDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Float32DataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Float64DataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Int16DataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Int16UDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Int32DataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Int32UDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Int64DataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Int8DataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/Int8UDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/OctetStringDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/OptfldsDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/QualityDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/ReasonForInclusionDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/TapCommandDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/TextFieldDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/TimeStampDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/TriggerConditionDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/UnicodeStringDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/databind/VisibleStringDataBind.java create mode 100644 src/main/java/org/openmuc/openiec61850/clientgui/util/Counter.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/Action.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/ActionException.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/ActionListener.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/ActionProcessor.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/CliParameter.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/CliParameterBuilder.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/CliParseException.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/CliParser.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/FlagCliParameter.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/IntCliParameter.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/LongCliParameter.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/StringCliParameter.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/StringListCliParameter.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/cli/ValueCliParameter.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/AbstractDataAttribute.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/AbstractElement.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/AbstractType.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/Bda.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/Da.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/DaType.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/Do.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/DoType.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/EnumType.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/EnumVal.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/LnSubDef.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/LnType.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/Sdo.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/TypeDefinitions.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/Util.java create mode 100644 src/main/java/org/openmuc/openiec61850/internal/scl/Value.java create mode 100755 src/run-scripts/console-client/openiec61850-console-client create mode 100644 src/run-scripts/console-client/openiec61850-console-client.bat create mode 100644 src/run-scripts/console-server/logback.xml create mode 100755 src/run-scripts/console-server/openiec61850-console-server create mode 100644 src/run-scripts/console-server/openiec61850-console-server.bat create mode 100644 src/run-scripts/console-server/sample-model.icd create mode 100755 src/run-scripts/gui-client/openiec61850-gui-client create mode 100644 src/run-scripts/gui-client/openiec61850-gui-client.bat create mode 100644 src/test/java/.gitignore create mode 100644 src/test/java/org/openmuc/josistack/ClientServerITest.java create mode 100644 src/test/java/org/openmuc/josistack/SiemensClientITest.java create mode 100644 src/test/java/org/openmuc/jositransport/ClientServerITest.java create mode 100644 src/test/java/org/openmuc/openiec61850/integrationtests/ClientServerITest.java create mode 100644 src/test/java/org/openmuc/openiec61850/integrationtests/ClientServerITest2.java create mode 100644 src/test/java/org/openmuc/openiec61850/integrationtests/SclTests.java create mode 100644 src/test/resources/openiec61850sample01.icd create mode 100644 src/test/resources/testModel.icd create mode 100644 src/test/resources/testModel2.icd diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c64abd --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +\#* +.\#* +*~ +target/ +bin/ +build/ +tmp/ +*.class +.gradle/ +.svn/ +.settings/ +.project +.classpath +.metadata/ +.externalToolBuilders/ +gradle.properties +doc/userguide/*.html +doc/userguide/*.pdf +*.hprof +gradle-app.setting +.factorypath +.apt_generated/ +#created by openiec61850 clientgui: +lastconnection.properties diff --git a/asn1/iso-acse-layer/compile.sh b/asn1/iso-acse-layer/compile.sh new file mode 100755 index 0000000..54fc975 --- /dev/null +++ b/asn1/iso-acse-layer/compile.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +rm ../../src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/* + +jasn1-compiler -o "../../src/main/java-gen/" -p "org.openmuc.josistack.internal.acse" -f iso-acse-layer.asn diff --git a/asn1/iso-acse-layer/iso-acse-layer.asn b/asn1/iso-acse-layer/iso-acse-layer.asn new file mode 100644 index 0000000..68cbfee --- /dev/null +++ b/asn1/iso-acse-layer/iso-acse-layer.asn @@ -0,0 +1,272 @@ +-- Module ACSE_1 (X.227:04/1995) +ASN1 {joint_iso_itu_t association_control(2) modules(0) apdus(0) version1(1)} +-- ACSE_1 refers to ACSE version 1 +DEFINITIONS ::= +BEGIN + +EXPORTS + acse_as_id, ACSE_apdu, aCSE_id, Application_context_name, AP_title, + AE_qualifier, AE_title, AP_invocation_identifier, AE_invocation_identifier, + Mechanism_name, Authentication_value, ACSE_requirements, ObjectSet; + + +-- The data types Name and RelativeDistinguishedName are imported from ISO/IEC 9594_2. +-- object identifier assignments +acse_as_id OBJECT IDENTIFIER ::= + {joint-iso-itu-t association-control(2) abstract-syntax(1) apdus(0) + version1(1)} + +-- may be used to reference the abstract syntax of the ACSE APDUs +aCSE_id OBJECT IDENTIFIER ::= + {joint-iso-itu-t association-control(2) ase-id(3) acse-ase(1) version(1)} + +-- may be used to identify the Association Control ASE. +-- top level CHOICE + ACSE_apdu ::= CHOICE { + aarq AARQ_apdu, + aare AARE_apdu, + rlrq RLRQ_apdu, + rlre RLRE_apdu +} + +AARQ_apdu ::= [APPLICATION 0] IMPLICIT SEQUENCE { + protocol_version [0] IMPLICIT BIT STRING OPTIONAL, + application_context_name [1] EXPLICIT OBJECT IDENTIFIER, + called_AP_title [2] AP_title OPTIONAL, + called_AE_qualifier [3] AE_qualifier OPTIONAL, + called_AP_invocation_identifier [4] EXPLICIT AP_invocation_identifier OPTIONAL, + called_AE_invocation_identifier [5] EXPLICIT AE_invocation_identifier OPTIONAL, + calling_AP_title [6] AP_title OPTIONAL, + calling_AE_qualifier [7] AE_qualifier OPTIONAL, + calling_AP_invocation_identifier [8] AP_invocation_identifier OPTIONAL, + calling_AE_invocation_identifier [9] AE_invocation_identifier OPTIONAL, + -- The following field shall not be present if only the Kernel is used. + sender_acse_requirements [10] IMPLICIT ACSE_requirements OPTIONAL, + -- The following field shall only be present if the Authentication functional unit is selected. + mechanism_name [11] IMPLICIT Mechanism_name OPTIONAL, + -- The following field shall only be present if the Authentication functional unit is selected. + calling_authentication_value [12] EXPLICIT Authentication_value OPTIONAL, + application_context_name_list + [13] IMPLICIT Application_context_name_list OPTIONAL, + -- The above field shall only be present if the Application Context Negotiation functional unit is selected + implementation_information [29] IMPLICIT Implementation_data OPTIONAL, + user_information [30] IMPLICIT Association_information OPTIONAL +} + + +AARE_apdu ::= [APPLICATION 1] IMPLICIT SEQUENCE { +--changed by Stefan Feuerhahn + protocol_version [0] IMPLICIT BIT STRING OPTIONAL, + application_context_name [1] EXPLICIT OBJECT IDENTIFIER, + result [2] EXPLICIT Associate_result, + result_source_diagnostic [3] EXPLICIT Associate_source_diagnostic, + responding_AP_title [4] EXPLICIT AP_title OPTIONAL, + responding_AE_qualifier [5] EXPLICIT AE_qualifier OPTIONAL, + responding_AP_invocation_identifier [6] EXPLICIT AP_invocation_identifier OPTIONAL, + responding_AE_invocation_identifier [7] EXPLICIT AE_invocation_identifier OPTIONAL, + -- The following field shall not be present if only the Kernel is used. + responder_acse_requirements [8] IMPLICIT ACSE_requirements OPTIONAL, + -- The following field shall only be present if the Authentication functional unit is selected. + mechanism_name [9] IMPLICIT Mechanism_name OPTIONAL, + -- This following field shall only be present if the Authentication functional unit is selected. + responding_authentication_value [10] EXPLICIT Authentication_value OPTIONAL, + application_context_name_list + [11] IMPLICIT Application_context_name_list OPTIONAL, + -- The above field shall only be present if the Application Context Negotiation functional unit is selected + implementation_information + [29] IMPLICIT Implementation_data OPTIONAL, + user_information [30] IMPLICIT Association_information OPTIONAL +} + +RLRQ_apdu ::= [APPLICATION 2] IMPLICIT SEQUENCE { + reason [0] IMPLICIT Release_request_reason OPTIONAL, + user_information [30] IMPLICIT Association_information OPTIONAL +} + +RLRE_apdu ::= [APPLICATION 3] IMPLICIT SEQUENCE { + reason [0] IMPLICIT Release_response_reason OPTIONAL, + user_information [30] IMPLICIT Association_information OPTIONAL +} + +-- ABRT_apdu ::= [APPLICATION 4] IMPLICIT SEQUENCE { +-- abort_source [0] IMPLICIT ABRT_source, +-- abort_diagnostic [1] IMPLICIT ABRT_diagnostic OPTIONAL, + -- This field shall not be present if only the Kernel is used. +-- user_information [30] IMPLICIT Association_information OPTIONAL +--} + +-- ABRT_diagnostic ::= ENUMERATED { +-- no_reason_given(1), protocol_error(2), +-- authentication_mechanism_name_not_recognized(3), +-- authentication_mechanism_name_required(4), authentication_failure(5), +-- authentication_required(6) +-- } + +-- ABRT_source ::= INTEGER {acse_service_user(0), acse_service_provider(1)} + + +ACSE_requirements ::= BIT STRING { + authentication(0), application_context_negotiation(1) +} + +Application_context_name_list ::= SEQUENCE OF Application_context_name + +-- Application_context_name ::= CHOICE { +-- application_context_name OBJECT IDENTIFIER +-- } + +Application_context_name ::= OBJECT IDENTIFIER + +-- Application_entity title productions follow (not in alphabetical order) +AP_title ::= CHOICE { +-- ap_title_form1 AP_title_form1, + ap_title_form2 AP_title_form2 +} + +AE_qualifier ::= CHOICE { +-- ae_qualifier_form1 AE_qualifier_form1, + ae_qualifier_form2 AE_qualifier_form2 +} + +-- When both AP_title and AE_qualifier data values are present in an AARQ or AARE APDU, both must +-- have the same form to allow the construction of an AE_title as discussed in CCITT Rec. X.665 | +-- ISO/IEC 9834_6. +-- AP_title_form1 ::= +-- Name + +-- The value assigned to AP_title_form1 is The Directory Name of an application_process title. +-- AE_qualifier_form1 ::= +-- RelativeDistinguishedName + +-- The value assigned to AE_qualifier_form1 is the relative distinguished name of a particular +-- application_entity of the application_process identified by AP_title_form1. +AP_title_form2 ::= OBJECT IDENTIFIER + +AE_qualifier_form2 ::= INTEGER + +AE_title ::= CHOICE { +-- ae_title_form1 AE_title_form1, + ae_title_form2 AE_title_form2 +} + +-- As defined in CCITT Rec. X.650 | ISO 7498_3, an application_entity title is composed of an application- +-- process title and an application_entity qualifier. The ACSE protocol provides for the transfer of an +-- application_entity title value by the transfer of its component values. However, the following data type +-- is provided for International Standards that reference a single syntactic structure for AE titles. +-- AE_title_form1 ::= +-- Name + +-- For access to The Directory (ITU_T Rec. X.500_Series | ISO/IEC 9594), an AE title has AE_title_form1. +-- This value can be constructed from AP_title_form1 and AE_qualifier_form1 values contained in an +-- AARQ or AARE APDU. A discussion of forming an AE_title_form1 from AP_title_form1 and AE_qualifier- +-- form1 may be found in CCITT Rec. X.665 | ISO/IEC 9834_6. +AE_title_form2 ::= OBJECT IDENTIFIER + +-- A discussion of forming an AE_title_form2 from AP_title_form2 and AE_qualifier_form2 may be +-- found in CCITT Rec. X.665 | ISO/IEC 9834_6. +AE_invocation_identifier ::= INTEGER + +AP_invocation_identifier ::= INTEGER + +-- End of Application_entity title productions +Associate_result ::= INTEGER { + accepted(0), rejected_permanent(1), rejected_transient(2)} + +Associate_source_diagnostic ::= CHOICE { + acse_service_user + [1] EXPLICIT INTEGER {null(0), no_reason_given(1), + application_context_name_not_supported(2), + calling_AP_title_not_recognized(3), + calling_AP_invocation_identifier_not_recognized(4), + calling_AE_qualifier_not_recognized(5), + calling_AE_invocation_identifier_not_recognized(6), + called_AP_title_not_recognized(7), + called_AP_invocation_identifier_not_recognized(8), + called_AE_qualifier_not_recognized(9), + called_AE_invocation_identifier_not_recognized(10), + authentication_mechanism_name_not_recognized(11), + authentication_mechanism_name_required(12), + authentication_failure(13), authentication_required(14)}, + acse_service_provider + [2] EXPLICIT INTEGER {null(0), no_reason_given(1), no_common_acse_version(2)} +} + +-- Association_information ::= SEQUENCE OF Association_information_item +Association_information ::= SEQUENCE OF Myexternal + +Myexternal ::= [UNIVERSAL 8] IMPLICIT SEQUENCE +{ + direct_reference OBJECT IDENTIFIER OPTIONAL, + indirect_reference INTEGER OPTIONAL, + encoding CHOICE + { single_ASN1_type [0] EXPLICIT ANY, + octet_aligned [1] IMPLICIT OCTET STRING, + arbitrary [2] IMPLICIT BIT STRING } +} + +Myexternal2 ::= [UNIVERSAL 8] IMPLICIT SEQUENCE +{ + direct_reference OBJECT IDENTIFIER OPTIONAL, + indirect_reference INTEGER OPTIONAL, + encoding CHOICE + { single_ASN1_type [0] EXPLICIT ANY, + octet_aligned [1] IMPLICIT OCTET STRING, + arbitrary [2] IMPLICIT BIT STRING } +} + + +--Association_information_item ::= [UNIVERSAL 8] IMPLICIT SEQUENCE { +-- direct_reference OBJECT IDENTIFIER OPTIONAL, +-- indirect_reference INTEGER OPTIONAL, +-- encoding CHOICE +-- { +-- single_ASN1_type [0] CHOICE { +-- single_ASN1_type ANY +-- }, +-- octet_aligned [1] IMPLICIT OCTET STRING, +-- arbitrary [2] IMPLICIT BIT STRING +-- } +-- } + +--is optional: +Authentication_value ::= CHOICE { + charstring [0] IMPLICIT GraphicString, + bitstring [1] IMPLICIT BIT STRING, + external [2] IMPLICIT Myexternal2 +-- other +-- [3] IMPLICIT SEQUENCE {other_mechanism_name +-- MECHANISM_NAME.&id({ObjectSet}), +-- other_mechanism_value +-- MECHANISM_NAME.&Type +-- ({ObjectSet}{@.other_mechanism_name})} +} + +-- The abstract syntax of (calling/responding) authentication_value is determined by the authentication +-- mechanism used during association establishment. The authentication mechanism is either explicitly +-- denoted by the &id field (of type OBJECT IDENTIFIER) for a mechanism belonging to the class +-- MECHANISM_NAME, or it is known implicitly by +-- prior agreement between the communicating partners. If the "other" component is chosen, then +-- the "mechanism_name" component must be present in accordance with +-- ITU_T Rec. X.680 | ISO/IEC 8824. If the value "mechanism_name" occurs in the AARQ_apdu or the +-- AARE_apdu, then that value must be the same as the value for "other_mechanism_name" +Implementation_data ::= GraphicString + +Mechanism_name ::= OBJECT IDENTIFIER + +Release_request_reason ::= INTEGER { + normal (0), + urgent (1), + user_defined (30) +} + +Release_response_reason ::= INTEGER { + normal (0), + not_finished (1), + user_defined (30) +} + + + +END + +-- Generated by Asnp, the ASN.1 pretty_printer of France Telecom R&D diff --git a/asn1/iso-presentation-layer/compile.sh b/asn1/iso-presentation-layer/compile.sh new file mode 100755 index 0000000..d552396 --- /dev/null +++ b/asn1/iso-presentation-layer/compile.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +rm ../../src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/*.java + +jasn1-compiler -o ../../src/main/java-gen/ -p org.openmuc.josistack.internal.presentation -f iso-presentation-layer.asn diff --git a/asn1/iso-presentation-layer/iso-presentation-layer.asn b/asn1/iso-presentation-layer/iso-presentation-layer.asn new file mode 100644 index 0000000..fcd17a0 --- /dev/null +++ b/asn1/iso-presentation-layer/iso-presentation-layer.asn @@ -0,0 +1,143 @@ +ASN1 DEFINITIONS ::= +BEGIN + + +CP_type ::= SET { + mode_selector [0] IMPLICIT Mode_selector, + --x410_mode_parameters [1] IMPLICIT SET { + -- COMPONENTS OF Reliable_Transfer_APDUs.RTORQapdu + --} OPTIONAL, + --- Shall be used for X.410 mode only. Shall be bitwise + --- compatible with CCITT Recommendation X.410_1984. + --- This shall be the User data parameter of the CP PPDU1) + normal_mode_parameters [2] IMPLICIT SEQUENCE { + protocol_version [0] IMPLICIT Protocol_version DEFAULT {version_1}, + calling_presentation_selector [1] IMPLICIT Calling_presentation_selector OPTIONAL, + called_presentation_selector [2] IMPLICIT Called_presentation_selector OPTIONAL, + presentation_context_definition_list [4] IMPLICIT Presentation_context_definition_list OPTIONAL, + default_context_name [6] IMPLICIT Default_context_name OPTIONAL, + presentation_requirements [8] IMPLICIT Presentation_requirements OPTIONAL, + user_session_requirements [9] IMPLICIT User_session_requirements OPTIONAL + -- shall not be present if equal to the Revised session + -- requirements parameter -- , + user_data User_data OPTIONAL + } OPTIONAL + -- Shall be used for normal mode only. + -- Shall be the parameters of the CP PPDU. +} + +CPA_PPDU ::= SET { + mode_selector [0] IMPLICIT Mode_selector, + --x410_mode_parameters [1] IMPLICIT SET { + -- COMPONENTS OF Reliable_Transfer_APDUs.RTOACapdu + --} OPTIONAL, + --- Shall be used for X.410 mode only. Shall be bitwise + --- compatible with CCITT Recommendation X.410_1984. + --- This shall be the User data parameter of the CPA PPDU1) + normal_mode_parameters [2] IMPLICIT SEQUENCE { + protocol_version [0] IMPLICIT Protocol_version DEFAULT {version_1}, + responding_presentation_selector [3] IMPLICIT Responding_presentation_selector OPTIONAL, + presentation_context_definition_result_list [5] IMPLICIT Presentation_context_definition_result_list OPTIONAL, + presentation_requirements [8] IMPLICIT Presentation_requirements OPTIONAL, + user_session_requirements [9] IMPLICIT User_session_requirements OPTIONAL, + -- shall not be present if equal to the Revised session + -- requirements parameter -- + user_data User_data OPTIONAL + } OPTIONAL + -- Shall be used for normal mode only. +} + +Responding_presentation_selector ::= Presentation_selector +Presentation_context_definition_result_list ::= Result_list + +Result_list ::= SEQUENCE OF SEQUENCE { + result [0] IMPLICIT Result, + transfer_syntax_name [1] IMPLICIT Transfer_syntax_name OPTIONAL, + provider_reason [2] IMPLICIT INTEGER { + reason_not_specified (0), + abstract_syntax_not_supported (1), + proposed_transfer_syntaxes_not_supported (2), + local_limit_on_DCS_exceeded (3) + } OPTIONAL +} + +Result ::= INTEGER { + acceptance (0), + user_rejection (1), + provider_rejection (2) +} + +Mode_selector ::= SET { + mode_value [0] IMPLICIT INTEGER { x410_1984_mode (0), normal_mode (1) } +} + + +User_data ::= CHOICE { + simply_encoded_data [APPLICATION 0] IMPLICIT Simply_encoded_data, + fully_encoded_data [APPLICATION 1] IMPLICIT Fully_encoded_data +} +-- Subclause 8.4 defines when each of the two alternatives shall be used. + +Simply_encoded_data ::= OCTET STRING +-- See 8.4.1. + +Fully_encoded_data ::= SEQUENCE OF PDV_list +-- contains one or more PDV_list values. +-- See 8.4.2. + +PDV_list ::= SEQUENCE { + transfer_syntax_name Transfer_syntax_name OPTIONAL, + presentation_context_identifier Presentation_context_identifier, + presentation_data_values CHOICE { + single_ASN1_type [0] ANY, + -- Type corresponding to presentation context identifier + octet_aligned [1] IMPLICIT OCTET STRING, + arbitrary [2] IMPLICIT BIT STRING + } + -- Contains one or more presentation data values from the same + -- presentation context. + -- See 8.4.2. +} + + +Presentation_context_definition_list ::= Context_list + +Context_list ::= SEQUENCE OF SEQUENCE { + presentation_context_identifier Presentation_context_identifier, + abstract_syntax_name Abstract_syntax_name, + transfer_syntax_name_list SEQUENCE OF Transfer_syntax_name +} + +Presentation_context_identifier ::= INTEGER +Abstract_syntax_name ::= OBJECT IDENTIFIER +Transfer_syntax_name ::= OBJECT IDENTIFIER +Protocol_version ::= BIT STRING { version_1 (0) } +Calling_presentation_selector ::= Presentation_selector +Called_presentation_selector ::= Presentation_selector +Presentation_selector ::= OCTET STRING + + +Default_context_name ::= SEQUENCE { + abstract_syntax_name [0] IMPLICIT Abstract_syntax_name, + transfer_syntax_name [1] IMPLICIT Transfer_syntax_name +} + +Presentation_requirements ::= BIT STRING { context_management (0), restoration (1) } + +User_session_requirements ::= BIT STRING { + half_duplex (0), + duplex (1), + expedited_data (2), + minor_synchronize (3), + major_synchronize (4), + resynchronize (5), + activity_management (6), + negotiated_release (7), + capability_data (8), + exceptions (9), + typed_data (10), + symmetric_synchronize (11), + data_separation (12) +} + +END diff --git a/asn1/mms/compile.sh b/asn1/mms/compile.sh new file mode 100755 index 0000000..38098a0 --- /dev/null +++ b/asn1/mms/compile.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +rm -r ../../src/main/java-gen/* + +jasn1-compiler -o "../../src/main/java-gen" -p "org.openmuc.openiec61850.internal.mms" -f mms.asn diff --git a/asn1/mms/mms.asn b/asn1/mms/mms.asn new file mode 100644 index 0000000..6838ae9 --- /dev/null +++ b/asn1/mms/mms.asn @@ -0,0 +1,723 @@ +-- +-- Part of the ASN.1-Specification for MMS +-- tries to include only those parts relevant for IEC 61850 +-- source: http://www.nettedautomation.com/standardization/iso/tc184/sc5/wg2/mms_syntax/Version1999/mms_syntax.html + +ASN1 { iso standard 9506 part(2) mms-general-module-version(2) } DEFINITIONS ::= BEGIN + +MMSpdu ::= CHOICE { + confirmed-RequestPDU [0] IMPLICIT Confirmed-RequestPDU, + confirmed-ResponsePDU [1] IMPLICIT Confirmed-ResponsePDU, + confirmed-ErrorPDU [2] IMPLICIT Confirmed-ErrorPDU, + unconfirmed-PDU [3] IMPLICIT Unconfirmed-PDU, + rejectPDU [4] IMPLICIT RejectPDU, + initiate-RequestPDU [8] IMPLICIT Initiate-RequestPDU, + initiate-ResponsePDU [9] IMPLICIT Initiate-ResponsePDU, + initiate-ErrorPDU [10] IMPLICIT Initiate-ErrorPDU, + conclude-RequestPDU [11] IMPLICIT Conclude-RequestPDU +} + +Confirmed-RequestPDU ::= SEQUENCE { + invokeID Unsigned32, + service ConfirmedServiceRequest +} + +ConfirmedServiceRequest ::= CHOICE { + getNameList [1] IMPLICIT GetNameList-Request, + read [4] IMPLICIT Read-Request, + write [5] IMPLICIT Write-Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes-Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Request, + getNamedVariableListAttributes [12] GetNamedVariableListAttributes-Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Request +} + +Unconfirmed-PDU ::= SEQUENCE { + service UnconfirmedService +} + +UnconfirmedService ::= CHOICE { + informationReport [0] IMPLICIT InformationReport +} + +Confirmed-ResponsePDU ::= SEQUENCE { + invokeID Unsigned32, + service ConfirmedServiceResponse +} + +ConfirmedServiceResponse ::= CHOICE { + getNameList [1] IMPLICIT GetNameList-Response, + read [4] IMPLICIT Read-Response, + write [5] IMPLICIT Write-Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes-Response, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Response, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes-Response, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Response +} + + +Confirmed-ErrorPDU ::= SEQUENCE { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError +} + + +ServiceError ::= SEQUENCE { + errorClass [0] CHOICE { + vmd_state [0] IMPLICIT INTEGER, +-- { +-- other (0), +-- vmd-state-conflict (1), +-- vmd-operational-problem (2), +-- domain-transfer-problem (3), +-- state-machine-id-invalid (4) +-- }, + application_reference [1] IMPLICIT INTEGER, +-- { +-- other (0), +-- aplication-unreachable (1), +-- connection-lost (2), +-- application-reference-invalid (3), +-- context-unsupported (4) +-- }, + definition [2] IMPLICIT INTEGER, +-- { +-- other (0), +-- object-undefined (1), +-- invalid-address (2), +-- type-unsupported (3), +-- type-inconsistent (4), +-- object-exists (5), +-- object-attribute-inconsistent (6) +-- }, + resource [3] IMPLICIT INTEGER, +-- { +-- other (0), +-- memory-unavailable (1), +-- processor-resource-unavailable (2), +-- mass-storage-unavailable (3), +-- capability-unavailable (4), +-- capability-unknown (5) +-- }, + service [4] IMPLICIT INTEGER, +-- { +-- other (0), +-- primitives-out-of-sequence (1), +-- object-state-conflict (2), +-- pdu-size (3), +-- continuation-invalid (4), +-- object-constraint-conflict (5) +-- }, + service_preempt [5] IMPLICIT INTEGER, +-- { +-- other (0), +-- timeout (1), +-- deadlock (2), +-- cancel (3) +-- }, + time_resolution [6] IMPLICIT INTEGER, +-- { +-- other (0), +-- unsupportable-time-resolution (1) +-- }, + access [7] IMPLICIT INTEGER, +-- { +-- other (0), +-- object-access-unsupported (1), +-- object-non-existent (2), +-- object-access-denied (3), +-- object-invalidated (4) +-- }, + initiate [8] IMPLICIT INTEGER, +-- { +-- other (0), +-- version-incompatible (1), +-- max-segment-insufficient (2), +-- max-services-outstanding-calling-insufficient (3), +-- max-services-outstanding-called-insufficient (4), +-- service-CBB-insufficient (5), +-- parameter-CBB-insufficient (6), +-- nesting-level-insufficient (7) +-- }, + conclude [9] IMPLICIT INTEGER, +-- { +-- other (0), +-- further-communication-required (1) +-- }, + cancel [10] IMPLICIT INTEGER, +-- { +-- other (0), +-- invoke-id-unknown (1), +-- cancel-not-possible (2) +-- }, + file [11] IMPLICIT INTEGER, +-- { +-- other (0), +-- filename-ambiguous (1), +-- file-busy (2), +-- filename-syntax_Error (3), +-- content-type-invalid (4), +-- position-invalid (5), +-- file-acces-denied (6), +-- file-non-existent (7), +-- duplicate-filename (8), +-- insufficient-space-in-filestore (9) +-- }, + others [12] IMPLICIT INTEGER + }, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL +-- serviceSpecificInformation [3] CHOICE +-- { +-- obtainFile [0] IMPLICIT ObtainFile_Error, +-- start [1] IMPLICIT Start_Error, +-- stop [2] IMPLICIT Stop_Error, +-- resume [3] IMPLICIT Resume_Error, +-- reset [4] IMPLICIT Reset_Error, +-- deleteVariableAccess [5] IMPLICIT DeleteVariableAccess_Error, +-- deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList_Error, +-- deleteNamedType [7] IMPLICIT DeleteNamedType_Error, +-- defineEventEnrollment_Error [8] DefineEventEnrollment_Error, +-- fileRename [9] IMPLICIT FileRename_Error +-- this one is neither in this ASN nor in the IMPORTS +-- additionalService [10] AdditionalServiceError +-- } OPTIONAL + } + + +TimeOfDay ::= OCTET STRING (SIZE(4|6)) + +BasicIdentifier ::= VisibleString ( FROM +("A"|"a"|"B"|"b"|"C"|"c"|"D"|"d"|"E"|"e"|"F"|"f"| +"G"|"g"|"H"|"h"|"I"|"i"|"J"|"j"|"K"|"k"|"L"|"l"| +"M"|"m"|"N"|"n"|"O"|"o"|"P"|"p"|"Q"|"q"|"R"|"r"| +"S"|"s"|"T"|"t"|"U"|"u"|"V"|"v"|"W"|"w"|"X"|"x"| +"Y"|"y"|"Z"|"z"|"$"|"_"|"0"|"1"|"2"|"3"|"4"|"5"| +"6"|"7"|"8"|"9") ) (SIZE(1..32)) + + +Identifier ::= VisibleString + +Integer8 ::= INTEGER(-128..127) +Integer16 ::= INTEGER(-32768..32767) +Integer32 ::= INTEGER(-2147483648..2147483647) + +Unsigned8 ::= INTEGER(0..255) +Unsigned16 ::= INTEGER(0..65535) +Unsigned32 ::= INTEGER(0..4294967295) + +ObjectName ::= CHOICE { + vmd-specific [0] IMPLICIT Identifier, + domain-specific [1] IMPLICIT SEQUENCE { + domainID Identifier, + itemID Identifier + }, + aa-specific [2] IMPLICIT Identifier +} + + +ObjectClass ::= CHOICE { + basicObjectClass [0] IMPLICIT INTEGER +-- { +-- namedVariable (0), +-- scatteredAccess (1), +-- namedVariableList (2), +-- namedType (3), +-- semaphore (4), +-- eventCondition (5), +-- eventAction (6), +-- eventEnrollment (7), +-- journal (8), +-- domain (9), +-- programInvocation (10), +-- operatorStation (11), +-- dataExchange (12), ---- Shall not appear in minor version 1 +-- accessControlList (13) ---- Shall not appear in minor version 1 or 2 +-- } +} + +MMSString ::= VisibleString + + +Initiate-RequestPDU ::= SEQUENCE { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initRequestDetail [4] IMPLICIT SEQUENCE { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions + } +} + +Initiate-ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initResponseDetail [4] IMPLICIT SEQUENCE { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions + } +} + +Initiate-ErrorPDU ::= ServiceError + +Conclude-RequestPDU ::= NULL + + +RejectPDU ::= SEQUENCE +{ + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE + { + confirmed-requestPDU [1] IMPLICIT INTEGER, +-- { +-- other (0), +-- unrecognized-service (1), +-- unrecognized-modifier (2), +-- invalid-invokeID (3), +-- invalid-argument (4), +-- invalid-modifier (5), +-- max-serv-outstanding-exceeded (6), +-- max-recursion-exceeded (8), +-- value-out-of-range (9) +-- }, + + confirmed-responsePDU [2] IMPLICIT INTEGER, +-- { +-- other (0), +-- unrecognized-service (1), +-- invalid-invokeID (2), +-- invalid-result (3), +-- max-recursion-exceeded (5), +-- value-out-of-range (6) +-- }, + + confirmed-errorPDU [3] IMPLICIT INTEGER, +-- { +-- other (0), +-- unrecognized-service (1), +-- invalid-invokeID (2), +-- invalid-serviceError (3), +-- value-out-of-range (4) +-- } , + + unconfirmedPDU [4] IMPLICIT INTEGER, +-- { +-- other (0), +-- unrecognized-service (1), +-- invalid-argument (2), +-- max-recursion-exceeded (3), +-- value-out-of-range (4) +-- }, + + pdu-error [5] IMPLICIT INTEGER, +-- { +-- unknown-pdu-type (0), +-- invalid-pdu (1), +-- illegal-acse-mapping (2) +-- }, + + cancel-requestPDU [6] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-invokeID (1) +-- }, + + cancel-responsePDU [7] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-invokeID (1) +-- }, + + cancel-errorPDU [8] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-invokeID (1), +-- invalid-serviceError (2), +-- value-out-of-range (3) +-- }, + + conclude-requestPDU [9] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-argument (1) +-- }, + + conclude-responsePDU [10] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-result (1) +-- }, + + conclude-errorPDU [11] IMPLICIT INTEGER +-- { +-- other (0), +-- invalid-serviceError (1), +-- value-out-of-range (2) +-- } + } +} + + +GetNameList-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + objectScope [1] CHOICE { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL +} + + +GetNameList-Response ::= SEQUENCE { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + + +TypeSpecification ::= CHOICE { +-- typeName [0] ObjectName, + typeDescription TypeDescription +} + +AlternateAccess ::= SEQUENCE OF CHOICE { + unnamed AlternateAccessSelection +-- named [5] IMPLICIT SEQUENCE { +-- componentName [0] CHOICE { +-- basic BasicIdentifier, +-- extended ExtendedIdentifier +-- }, +-- access AlternateAccessSelection +-- } +} + +AlternateAccessSelection ::= CHOICE { + + selectAlternateAccess [0] IMPLICIT SEQUENCE { + accessSelection CHOICE { + component [0] CHOICE { + basic BasicIdentifier --, + --extended ExtendedIdentifier + }, -- component + index [1] IMPLICIT Unsigned32, -- 1 array element + indexRange [2] IMPLICIT SEQUENCE { -- array elements + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [3] IMPLICIT NULL -- all array elements + }, + alternateAccess AlternateAccess + }, + selectAccess CHOICE { + component [1] CHOICE { + basic BasicIdentifier --, + --extended ExtendedIdentifier + }, -- component + index [2] IMPLICIT Unsigned32, -- 1 array element + indexRange [3] IMPLICIT SEQUENCE { -- array elements + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [4] IMPLICIT NULL -- all array elements + } +} + +AccessResult ::= CHOICE { + failure [0] IMPLICIT DataAccessError, + success Data +} + + +Data ::= CHOICE { + -- context tag 0 is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + --boolean [3] IMPLICIT BOOLEAN, + bool [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, -- shall not be negative + floating-point [7] IMPLICIT FloatingPoint, + -- [8] is reserved + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + --generalized-time [11] IMPLICIT GeneralizedTime, + binary-time [12] IMPLICIT TimeOfDay, + --bcd [13] IMPLICIT INTEGER, ---- shall not be negative + --booleanArray [14] IMPLICIT BIT STRING, + --objId [15] IMPLICIT OBJECT IDENTIFIER, + --..., + mMSString [16] IMPLICIT MMSString, + utc-time [17] IMPLICIT UtcTime -- added by IEC61850 8.1 G3 +} + + +FloatingPoint ::= OCTET STRING + +DataAccessError ::= INTEGER +--{ +-- object-invalidated (0), +-- hardware-fault (1), +-- temporarily-unavailable (2), +-- object-access-denied (3), +-- object-undefined (4), +-- invalid-address (5), +-- type-unsupported (6), +-- type-inconsistent (7), +-- object-attribute-inconsistent (8), +-- object-access-unsupported (9), +-- object-non-existent (10), +-- object-value-invalid (11) +--} + + +VariableAccessSpecification ::= CHOICE { + listOfVariable [0] IMPLICIT VariableDefs, + variableListName [1] ObjectName +} + +VariableDefs ::= SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL +} + +VariableSpecification ::= CHOICE { + name [0] ObjectName +-- address [1] Address, +-- variableDescription [2] IMPLICIT SEQUENCE { +-- address Address, +-- typeSpecificationTypeSpecification +-- }, + +-- the following element is present only to support the services +-- defined in annex E +-- scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, +-- invalidated [4] IMPLICIT NULL +} + +Read-Request ::= SEQUENCE { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification +} + +Read-Response ::= SEQUENCE { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult +} + +Write-Request ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data +} + +Write-Response ::= SEQUENCE OF CHOICE { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL +} + +InformationReport ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult +} + +GetVariableAccessAttributes-Request ::= CHOICE { + name [0] ObjectName +-- address [1] Address +} + +GetVariableAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, +-- address [1] Address OPTIONAL, + typeDescription [2] TypeDescription +-- accessControlList [3] CHOICE { +-- basic BasicIdentifier, +-- extended ExtendedIdentifier +-- } OPTIONAL, +-- meaning [4] ObjectName OPTIONAL +} + +DefineNamedVariableList-Request ::= SEQUENCE { + variableListName ObjectName, + listOfVariable [0] IMPLICIT VariableDefs +} + +DefineNamedVariableList-Response ::= NULL + +GetNamedVariableListAttributes-Request ::= ObjectName -- VariableListName + +GetNamedVariableListAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT VariableDefs +-- accessControlList [2] CHOICE { +-- basic BasicIdentifier, +-- extended ExtendedIdentifier +-- } OPTIONAL +} + + +DeleteNamedVariableList-Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER DEFAULT 0, +-- { +-- specific (0), +-- aa-specific (1), +-- domain (2), +-- vmd (3) +-- } DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] CHOICE { + basic BasicIdentifier --, + --extended ExtendedIdentifier + } OPTIONAL +} + +DeleteNamedVariableList-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 +} + +TypeDescription ::= CHOICE { + array [1] IMPLICIT SEQUENCE { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification + }, + structure [2] IMPLICIT SEQUENCE { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF SEQUENCE { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + }, + + -- Simple Size Class + --boolean [3] IMPLICIT NULL, + bool [3] IMPLICIT NULL, + bit-string [4] IMPLICIT Integer32, -- BIT-STRING + integer [5] IMPLICIT Unsigned8, -- INTEGER + unsigned [6] IMPLICIT Unsigned8, -- UNSIGNED + floating-point [7] IMPLICIT SEQUENCE { + format-width Unsigned8, -- number of bits of + -- floating point value + -- including sign, exponent, + -- and fraction + exponent-width Unsigned8 -- size of exponent in bits + }, + + -- [8] is reserved + octet-string [9] IMPLICIT Integer32, -- OCTET-STRING + visible-string [10] IMPLICIT Integer32, -- VISIBLE-STRING + -- generalized-time [11] IMPLICIT NULL, ---- GENERALIZED-TIME + binary-time [12] IMPLICIT BOOLEAN, -- BINARY-TIME + -- bcd [13] IMPLICIT Unsigned8, ---- BCD + -- objId [15] IMPLICIT NULL, + --..., + mMSString [16] IMPLICIT Integer32, -- MMS String + utc-time [17] IMPLICIT NULL -- from IEC61850 8.1 G.2 + } + +UtcTime ::= OCTET STRING (SIZE (8)) + + +ParameterSupportOptions ::= BIT STRING +--{ +-- str1 (0), str2 (1), vnam (2), valt (3), vadr (4), vsca (5), tpy (6), vlis (7), real (8), cei (10) +--} + +ServiceSupportOptions ::= BIT STRING +-- { +-- status (0), +-- getNameList (1), +-- identify (2), +-- rename (3), +-- read (4), +-- write (5), +-- getVariableAccessAttributes (6), +-- defineNamedVariable (7), +-- defineScatteredAccess (8), +-- getScatteredAccessAttributes (9), +-- deleteVariableAccess (10), +-- defineNamedVariableList (11), +-- getNamedVariableListAttributes (12), +-- deleteNamedVariableList (13), +-- defineNamedType (14), +-- getNamedTypeAttributes (15), +-- deleteNamedType (16), +-- input (17), +-- output (18), +-- takeControl (19), +-- relinquishControl (20), +-- defineSemaphore (21), +-- deleteSemaphore (22), +-- reportSemaphoreStatus (23), +-- reportPoolSemaphoreStatus (24), +-- reportSemaphoreEntryStatus (25), +-- initiateDownloadSequence (26), +-- downloadSegment (27), +-- terminateDownloadSequence (28), +-- initiateUploadSequence (29), +-- uploadSegment (30), +-- terminateUploadSequence (31), +-- requestDomainDownload (32), +-- requestDomainUpload (33), +-- loadDomainContent (34), +-- storeDomainContent (35), +-- deleteDomain (36), +-- getDomainAttributes (37), +-- createProgramInvocation (38), +-- deleteProgramInvocation (39), +-- start (40), +-- stop (41), +-- resume (42), +-- reset (43), +-- kill (44), +-- getProgramInvocationAttributes (45), +-- obtainFile (46), +-- defineEventCondition (47), +-- deleteEventCondition (48), +-- getEventConditionAttributes (49), +-- reportEventConditionStatus (50), +-- alterEventConditionMonitoring (51), +-- triggerEvent (52), +-- defineEventAction (53), +-- deleteEventAction (54), +-- getEventActionAttributes (55), +-- reportEventActionStatus (56), +-- defineEventEnrollment (57), +-- deleteEventEnrollment (58), +-- alterEventEnrollment (59), +-- reportEventEnrollmentStatus (60), +-- getEventEnrollmentAttributes (61), +-- acknowledgeEventNotification (62), +-- getAlarmSummary (63), +-- getAlarmEnrollmentSummary (64), +-- readJournal (65), +-- writeJournal (66), +-- initializeJournal (67), +-- reportJournalStatus (68), +-- createJournal (69), +-- deleteJournal (70), +-- getCapabilityList (71), +-- fileOpen (72), +-- fileRead (73), +-- fileClose (74), +-- fileRename (75), +-- fileDelete (76), +-- fileDirectory (77), +-- unsolicitedStatus (78), +-- informationReport (79), +-- eventNotification (80), +-- attachToEventCondition (81), +-- attachToSemaphore (82), +-- conclude (83), +-- cancel (84) +-- } + + + +END diff --git a/asn1/mms/more-asn1-files/mms-epfl.asn b/asn1/mms/more-asn1-files/mms-epfl.asn new file mode 100644 index 0000000..99826b2 --- /dev/null +++ b/asn1/mms/more-asn1-files/mms-epfl.asn @@ -0,0 +1,3468 @@ +--Quelle: http://lamspeople.epfl.ch/kirrmann/mms/Documentation/mms_abstract_syntax.htm +-- Pretty-printed by Asnp, the pretty-printer of France Telecom R&D +-- MMS & GOOSE +-- This file contains all ASN.1 encodings for MMS 9506-2003, plus the additions for IEC 61850 8.1 +-- (Annex G) and GOOSE (Annex A) +-- As a modification (that does not affect decoding), type utc-time has +-- been moved to the 9506 encodings according to Annex G +-- This file has been checked with the OSS parser +-- ABB Switzerland Corporate Research , Hubert Kirrmann 2005-07-21 +-- This file starts with the IEC61850 definitions. + +IEC61850 DEFINITIONS ::= +BEGIN + +IMPORTS + Data, UtcTime + FROM ISO-9506-MMS-1 {iso standard 9506 part(2) + mms-abstract-syntax-version1(1)}; + +IEC61850-8-1SpecificProtocol ::= CHOICE { + gseMngtPdu [APPLICATION 0] IMPLICIT GSEMngtPdu, + goosePdu [APPLICATION 1] IMPLICIT IECGoosePdu} + +GSEMngtPdu ::= SEQUENCE { + stateID [0] IMPLICIT INTEGER, + security [3] OCTET STRING OPTIONAL, -- reserved for future definition + req-or-resp + CHOICE {requests [1] GSEMngtRequests, + responses [2] GSEMngtResponses}} + +GSEMngtRequests ::= CHOICE { + getGoReference [1] IMPLICIT GetReferenceRequestPdu, + getGOOSEElementNumber [2] IMPLICIT GetElementRequestPdu, + getGsReference [3] IMPLICIT GetReferenceRequestPdu, + getGSSEDataOffset [4] IMPLICIT GetElementRequestPdu} + +GSEMngtResponses ::= CHOICE { + gseMngtNotSupported [0] IMPLICIT NULL, + getGoReference [1] IMPLICIT GSEMngtResponsePdu, + getGOOSEElementNumber [2] IMPLICIT GSEMngtResponsePdu, + getGsReference [3] IMPLICIT GSEMngtResponsePdu, + getGSSEDataOffset [4] IMPLICIT GSEMngtResponsePdu} + +GetReferenceRequestPdu ::= SEQUENCE { + ident [0] IMPLICIT VisibleString, -- size shall support up to 65 octets + offset [1] IMPLICIT SEQUENCE OF INTEGER} + +GetElementRequestPdu ::= SEQUENCE { + ident [0] IMPLICIT VisibleString, -- size shall support up to 65 octets + references [1] IMPLICIT SEQUENCE OF VisibleString} + +GSEMngtResponsePdu ::= SEQUENCE { + ident [0] IMPLICIT VisibleString, -- echos the value of the request + confRev [1] IMPLICIT INTEGER OPTIONAL, + response + CHOICE {responsePositive + [2] IMPLICIT SEQUENCE {datSet + [0] IMPLICIT VisibleString OPTIONAL, + result + [1] IMPLICIT SEQUENCE OF RequestResults}, + responseNegative [3] IMPLICIT GlbErrors}} + +RequestResults ::= CHOICE { + offset [0] IMPLICIT INTEGER, + reference [1] IMPLICIT IA5String, + error [2] IMPLICIT ErrorReason} + +GlbErrors ::= INTEGER { + other(0), unknownControlBlock(1), responseTooLarge(2), + controlBlockConfigurationError(3)} + +ErrorReason ::= INTEGER {other(0), notFound(1)} + +IECGoosePdu ::= SEQUENCE { + gocbRef [0] IMPLICIT VisibleString, + timeAllowedtoLive [1] IMPLICIT INTEGER, + datSet [2] IMPLICIT VisibleString, + goID [3] IMPLICIT VisibleString OPTIONAL, + t [4] IMPLICIT UtcTime, + stNum [5] IMPLICIT INTEGER, + sqNum [6] IMPLICIT INTEGER, + test [7] IMPLICIT BOOLEAN DEFAULT FALSE, + confRev [8] IMPLICIT INTEGER, + ndsCom [9] IMPLICIT BOOLEAN DEFAULT FALSE, + numDatSetEntries [10] IMPLICIT INTEGER, + allData [11] IMPLICIT SEQUENCE OF Data, + security [12] OCTET STRING OPTIONAL + -- reserved for digital signature--} + +-- UtcTime ::= OCTET STRING format and size defined in 8.1.3.6. moved to 9506 +END + + + +-- ==================================================================== +MMS-Object-Module-1 {iso standard 9506 part(1) mms-object-model-version1(2)} +DEFINITIONS ::= +BEGIN + +-- This ASN.1 specification for IEC 9506-2003 has been checked for conformance with the +-- ASN.1 standard by the OSS ASN.1 Tools. +-- It has been modified (2005-07-19) to include the IEC 61850 type utc-time and +-- extend the identifier size according to 61850 8.1 G.2 - G.3, and introduce two +-- additional encodings for the Data type. + +EXPORTS + AccessCondition, AdditionalCBBOptions, AdditionalSupportOptions, Address, + AlarmAckRule, Control-State, DomainState, EC-State, EC-Class, EE-Duration, + EE-Class, EventTime, Journal-Variable, LogicalStatus, Modifier, + normalPriority, normalSeverity, ParameterSupportOptions, PhysicalStatus, + Priority, ProgramInvocationState, Running-Mode, ServiceSupportOptions, + Severity, Transitions, TypeDescription, ULState, VMDState; + +IMPORTS + ApplicationReference, Authentication-value + FROM MMS-Environment-1 {iso standard 9506 part(2) + mms-environment-version1(4)} + AlternateAccess, ConfirmedServiceRequest, AttachToSemaphore, + AttachToEventCondition, Data, EE-State, Identifier, Integer8, Integer32, + MMSString, MMS255String, ObjectName, TimeOfDay, TypeSpecification, + Unsigned32, Unsigned8 + FROM ISO-9506-MMS-1 {iso standard 9506 part(2) + mms-abstract-syntax-version1(1)}; + +-- Part 1 - Object Model Definitions +-- +-- Note - ASN.1 rules for interpreting the object formalism. +-- +-- Each field has a field identifier possibly followed by a name. +-- The field identifier begins with an '&' and is followed by a reference name, +-- beginning with either a lower case or an upper case letter. +-- +-- If the field identifier begins with '&' Upper case letter: +-- +-- If there is no following name, +-- the field identifies a type. +-- If the following name is mixed case +-- and begins with an upper case letter, +-- or if the following name is upper case +-- and the name of a Universal type, +-- the field identifies a value set. +-- If the following name is upper case +-- and the name of an Object Class, +-- the field identifies an Object Set. +-- +-- If the field identifier begins with '&' lower case letter: +-- +-- If the following name is upper case +-- and the name of an Object Class, +-- the field identifies an Object (instance). +-- If the following name is mixed case +-- and begins with an upper case letter, +-- or if the following name is upper case +-- and is the name of a Universal type, +-- the field identifies a value. +-- +VMD ::= CLASS { + &executiveFunction ApplicationReference, + &vendorName MMSString, + &modelName MMSString, + &revision MMSString, + &AbstractSyntaxes ABSTRACT-SYNTAX OPTIONAL, + &EATransactions TRANSACTION OPTIONAL, + &Associations APPLICATION-ASSOCIATION, + &accessControl Identifier, + &logicalStatus LogicalStatus, + &Capabilities MMSString, + &physicalStatus PhysicalStatus, + &local-detail BIT STRING(SIZE (1..128)), + &AccessControlLists ACCESS-CONTROL-LIST OPTIONAL, + &Domains DOMAIN OPTIONAL, + &ProgramInvocations PROGRAM-INVOCATION OPTIONAL, + &UnitControls UNIT-CONTROL OPTIONAL, + &UnnamedVariables UNNAMED-VARIABLE OPTIONAL, + &NamedVariables NAMED-VARIABLE OPTIONAL, + &NamedVariableLists NAMED-VARIABLE-LIST OPTIONAL, + &NamedTypes NAMED-TYPE OPTIONAL, + &DataExchanges DATA-EXCHANGE OPTIONAL, + &Semaphores SEMAPHORE OPTIONAL, + &OperatorStations OPERATOR-STATION OPTIONAL, + &EventConditions EVENT-CONDITION OPTIONAL, + &EventActions EVENT-ACTION OPTIONAL, + &EventEnrollments EVENT-ENROLLMENT OPTIONAL, + &EventConditionLists EVENT-CONDITION-LIST OPTIONAL, + &Journals JOURNAL OPTIONAL, + &operationState VMDState, + &safety-Interlocks-Violated BOOLEAN, + &any-Resource-Power-On BOOLEAN, + &all-Resources-Calibrated BOOLEAN, + &local-Control BOOLEAN, + &selected-Program-Invocation Identifier} + +LogicalStatus ::= [0] IMPLICIT INTEGER { + state-changes-allowed(0), no-state-changes-allowed(1), + limited-services-permitted(2), support-services-allowed(3)}(0..3) + +PhysicalStatus ::= [1] IMPLICIT INTEGER { + operational(0), partially-operational(1), inoperable(2), + needs-commissioning(3)}(0..3) + +VMDState ::= INTEGER { + idle(0), loaded(1), ready(2), executing(3), motion-paused(4), + manualInterventionRequired(5)}(0..5) + +TRANSACTION ::= CLASS { + &invokeID INTEGER UNIQUE, + &Pre-excutionModifiers ModifierStep OPTIONAL, + ¤tModifier CHOICE {modifier ModifierStep, + none NULL}, + &confirmedService-Request ConfirmedServiceRequest, + &Post-executionModifiers ModifierStep OPTIONAL, + &cancelable BOOLEAN} + +ModifierStep ::= SEQUENCE {modifierID INTEGER, + modifier Modifier} + +Modifier ::= CHOICE { + eventModifier [0] IMPLICIT AttachToEventCondition, + semaphoreModifier [1] IMPLICIT AttachToSemaphore} + +APPLICATION-ASSOCIATION ::= CLASS { + &aaIdentifier INTEGER UNIQUE, + &client ApplicationReference, + &abstractSyntax ABSTRACT-SYNTAX, + &authenticationValue Authentication-value OPTIONAL, + -- This field represents a 'user password' + &Transactions TRANSACTION OPTIONAL, + &NamedVariables NAMED-VARIABLE OPTIONAL, + &NamedVariableLists NAMED-VARIABLE-LIST OPTIONAL, + &NamedTypes NAMED-TYPE OPTIONAL, + &EventConditions EVENT-CONDITION OPTIONAL, + &EventActions EVENT-ACTION OPTIONAL, + &EventEnrollments EVENT-ENROLLMENT OPTIONAL, + &EventConditionLists EVENT-CONDITION-LIST OPTIONAL, + &Journals JOURNAL OPTIONAL, + &services ServiceSupportOptions, + ¶meters ParameterSupportOptions, + &nest INTEGER, + &Ulsms ULSM OPTIONAL, + &extendedServices AdditionalSupportOptions, + &extendedParameters AdditionalCBBOptions} + +ServiceSupportOptions ::= BIT STRING { + status(0), getNameList(1), identify(2), rename(3), read(4), write(5), + getVariableAccessAttributes(6), + defineNamedVariable(7), + -- bit 8 is reserved for use of a service defined in annex E + defineScatteredAccess(8), + -- bit 9 is reserved for use of a service defined in annex E + getScatteredAccessAttributes(9), deleteVariableAccess(10), + defineNamedVariableList(11), getNamedVariableListAttributes(12), + deleteNamedVariableList(13), defineNamedType(14), getNamedTypeAttributes(15), + deleteNamedType(16), input(17), output(18), takeControl(19), + relinquishControl(20), defineSemaphore(21), deleteSemaphore(22), + reportSemaphoreStatus(23), reportPoolSemaphoreStatus(24), + reportSemaphoreEntryStatus(25), initiateDownloadSequence(26), + downloadSegment(27), terminateDownloadSequence(28), + initiateUploadSequence(29), uploadSegment(30), terminateUploadSequence(31), + requestDomainDownload(32), requestDomainUpload(33), loadDomainContent(34), + storeDomainContent(35), deleteDomain(36), getDomainAttributes(37), + createProgramInvocation(38), deleteProgramInvocation(39), start(40), + stop(41), resume(42), reset(43), kill(44), + getProgramInvocationAttributes(45), obtainFile(46), defineEventCondition(47), + deleteEventCondition(48), getEventConditionAttributes(49), + reportEventConditionStatus(50), alterEventConditionMonitoring(51), + triggerEvent(52), defineEventAction(53), deleteEventAction(54), + getEventActionAttributes(55), reportEventActionStatus(56), + defineEventEnrollment(57), deleteEventEnrollment(58), + alterEventEnrollment(59), reportEventEnrollmentStatus(60), + getEventEnrollmentAttributes(61), acknowledgeEventNotification(62), + getAlarmSummary(63), getAlarmEnrollmentSummary(64), readJournal(65), + writeJournal(66), initializeJournal(67), reportJournalStatus(68), + createJournal(69), deleteJournal(70), + getCapabilityList(71), + -- bit 72 is reserved for use of a service defined in annex D + fileOpen(72), + -- bit 73 is reserved for use of a service defined in annex D + fileRead(73), + -- bit 74 is reserved for use of a service defined in annex D + fileClose(74), + -- bit 75 is reserved for use of a service defined in annex D + fileRename(75), + -- bit 76 is reserved for use of a service defined in annex D + fileDelete(76), + -- bit 77 is reserved for use of a service defined in annex D + fileDirectory(77), unsolicitedStatus(78), informationReport(79), + eventNotification(80), attachToEventCondition(81), attachToSemaphore(82), + conclude(83), cancel(84), + getDataExchangeAttributes(85), + -- Shall not appear in minor version one + exchangeData(86), + -- Shall not appear in minor version one + defineAccessControlList(87), + -- Shall not appear in minor version one or two + getAccessControlListAttributes(88), + -- Shall not appear in minor version one or two + reportAccessControlledObjects(89), + -- Shall not appear in minor version one or two + deleteAccessControlList(90), + -- Shall not appear in minor version one or two + alterAccessControl(91), + -- Shall not appear in minor version one or two + reconfigureProgramInvocation(92)}(SIZE (93)) + +ParameterSupportOptions ::= BIT STRING { + str1(0), str2(1), vnam(2), valt(3), + vadr(4), + -- bit 5 is reserved for the services defined in Annex E. + vsca(5), tpy(6), vlis(7), + -- bit 8 is reserved + -- bit 9 is reserved + cei(10), aco(11), sem(12), csr(13), csnc(14), csplc(15), cspi(16), + char(17)}(SIZE (18)) + +AdditionalSupportOptions ::= BIT STRING { + vMDStop(0), vMDReset(1), select(2), alterProgramInvocationAttributes(3), + initiateUnitControlLoad(4), unitControlLoadSegment(5), unitControlUpload(6), + startUnitControl(7), stopUnitControl(8), createUnitControl(9), + addToUnitControl(10), removeFromUnitControl(11), + getUnitControlAttributes(12), loadUnitControlFromFile(13), + storeUnitControlToFile(14), deleteUnitControl(15), + defineEventConditionList(16), deleteEventConditionList(17), + addEventConditionListReference(18), removeEventConditionListReference(19), + getEventConditionListAttributes(20), reportEventConditionListStatus(21), + alterEventConditionListMonitoring(22)}(SIZE (23)) + +AdditionalCBBOptions ::= BIT STRING {des(0), dei(1), recl(2)}(SIZE (3)) + +ACCESS-CONTROL-LIST ::= CLASS { + &name Identifier, + &accessControl Identifier, + &readAccessCondition [0] AccessCondition OPTIONAL, + &storeAccessCondition [1] AccessCondition OPTIONAL, + &writeAccessCondition [2] AccessCondition OPTIONAL, + &loadAccessCondition [3] AccessCondition OPTIONAL, + &executeAccessCondition [4] AccessCondition OPTIONAL, + &deleteAccessCondition [5] AccessCondition OPTIONAL, + &editAccessCondition [6] AccessCondition OPTIONAL, + -- + -- The following fields are used to record lists of objects placed + -- under the control of this ACCESS-CONTROL-LIST object. + -- They will be referred to collectively as the Controlled Object Lists + -- + &AccessControlLists Identifier OPTIONAL, + &Domains Identifier OPTIONAL, + &ProgramInvocations Identifier OPTIONAL, + &UnitControls Identifier OPTIONAL, + &UnnamedVariables Address OPTIONAL, + &NamedVariables ObjectName OPTIONAL, + &NamedVariableLists ObjectName OPTIONAL, + &NamedTypes ObjectName OPTIONAL, + &DataExchanges ObjectName OPTIONAL, + &Semaphores Identifier OPTIONAL, + &OperatorStations Identifier OPTIONAL, + &EventConditions ObjectName OPTIONAL, + &EventActions ObjectName OPTIONAL, + &EventEnrollments ObjectName OPTIONAL, + &Journals ObjectName OPTIONAL, + &EventConditionLists ObjectName OPTIONAL} + +AccessCondition ::= CHOICE { + never [0] IMPLICIT NULL, + semaphore [1] Identifier, + user [2] CHOICE {association ApplicationReference, + none NULL}, + password [3] Authentication-value, + joint [4] IMPLICIT SEQUENCE OF AccessCondition, + alternate [5] IMPLICIT SEQUENCE OF AccessCondition} + +DOMAIN ::= CLASS { + &name Identifier, + -- shall be unique among the names of all Domains within the VMD + &Capabilities MMSString, + &state DomainState, + &aAssociation INTEGER OPTIONAL, + -- This field shall be present if and only if + -- the &state field has a value of + -- loading, complete, incomplete, d1, d2, d3 or d9 + &accessControl Identifier, + &sharable BOOLEAN, + &ProgramInvocations Identifier OPTIONAL, + &uploadsInProgress INTEGER, + -- The following items reflect the Domain content + -- All the items listed have Domain-specific names. + &NamedVariables NAMED-VARIABLE OPTIONAL, + &NamedVariableLists NAMED-VARIABLE-LIST OPTIONAL, + &NamedTypes NAMED-TYPE OPTIONAL, + &EventConditions EVENT-CONDITION OPTIONAL, + &EventActions EVENT-ACTION OPTIONAL, + &EventEnrollments EVENT-ENROLLMENT OPTIONAL, + &EventConditionLists EVENT-CONDITION-LIST OPTIONAL, + &Journals JOURNAL OPTIONAL} + +DomainState ::= INTEGER { + non-existent(0), loading(1), ready(2), in-use(3), complete(4), incomplete(5), + d1(7), d2(8), d3(9), d4(10), d5(11), d6(12), d7(13), d8(14), d9(15) +}(0..15) + +ULSM ::= CLASS { + &ulsmID INTEGER UNIQUE, + -- shall be unique among all ULSM's within this application association + &domain Identifier, + &ulsmState ULState} + +ULState ::= INTEGER { + non-existent(0), uploading(1), uploaded(2), u1(3), u2(4), u3(5), u4(6) +}(0..6) + +PROGRAM-INVOCATION ::= CLASS { + &name Identifier, -- shall be unique among all Program Invocations + &programInvocationState ProgramInvocationState, + &Domains Identifier, + &accessControl Identifier, + &reusable BOOLEAN, + &monitor BOOLEAN, + -- The following three fields shall all be present if the value of + -- monitor is true. + -- If present, the &name field of each object instance + -- shall have a value equal to the + -- &name field of this instance of the PROGRAM-INVOCATION. + &eventCondition Identifier OPTIONAL, + &eventAction Identifier OPTIONAL, + &eventEnrollment Identifier OPTIONAL, + &executionArgument MMSString, + &errorCode INTEGER, + &control Control-State, + -- The following field shall be present + -- if and only if the value of the &control field is controlled. + &controlling-Program-Invocation Identifier, + -- The following two fields shall be present + -- if and only if the value of the &control field is controlling. + &Controlled-Program-Invocations Identifier, + &program-Location MMSString OPTIONAL, + &running-Mode Running-Mode, + -- The following field shall be present + -- if and only if the value of the &running-Mode field is cycle-limited + &remaining-Cycle-Count INTEGER OPTIONAL, + -- The following field shall be present + -- if and only if the value of the &running-Mode field is step-limited + &remaining-Step-Count INTEGER OPTIONAL} + +ProgramInvocationState ::= INTEGER { + non-existent(0), unrunnable(1), idle(2), running(3), stopped(4), starting(5), + stopping(6), resuming(7), resetting(8)}(0..8) + +Control-State ::= INTEGER {normal(0), controlling(1), controlled(2)}(0..2) + +Running-Mode ::= INTEGER {free-run(0), cycle-limited(1), step-limited(2)}(0..2) + +UNIT-CONTROL ::= CLASS { + &name Identifier, + -- Shall be unique within the VMD + &accessControl Identifier, + &Domains Identifier, + &ProgramInvocations Identifier} + +UNNAMED-VARIABLE ::= CLASS { + &address Address, + &accessControl Identifier, + &typeDescription TypeDescription, + &value Data, + &accessMethod ENUMERATED {public} + -- The field '&accessMethod' shall have a value equal to public.--} + +Address ::= CHOICE { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] MMSString, + unconstrainedAddress [2] IMPLICIT OCTET STRING} + +NAMED-VARIABLE ::= CLASS { + &name ObjectName, -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &typeDescription TypeDescription, + &value Data, + &accessMethod ENUMERATED {public, anythingElse, ... + }, + &address Address OPTIONAL, + -- The presence of this field shall correspond to the + -- field &access Method having a value equal to public. + -- The absence of this field shall correspond to the + -- field &accessMethod having a value equal to anything except public. + -- The following field shall occur if and only if the sem CBB has been negotiated. + &meaning ObjectName OPTIONAL} + +NAMED-VARIABLE-LIST ::= CLASS { + &name ObjectName, -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &listOfVariables VARIABLE-LIST-ITEM} + +VARIABLE-LIST-ITEM ::= + CLASS { -- one and only one of the following two lines shall appear + &unnamedItem Address OPTIONAL, + &namedItem ObjectName OPTIONAL, + -- the following specification may be included + &alternateAccess AlternateAccess OPTIONAL} + +NAMED-TYPE ::= CLASS { + &name ObjectName, + -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &typeDescription TypeDescription, + -- The following field shall occur if and only if the sem CBB has been negotiated: + &meaning ObjectName OPTIONAL} + +-- type definition modified HK +TypeDescription ::= CHOICE { + array + [1] IMPLICIT SEQUENCE {packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification}, + structure + [2] IMPLICIT SEQUENCE {packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components + [1] IMPLICIT SEQUENCE OF + SEQUENCE {componentName + [0] IMPLICIT Identifier + OPTIONAL, + componentType + [1] TypeSpecification}}, + -- Simple Size Class + boolean [3] IMPLICIT NULL, -- BOOLEAN + bit-string [4] IMPLICIT Integer32, -- BIT-STRING + integer [5] IMPLICIT Unsigned8, -- INTEGER + unsigned [6] IMPLICIT Unsigned8, -- UNSIGNED + floating-point + [7] IMPLICIT SEQUENCE {format-width Unsigned8, -- number of bits of-- + -- floating point value + -- including sign, exponent, + -- and fraction + exponent-width Unsigned8 -- size of exponent in bits--}, + -- [8] is reserved + octet-string [9] IMPLICIT Integer32, -- OCTET-STRING + visible-string [10] IMPLICIT Integer32, -- VISIBLE-STRING + generalized-time [11] IMPLICIT NULL, -- GENERALIZED-TIME + binary-time [12] IMPLICIT BOOLEAN, -- BINARY-TIME + bcd [13] IMPLICIT Unsigned8, -- BCD + objId [15] IMPLICIT NULL, + ..., + mMSString [16] Integer32, -- MMS String + utc-time [17] IMPLICIT NULL -- from IEC61850 8.1 G.2 --} + +DATA-EXCHANGE ::= CLASS { + &name Identifier, -- shall be unique among all Data Exchange objects within the VMD + &inUse BOOLEAN, + &accessControl Identifier, + &request SEQUENCE OF TypeDescription, + &response SEQUENCE OF TypeDescription, + &linked BOOLEAN, + -- The following attribute shall appear if an only if + -- the value of &linked is true. + &programInvocation Identifier} + +SEMAPHORE ::= CLASS { + &name ObjectName, -- shall be unique among all semaphores within the VMD + &accessControl Identifier, + &class ENUMERATED {token, pool}, + -- If the value of &class is token, the following two fields shall appear + &numberOfTokens INTEGER OPTIONAL, + &numberOfOwnedTokens INTEGER OPTIONAL, + -- If the value of &class is pool, the following field shall appear + &NamedTokens NAMED-TOKEN OPTIONAL, + &Owners SEMAPHORE-ENTRY OPTIONAL, + &Requesters SEMAPHORE-ENTRY OPTIONAL, + &eventCondition ObjectName} + +NAMED-TOKEN ::= CLASS { + &name Identifier, + &state ENUMERATED {free, owned}} + +SEMAPHORE-ENTRY ::= CLASS { + &entryID OCTET STRING, -- this value shall be unique to the semaphore object + + -- that is the parent of this object + &class ENUMERATED {simple, modifier}, + &semaphore Identifier, + &requester ApplicationReference, + &aaIdentifier INTEGER, + &invokeID INTEGER, + -- The following field shall appear only if the semaphore is a pool semaphore + &named-token Identifier OPTIONAL, + &priority Priority, + &entryState ENUMERATED {queued, owner, hung}, + -- The following field shall appear only if the entryState has the value queued. + &remainingAcqDelay CHOICE {time Unsigned32, + forever NULL} OPTIONAL, + -- The following field shall appear + -- only if the entryState has the value owner or hung. + &remainingTimeOut CHOICE {time Unsigned32, + forever NULL} OPTIONAL, + &abortOnTimeOut BOOLEAN, + &relinquishIfLost BOOLEAN} + +Priority ::= INTEGER(0..127) + +normalPriority Priority ::= 64 + +OPERATOR-STATION ::= CLASS { + &name Identifier, + -- shall be unique within its range of specification (VMD) + &accessControl Identifier, + &stationType ENUMERATED {entry, display, entry-display}, + -- The following field shall appear if stationType is entry or entry-display + &inputBuffer MMSString OPTIONAL, + -- The following field shall appear if stationType is display or entry-display + &outputBuffers SEQUENCE OF MMSString OPTIONAL, + &state ENUMERATED {idle, display-prompt-data, waiting-for-input, + input-buffer-filled, output-buffers-filled}} + +EVENT-CONDITION ::= CLASS { + &name ObjectName, + -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &ecClass EC-Class, + &ecState EC-State, + &priority Priority, + &severity Severity, + &EventEnrollments ObjectName OPTIONAL, + -- The following fields shall be present + -- if and only if the value of &ecClass is monitored. + &enabled BOOLEAN OPTIONAL, + &alarmSummaryReports BOOLEAN OPTIONAL, + &monitoredVariable CHOICE {named [0] ObjectName, + unnamed [1] Address, + unspecified NULL} OPTIONAL, + &evaluationInterval INTEGER OPTIONAL, + &timeToActive EventTime OPTIONAL, + &timeToIdle EventTime OPTIONAL, + &displayEnhancement CHOICE {text MMSString, + number INTEGER, + none NULL} OPTIONAL, + &group-Priority-Override CHOICE {priority Priority, + undefined NULL} OPTIONAL, + &ReferencingEventConditionLists Identifier OPTIONAL + -- EVENT-CONDITION-LIST.&name --} + +EC-Class ::= INTEGER {network-triggered(0), monitored(1)}(0..1) + +EC-State ::= INTEGER {disabled(0), idle(1), active(2)}(0..2) + +Severity ::= INTEGER(0..127) + +normalSeverity Severity ::= 64 + +EventTime ::= CHOICE { + timeOfDay [0] IMPLICIT TimeOfDay, + timeSequenceIdentifier [1] IMPLICIT Unsigned32, + undefined [2] IMPLICIT NULL} + +EVENT-ACTION ::= CLASS { + &name ObjectName, + -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &confirmedServiceRequest ConfirmedServiceRequest, + &Modifiers Modifier OPTIONAL, + &EventEnrollments Identifier OPTIONAL} + +EVENT-ENROLLMENT ::= CLASS { + &name ObjectName, -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &eeClass EE-Class, + &eventCondition Identifier, + &ecTransitions Transitions, + &aAssociation INTEGER, + -- The following two fields are present if and only if the + -- value of &eeClass is modifier. + &invokeID INTEGER OPTIONAL, + &remainingDelay CHOICE {time INTEGER, + forever NULL} OPTIONAL, + -- All the following fields are present if and only if the + -- value of &eeClass is notification. + ¬ificationLost BOOLEAN OPTIONAL, + &eventAction ObjectName OPTIONAL, + &duration EE-Duration OPTIONAL, + &clientApplication ApplicationReference OPTIONAL, + -- The following four fields are present if and only if the + -- value of &eeClass is notification and the value of &ecState + -- of the Event Condition object is monitored + &aaRule AlarmAckRule OPTIONAL, + &timeActiveAck EventTime OPTIONAL, + &timeIdleAck EventTime OPTIONAL, + &ackState ENUMERATED {acked, noAckA, noAckI} OPTIONAL, + &lastState EC-State OPTIONAL, + &displayEnhancement CHOICE {text MMSString, + number INTEGER, + none NULL} OPTIONAL} + +EE-Class ::= INTEGER {modifier(0), notification(1)}(0..1) + +Transitions ::= BIT STRING { + idle-to-disabled(0), active-to-disabled(1), disabled-to-idle(2), + active-to-idle(3), disabled-to-active(4), idle-to-active(5), + any-to-deleted(6)}(SIZE (7)) + +EE-Duration ::= INTEGER {current(0), permanent(1)}(0..1) + +AlarmAckRule ::= INTEGER {none(0), simple(1), ack-active(2), ack-all(3)}(0..3) + +EVENT-CONDITION-LIST ::= CLASS { + &name ObjectName, + -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &EventConditions ObjectName, + &EventConditionLists ObjectName OPTIONAL, + &ReferencingEventConditionLists ObjectName OPTIONAL} + +JOURNAL ::= CLASS { + &name ObjectName, -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &Entries JOURNAL-ENTRY OPTIONAL} + +JOURNAL-ENTRY ::= CLASS { + &journal ObjectName, + &entry OCTET STRING, + &clientApplication ApplicationReference, + &timeStamp TimeOfDay, + &orderOfReceipt INTEGER UNIQUE, + &informationType ENUMERATED {annotation, event-data, data}, + -- The following attribute shall appear if and only if the + -- value of &informationType is annotation. + &textComment MMS255String OPTIONAL, + --The following attribute shall appear if and only if the + -- value of &informationType is event-data. + &eventTransitionRecord SEQUENCE {name [0] ObjectName, + currentState [1] IMPLICIT EC-State} OPTIONAL, + -- The following attribute shall appear if and only if the + -- value of &informationType is data or event-data. + &journalVariables SEQUENCE OF Journal-Variable OPTIONAL} + +Journal-Variable ::= SEQUENCE { + variableTag MMS255String, + valueSpecification Data} + +mMSNamedVariable OBJECT IDENTIFIER ::= + {iso standard 9506 part(1) symbols-version1(5) named-variable(1)} + +mMSAccessControlList OBJECT IDENTIFIER ::= + {iso standard 9506 part(1) symbols-version1(5) access-control-list(2)} + +mMSEventCondition OBJECT IDENTIFIER ::= + {iso standard 9506 part(1) symbols-version1(5) event-condition(3)} + +m-powerProblem NAMED-VARIABLE ::= + {&name vmd-specific:"M_powerProblem", + &accessControl "M_ReadOnly", + &typeDescription boolean:NULL, + &accessMethod anythingElse, + &value boolean:FALSE} + +m-ELT NAMED-VARIABLE ::= + {&name vmd-specific:"M_ELT", + &accessControl "M_ReadOnly", + &typeDescription integer:32, + &accessMethod anythingElse, + &value integer:0} + +m-DAYTIME NAMED-VARIABLE ::= + {&name vmd-specific:"M_DAYTIME", + &accessControl "M_NonDeletable", + &typeDescription generalized-time:NULL, + &accessMethod anythingElse, + &value generalized-time:"299107311200"} + +m-Deletable ACCESS-CONTROL-LIST ::= + {&name "M_Deletable", + &accessControl "M_Never"} + +m-NonDeletable ACCESS-CONTROL-LIST ::= + {&name "M_NonDeletable", + &accessControl "M_Never", + &deleteAccessCondition never:NULL, + &NamedVariables {vmd-specific:"M_DAYTIME"}} + +m-ReadOnly ACCESS-CONTROL-LIST ::= + {&name "M_ReadOnly", + &accessControl "M_Never", + &writeAccessCondition never:NULL, + &deleteAccessCondition never:NULL, + &editAccessCondition never:NULL, + &NamedVariables + {vmd-specific:"M_ELT" | vmd-specific:"M_DAYTIME"}} + +m-Never ACCESS-CONTROL-LIST ::= + {&name "M_Never", + &accessControl "M_Never", + &deleteAccessCondition never:NULL, + &editAccessCondition never:NULL, + &AccessControlLists + {"M_Deletable" | "M_NonDeletable" | "M_Never" | "M_ReadOnly"}, + &EventConditions {vmd-specific:"M_Violation"}} + +m-Violation EVENT-CONDITION ::= + {&name vmd-specific:"M_Violation", + &accessControl "M_Never", + &ecClass network-triggered, + &ecState active, + &priority normalPriority, + &severity normalSeverity} + +END + + + +ISO-9506-MMS-1 {iso standard 9506 part(2) mms-abstract-syntax-version1(1)} +DEFINITIONS ::= +BEGIN + +EXPORTS + AlternateAccess, AttachToEventCondition, AttachToSemaphore, + ConfirmedServiceRequest, Data, EE-State, FileName, Identifier, Integer8, + Integer32, MMSString, MMS255String, UtcTime, ObjectName, TimeOfDay, + TypeSpecification, Unsigned32, Unsigned8, VariableSpecification; + +IMPORTS + ApplicationReference, Authentication-value + FROM MMS-Environment-1 {iso standard 9506 part(2) + mms-environment-version1(4)} + ObtainFile-Request, ObtainFile-Response, ObtainFile-Error, FileOpen-Request, + FileOpen-Response, FileRead-Request, FileRead-Response, FileClose-Request, + FileClose-Response, FileRename-Request, FileRename-Response, + FileRename-Error, FileDelete-Request, FileDelete-Response, + FileDirectory-Request, FileDirectory-Response, + DefineScatteredAccess-Request, DefineScatteredAccess-Response, + ScatteredAccessDescription, GetScatteredAccessAttributes-Request, + GetScatteredAccessAttributes-Response + FROM ISO-9506-MMS-1A {iso standard 9506 part(2) mms-annex-version1(3)} + AccessCondition, AdditionalCBBOptions, AdditionalSupportOptions, Address, + AlarmAckRule, Control-State, DomainState, EC-State, EC-Class, EE-Duration, + EE-Class, EventTime, Journal-Variable, LogicalStatus, Modifier, + normalPriority, normalSeverity, ParameterSupportOptions, PhysicalStatus, + Priority, ProgramInvocationState, Running-Mode, ServiceSupportOptions, + Severity, Transitions, TypeDescription, ULState, VMDState + FROM MMS-Object-Module-1 {iso standard 9506 part(1) + mms-object-model-version1(2)}; + +MMSpdu ::= CHOICE { + confirmed-RequestPDU [0] IMPLICIT Confirmed-RequestPDU, + confirmed-ResponsePDU [1] IMPLICIT Confirmed-ResponsePDU, + confirmed-ErrorPDU [2] IMPLICIT Confirmed-ErrorPDU, + unconfirmed-PDU [3] IMPLICIT Unconfirmed-PDU, + rejectPDU [4] IMPLICIT RejectPDU, + cancel-RequestPDU [5] IMPLICIT Cancel-RequestPDU, + cancel-ResponsePDU [6] IMPLICIT Cancel-ResponsePDU, + cancel-ErrorPDU [7] IMPLICIT Cancel-ErrorPDU, + initiate-RequestPDU [8] IMPLICIT Initiate-RequestPDU, + initiate-ResponsePDU [9] IMPLICIT Initiate-ResponsePDU, + initiate-ErrorPDU [10] IMPLICIT Initiate-ErrorPDU, + conclude-RequestPDU [11] IMPLICIT Conclude-RequestPDU, + conclude-ResponsePDU [12] IMPLICIT Conclude-ResponsePDU, + conclude-ErrorPDU [13] IMPLICIT Conclude-ErrorPDU} + +Confirmed-RequestPDU ::= SEQUENCE { + invokeID Unsigned32, + listOfModifiers SEQUENCE OF Modifier OPTIONAL, + service ConfirmedServiceRequest, + ..., + service-ext [79] Request-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL--} + +ConfirmedServiceRequest ::= CHOICE { + status [0] IMPLICIT Status-Request, + getNameList [1] IMPLICIT GetNameList-Request, + identify [2] IMPLICIT Identify-Request, + rename [3] IMPLICIT Rename-Request, + read [4] IMPLICIT Read-Request, + write [5] IMPLICIT Write-Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes-Request, + defineNamedVariable [7] IMPLICIT DefineNamedVariable-Request, + -- [8] is reserved for a service defined in Annex E + defineScatteredAcce [8] IMPLICIT DefineScatteredAccess-Request, + -- [9] is reserved for a service defined in Annex E + getScatteredAccessAttributes [9] GetScatteredAccessAttributes-Request, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess-Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Request, + getNamedVariableListAttributes [12] GetNamedVariableListAttributes-Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Request, + defineNamedType [14] IMPLICIT DefineNamedType-Request, + getNamedTypeAttributes [15] GetNamedTypeAttributes-Request, + deleteNamedType [16] IMPLICIT DeleteNamedType-Request, + input [17] IMPLICIT Input-Request, + output [18] IMPLICIT Output-Request, + takeControl [19] IMPLICIT TakeControl-Request, + relinquishControl [20] IMPLICIT RelinquishControl-Request, + defineSemaphore [21] IMPLICIT DefineSemaphore-Request, + deleteSemaphore [22] DeleteSemaphore-Request, + reportSemaphoreStatus [23] ReportSemaphoreStatus-Request, + reportPoolSemaphoreStatus + [24] IMPLICIT ReportPoolSemaphoreStatus-Request, + reportSemaphoreEntryStatus + [25] IMPLICIT ReportSemaphoreEntryStatus-Request, + initiateDownloadSequence + [26] IMPLICIT InitiateDownloadSequence-Request, + downloadSegment [27] IMPLICIT DownloadSegment-Request, + terminateDownloadSequence + [28] IMPLICIT TerminateDownloadSequence-Request, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence-Request, + uploadSegment [30] IMPLICIT UploadSegment-Request, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence-Request, + requestDomainDownload [32] IMPLICIT RequestDomainDownload-Request, + requestDomainUpload [33] IMPLICIT RequestDomainUpload-Request, + loadDomainContent [34] IMPLICIT LoadDomainContent-Request, + storeDomainContent [35] IMPLICIT StoreDomainContent-Request, + deleteDomain [36] IMPLICIT DeleteDomain-Request, + getDomainAttributes [37] IMPLICIT GetDomainAttributes-Request, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation-Request, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation-Request, + start [40] IMPLICIT Start-Request, + stop [41] IMPLICIT Stop-Request, + resume [42] IMPLICIT Resume-Request, + reset [43] IMPLICIT Reset-Request, + kill [44] IMPLICIT Kill-Request, + getProgramInvocationAttributes + [45] IMPLICIT GetProgramInvocationAttributes-Request, + obtainFile [46] IMPLICIT ObtainFile-Request, + defineEventCondition [47] IMPLICIT DefineEventCondition-Request, + deleteEventCondition [48] DeleteEventCondition-Request, + getEventConditionAttributes [49] GetEventConditionAttributes-Request, + reportEventConditionStatus [50] ReportEventConditionStatus-Request, + alterEventConditionMonitoring + [51] IMPLICIT AlterEventConditionMonitoring-Request, + triggerEvent [52] IMPLICIT TriggerEvent-Request, + defineEventAction [53] IMPLICIT DefineEventAction-Request, + deleteEventAction [54] DeleteEventAction-Request, + getEventActionAttributes [55] GetEventActionAttributes-Request, + reportEventActionStatus [56] ReportEventActionStatus-Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment-Request, + deleteEventEnrollment [58] DeleteEventEnrollment-Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment-Request, + reportEventEnrollmentStatus [60] ReportEventEnrollmentStatus-Request, + getEventEnrollmentAttributes + [61] IMPLICIT GetEventEnrollmentAttributes-Request, + acknowledgeEventNotification + [62] IMPLICIT AcknowledgeEventNotification-Request, + getAlarmSummary [63] IMPLICIT GetAlarmSummary-Request, + getAlarmEnrollmentSummary + [64] IMPLICIT GetAlarmEnrollmentSummary-Request, + readJournal [65] IMPLICIT ReadJournal-Request, + writeJournal [66] IMPLICIT WriteJournal-Request, + initializeJournal [67] IMPLICIT InitializeJournal-Request, + reportJournalStatus [68] ReportJournalStatus-Request, + createJournal [69] IMPLICIT CreateJournal-Request, + deleteJournal [70] IMPLICIT DeleteJournal-Request, + getCapabilityList [71] IMPLICIT GetCapabilityList-Request, + -- choices [72] through [77] are reserved for use by services + -- defined in annex D + fileOpen [72] IMPLICIT FileOpen-Request, + fileRead [73] IMPLICIT FileRead-Request, + fileClose [74] IMPLICIT FileClose-Request, + fileRename [75] IMPLICIT FileRename-Request, + fileDelete [76] IMPLICIT FileDelete-Request, + fileDirectory [77] IMPLICIT FileDirectory-Request, + ..., + additionalService [78] AdditionalService-Request, + -- choice [79] is reserved + getDataExchangeAttributes [80] GetDataExchangeAttributes-Request, + -- Shall not appear in minor version 1 + exchangeData [81] IMPLICIT ExchangeData-Request, + -- Shall not appear in minor version 1 + defineAccessControlList [82] IMPLICIT DefineAccessControlList-Request, + -- Shall not appear in minor version 1 or 2 + getAccessControlListAttributes [83] GetAccessControlListAttributes-Request, + -- Shall not appear in minor version 1 or 2 + reportAccessControlledObjects + [84] IMPLICIT ReportAccessControlledObjects-Request, + -- Shall not appear in minor version 1 or 2 + deleteAccessControlList [85] IMPLICIT DeleteAccessControlList-Request, + -- Shall not appear in minor version 1 or 2 + changeAccessControl [86] IMPLICIT ChangeAccessControl-Request, + -- Shall not appear in minor version 1 or 2 + ...} + +AdditionalService-Request ::= CHOICE { + vMDStop [0] IMPLICIT VMDStop-Request, + vMDReset [1] IMPLICIT VMDReset-Request, + select [2] IMPLICIT Select-Request, + alterPI [3] IMPLICIT AlterProgramInvocationAttributes-Request, + initiateUCLoad [4] IMPLICIT InitiateUnitControlLoad-Request, + uCLoad [5] IMPLICIT UnitControlLoadSegment-Request, + uCUpload [6] IMPLICIT UnitControlUpload-Request, + startUC [7] IMPLICIT StartUnitControl-Request, + stopUC [8] IMPLICIT StopUnitControl-Request, + createUC [9] IMPLICIT CreateUnitControl-Request, + addToUC [10] IMPLICIT AddToUnitControl-Request, + removeFromUC [11] IMPLICIT RemoveFromUnitControl-Request, + getUCAttributes [12] IMPLICIT GetUnitControlAttributes-Request, + loadUCFromFile [13] IMPLICIT LoadUnitControlFromFile-Request, + storeUCToFile [14] IMPLICIT StoreUnitControlToFile-Request, + deleteUC [15] IMPLICIT DeleteUnitControl-Request, + defineECL [16] DefineEventConditionList-Request, + deleteECL [17] DeleteEventConditionList-Request, + addECLReference [18] IMPLICIT AddEventConditionListReference-Request, + removeECLReference [19] IMPLICIT RemoveEventConditionListReference-Request, + getECLAttributes [20] GetEventConditionListAttributes-Request, + reportECLStatus [21] IMPLICIT ReportEventConditionListStatus-Request, + alterECLMonitoring [22] IMPLICIT AlterEventConditionListMonitoring-Request} + +Request-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceRequest does not match any of the tags below + otherRequests NULL, + createProgramInvocation + [38] IMPLICIT CS-CreateProgramInvocation-Request, + start [40] IMPLICIT CS-Start-Request, + resume [42] IMPLICIT CS-Resume-Request, + defineEventCondition [47] IMPLICIT CS-DefineEventCondition-Request, + alterEventConditionMonitoring + [51] IMPLICIT CS-AlterEventConditionMonitoring-Request, + defineEventEnrollment [57] IMPLICIT CS-DefineEventEnrollment-Request, + alterEventEnrollment [59] IMPLICIT CS-AlterEventEnrollment-Request} + +Unconfirmed-PDU ::= SEQUENCE { + service UnconfirmedService, + ..., + service-ext [79] Unconfirmed-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL--} + +UnconfirmedService ::= CHOICE { + informationReport [0] IMPLICIT InformationReport, + unsolicitedStatus [1] IMPLICIT UnsolicitedStatus, + eventNotification [2] IMPLICIT EventNotification} + +Unconfirmed-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- UnconfirmedService does not match any of the tags below + otherRequests NULL, + eventNotification [2] IMPLICIT CS-EventNotification} + +Confirmed-ResponsePDU ::= SEQUENCE { + invokeID Unsigned32, + service ConfirmedServiceResponse, + ..., + service-ext [79] Response-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL--} + +ConfirmedServiceResponse ::= CHOICE { + status [0] IMPLICIT Status-Response, + getNameList [1] IMPLICIT GetNameList-Response, + identify [2] IMPLICIT Identify-Response, + rename [3] IMPLICIT Rename-Response, + read [4] IMPLICIT Read-Response, + getVariableAccessAttributes + [6] IMPLICIT GetVariableAccessAttributes-Response, + defineNamedVariable [7] IMPLICIT DefineNamedVariable-Response, + -- choice [8] is reserved for a service defined in Annex E + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess-Response, + -- choice [9] is reserved for a service defined in Annex E + getScatteredAccessAttributes + [9] IMPLICIT GetScatteredAccessAttributes-Response, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess-Response, + defineNamedVariableList + [11] IMPLICIT DefineNamedVariableList-Response, + getNamedVariableListAttributes + [12] IMPLICIT GetNamedVariableListAttributes-Response, + deleteNamedVariableList + [13] IMPLICIT DeleteNamedVariableList-Response, + defineNamedType [14] IMPLICIT DefineNamedType-Response, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes-Response, + deleteNamedType [16] IMPLICIT DeleteNamedType-Response, + input [17] IMPLICIT Input-Response, + output [18] IMPLICIT Output-Response, + takeControl [19] TakeControl-Response, + relinquishControl [20] IMPLICIT RelinquishControl-Response, + defineSemaphore [21] IMPLICIT DefineSemaphore-Response, + deleteSemaphore [22] IMPLICIT DeleteSemaphore-Response, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus-Response, + reportPoolSemaphoreStatus + [24] IMPLICIT ReportPoolSemaphoreStatus-Response, + reportSemaphoreEntryStatus + [25] IMPLICIT ReportSemaphoreEntryStatus-Response, + initiateDownloadSequence + [26] IMPLICIT InitiateDownloadSequence-Response, + downloadSegment [27] IMPLICIT DownloadSegment-Response, + terminateDownloadSequence + [28] IMPLICIT TerminateDownloadSequence-Response, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence-Response, + uploadSegment [30] IMPLICIT UploadSegment-Response, + terminateUploadSequence + [31] IMPLICIT TerminateUploadSequence-Response, + requestDomainDownload [32] IMPLICIT RequestDomainDownload-Response, + requestDomainUpload [33] IMPLICIT RequestDomainUpload-Response, + loadDomainContent [34] IMPLICIT LoadDomainContent-Response, + storeDomainContent [35] IMPLICIT StoreDomainContent-Response, + deleteDomain [36] IMPLICIT DeleteDomain-Response, + getDomainAttributes [37] IMPLICIT GetDomainAttributes-Response, + createProgramInvocation + [38] IMPLICIT CreateProgramInvocation-Response, + deleteProgramInvocation + [39] IMPLICIT DeleteProgramInvocation-Response, + start [40] IMPLICIT Start-Response, + stop [41] IMPLICIT Stop-Response, + resume [42] IMPLICIT Resume-Response, + reset [43] IMPLICIT Reset-Response, + kill [44] IMPLICIT Kill-Response, + getProgramInvocationAttributes + [45] IMPLICIT GetProgramInvocationAttributes-Response, + obtainFile [46] IMPLICIT ObtainFile-Response, + defineEventCondition [47] IMPLICIT DefineEventCondition-Response, + deleteEventCondition [48] IMPLICIT DeleteEventCondition-Response, + getEventConditionAttributes + [49] IMPLICIT GetEventConditionAttributes-Response, + reportEventConditionStatus + [50] IMPLICIT ReportEventConditionStatus-Response, + alterEventConditionMonitoring + [51] IMPLICIT AlterEventConditionMonitoring-Response, + triggerEvent [52] IMPLICIT TriggerEvent-Response, + defineEventAction [53] IMPLICIT DefineEventAction-Response, + deleteEventAction [54] IMPLICIT DeleteEventAction-Response, + getEventActionAttributes + [55] IMPLICIT GetEventActionAttributes-Response, + reportEventActionStatus + [56] IMPLICIT ReportEventActionStatus-Response, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment-Response, + deleteEventEnrollment [58] IMPLICIT DeleteEventEnrollment-Response, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment-Response, + reportEventEnrollmentStatus + [60] IMPLICIT ReportEventEnrollmentStatus-Response, + getEventEnrollmentAttributes + [61] IMPLICIT GetEventEnrollmentAttributes-Response, + acknowledgeEventNotification + [62] IMPLICIT AcknowledgeEventNotification-Response, + getAlarmSummary [63] IMPLICIT GetAlarmSummary-Response, + getAlarmEnrollmentSummary + [64] IMPLICIT GetAlarmEnrollmentSummary-Response, + readJournal [65] IMPLICIT ReadJournal-Response, + writeJournal [66] IMPLICIT WriteJournal-Response, + initializeJournal [67] IMPLICIT InitializeJournal-Response, + reportJournalStatus [68] IMPLICIT ReportJournalStatus-Response, + createJournal [69] IMPLICIT CreateJournal-Response, + deleteJournal [70] IMPLICIT DeleteJournal-Response, + getCapabilityList [71] IMPLICIT GetCapabilityList-Response, + -- choices [72] through [77] are reserved for use by services + -- defined in annex D + fileOpen [72] IMPLICIT FileOpen-Response, + fileRead [73] IMPLICIT FileRead-Response, + fileClose [74] IMPLICIT FileClose-Response, + fileRename [75] IMPLICIT FileRename-Response, + fileDelete [76] IMPLICIT FileDelete-Response, + fileDirectory [77] IMPLICIT FileDirectory-Response, + ..., + additionalService [78] AdditionalService-Response, + -- choice [79] is reserved, + getDataExchangeAttributes [80] GetDataExchangeAttributes-Response, + -- Shall not appear in minor version 1, + exchangeData [81] IMPLICIT ExchangeData-Response, + -- Shall not appear in minor version 1, + defineAccessControlList + [82] IMPLICIT DefineAccessControlList-Response, + -- Shall not appear in minor version 1 or 2, + getAccessControlListAttributes + [83] IMPLICIT GetAccessControlListAttributes-Response, + -- Shall not appear in minor version 1 or 2, + reportAccessControlledObjects + [84] IMPLICIT ReportAccessControlledObjects-Response, + -- Shall not appear in minor version 1 or 2, + deleteAccessControlList + [85] IMPLICIT DeleteAccessControlList-Response, + -- Shall not appear in minor version 1 or 2, + changeAccessControl [86] IMPLICIT ChangeAccessControl-Response-- Shall not appear in minor version 1 or 2 + , + ...} + +AdditionalService-Response ::= CHOICE { + vMDStop [0] IMPLICIT VMDStop-Response, + vMDReset [1] IMPLICIT VMDReset-Response, + select [2] IMPLICIT Select-Response, + alterPI [3] IMPLICIT AlterProgramInvocationAttributes-Response, + initiateUCLoad [4] IMPLICIT InitiateUnitControlLoad-Response, + uCLoad [5] IMPLICIT UnitControlLoadSegment-Response, + uCUpload [6] IMPLICIT UnitControlUpload-Response, + startUC [7] IMPLICIT StartUnitControl-Response, + stopUC [8] IMPLICIT StopUnitControl-Response, + createUC [9] IMPLICIT CreateUnitControl-Response, + addToUC [10] IMPLICIT AddToUnitControl-Response, + removeFromUC [11] IMPLICIT RemoveFromUnitControl-Response, + getUCAttributes [12] IMPLICIT GetUnitControlAttributes-Response, + loadUCFromFile [13] IMPLICIT LoadUnitControlFromFile-Response, + storeUCToFile [14] IMPLICIT StoreUnitControlToFile-Response, + deleteUC [15] IMPLICIT DeleteUnitControl-Response, + defineECL [16] IMPLICIT DefineEventConditionList-Response, + deleteECL [17] IMPLICIT DeleteEventConditionList-Response, + addECLReference [18] IMPLICIT AddEventConditionListReference-Response, + removeECLReference [19] IMPLICIT RemoveEventConditionListReference-Response, + getECLAttributes [20] IMPLICIT GetEventConditionListAttributes-Response, + reportECLStatus [21] IMPLICIT ReportEventConditionListStatus-Response, + alterECLMonitoring [22] IMPLICIT AlterEventConditionListMonitoring-Response} + +Response-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceResponse does not match any of the tags below + otherRequests NULL, + status [0] CS-Status-Response, + getProgramInvocationAttributes + [45] IMPLICIT CS-GetProgramInvocationAttributes-Response, + getEventConditionAttributes + [49] IMPLICIT CS-GetEventConditionAttributes-Response} + +Confirmed-ErrorPDU ::= SEQUENCE { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError} + +ServiceError ::= SEQUENCE { + errorClass + [0] CHOICE {vmd-state + [0] IMPLICIT INTEGER {other(0), vmd-state-conflict(1), + vmd-operational-problem(2), + domain-transfer-problem(3), + state-machine-id-invalid(4)}(0..4), + application-reference + [1] IMPLICIT INTEGER {other(0), application-unreachable(1), + connection-lost(2), + application-reference-invalid(3), + context-unsupported(4)}(0..4), + definition + [2] IMPLICIT INTEGER {other(0), object-undefined(1), + invalid-address(2), + type-unsupported(3), + type-inconsistent(4), + object-exists(5), + object-attribute-inconsistent(6)} + (0..6), + resource + [3] IMPLICIT INTEGER {other(0), memory-unavailable(1), + processor-resource-unavailable(2), + mass-storage-unavailable(3), + capability-unavailable(4), + capability-unknown(5)}(0..5), + service + [4] IMPLICIT INTEGER {other(0), + primitives-out-of-sequence(1), + object-state-conflict(2), + -- Value 3 reserved for further definition + continuation-invalid(4), + object-constraint-conflict(5)}(0..5), + service-preempt + [5] IMPLICIT INTEGER {other(0), timeout(1), deadlock(2), + cancel(3)}(0..3), + time-resolution + [6] IMPLICIT INTEGER {other(0), + unsupportable-time-resolution(1)} + (0..1), + access + [7] IMPLICIT INTEGER {other(0), + object-access-unsupported(1), + object-non-existent(2), + object-access-denied(3), + object-invalidated(4)}(0..4), + initiate + [8] IMPLICIT INTEGER {other(0), + -- Values 1 and 2 are reserved for further definition + max-services-outstanding-calling-insufficient(3), + max-services-outstanding-called-insufficient(4), + service-CBB-insufficient(5), + parameter-CBB-insufficient(6), + nesting-level-insufficient(7)}(0..7), + conclude + [9] IMPLICIT INTEGER {other(0), + further-communication-required(1)} + (0..1), + cancel + [10] IMPLICIT INTEGER {other(0), invoke-id-unknown(1), + cancel-not-possible(2)}(0..2), + file + [11] IMPLICIT INTEGER {other(0), filename-ambiguous(1), + file-busy(2), + filename-syntax-error(3), + content-type-invalid(4), + position-invalid(5), + file-access-denied(6), + file-non-existent(7), + duplicate-filename(8), + insufficient-space-in-filestore(9)} + (0..9), + others [12] IMPLICIT INTEGER}, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInfo + [3] CHOICE {obtainFile [0] IMPLICIT ObtainFile-Error, + start [1] IMPLICIT Start-Error, + stop [2] IMPLICIT Stop-Error, + resume [3] IMPLICIT Resume-Error, + reset [4] IMPLICIT Reset-Error, + deleteVariableAccess + [5] IMPLICIT DeleteVariableAccess-Error, + deleteNamedVariableList + [6] IMPLICIT DeleteNamedVariableList-Error, + deleteNamedType + [7] IMPLICIT DeleteNamedType-Error, + defineEventEnrollment-Error [8] DefineEventEnrollment-Error, + -- [9] Reserved for use by annex D + fileRename [9] IMPLICIT FileRename-Error, + additionalService [10] AdditionalService-Error, + changeAccessControl + [11] IMPLICIT ChangeAccessControl-Error} OPTIONAL} + +AdditionalService-Error ::= CHOICE { + defineEcl [0] DefineEventConditionList-Error, + addECLReference [1] AddEventConditionListReference-Error, + removeECLReference [2] RemoveEventConditionListReference-Error, + initiateUC [3] InitiateUnitControl-Error, + startUC [4] IMPLICIT StartUnitControl-Error, + stopUC [5] IMPLICIT StopUnitControl-Error, + deleteUC [6] DeleteUnitControl-Error, + loadUCFromFile [7] LoadUnitControlFromFile-Error} + +TimeOfDay ::= OCTET STRING(SIZE (4 | 6)) + +-- maxIdentifier INTEGER ::= 32 +maxIdentifier INTEGER ::= + 64 -- modified by IEC61850 8.1 G3 + +Identifier ::= UTF8String(SIZE (1..maxIdentifier)) + +Integer8 ::= INTEGER(-128..127) -- range -128 <= i <= 127 + + +Integer16 ::= INTEGER(-32768..32767) -- range -32,768 <= i <= 32,767 + + +Integer32 ::= + INTEGER(-2147483648..2147483647) -- range -2**31 <= i <= 2**31 - 1 + + +Unsigned8 ::= INTEGER(0..127) -- range 0 <= i <= 127 + + +Unsigned16 ::= INTEGER(0..32767) -- range 0 <= i <= 32767 + + +Unsigned32 ::= INTEGER(0..2147483647) -- range 0 <= i <= 2**31 - 1 + + +ObjectName ::= CHOICE { + vmd-specific [0] IMPLICIT Identifier, + domain-specific + [1] IMPLICIT SEQUENCE {domainID Identifier, + itemID Identifier}, + aa-specific [2] IMPLICIT Identifier} + +ObjectClass ::= CHOICE { + basicObjectClass + [0] IMPLICIT INTEGER {namedVariable(0), + -- value 1 is reserved for definition in Annex E + scatteredAccess(1), namedVariableList(2), + namedType(3), semaphore(4), eventCondition(5), + eventAction(6), eventEnrollment(7), journal(8), + domain(9), programInvocation(10), + operatorStation(11), + dataExchange(12), + -- Shall not appear in minor version 1 + accessControlList(13) + -- Shall not appear in minor version 1 or 2--}(0..13), + ..., + csObjectClass + [1] IMPLICIT INTEGER {eventConditionList(0), unitControl(1)}(0..1)} + +MMSString ::= UTF8String + +MMS255String ::= UTF8String(SIZE (1..255)) + +UtcTime ::= OCTET STRING(SIZE (8)) + +FileName ::= SEQUENCE OF GraphicString + +Initiate-RequestPDU ::= SEQUENCE { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initRequestDetail + [4] IMPLICIT SEQUENCE {proposedVersionNumber + [0] IMPLICIT Integer16, + proposedParameterCBB + [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling + [2] IMPLICIT ServiceSupportOptions, + ..., + additionalSupportedCalling + [3] IMPLICIT AdditionalSupportOptions, + additionalCbbSupportedCalling + [4] IMPLICIT AdditionalCBBOptions, + privilegeClassIdentityCalling + [5] IMPLICIT VisibleString}} + +Initiate-ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initResponseDetail + [4] IMPLICIT SEQUENCE {negotiatedVersionNumber + [0] IMPLICIT Integer16, + negotiatedParameterCBB + [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled + [2] IMPLICIT ServiceSupportOptions, + ..., + additionalSupportedCalled + [3] IMPLICIT AdditionalSupportOptions, + additionalCbbSupportedCalled + [4] IMPLICIT AdditionalCBBOptions, + privilegeClassIdentityCalled + [5] IMPLICIT VisibleString}} + +Initiate-ErrorPDU ::= ServiceError + +Conclude-RequestPDU ::= NULL + +Conclude-ResponsePDU ::= NULL + +Conclude-ErrorPDU ::= ServiceError + +Cancel-RequestPDU ::= Unsigned32 -- originalInvokeID + +Cancel-ResponsePDU ::= Unsigned32 -- originalInvokeID + +Cancel-ErrorPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError} + +RejectPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason + CHOICE {confirmed-requestPDU + [1] IMPLICIT INTEGER {other(0), unrecognized-service(1), + unrecognized-modifier(2), + invalid-invokeID(3), invalid-argument(4), + invalid-modifier(5), + max-serv-outstanding-exceeded(6), + -- Value 7 reserved for further definition + max-recursion-exceeded(8), + value-out-of-range(9)}(0..9), + confirmed-responsePDU + [2] IMPLICIT INTEGER {other(0), unrecognized-service(1), + invalid-invokeID(2), + invalid-result(3), + -- Value 4 reserved for further definition + max-recursion-exceeded(5), + value-out-of-range(6)}(0..6), + confirmed-errorPDU + [3] IMPLICIT INTEGER {other(0), unrecognized-service(1), + invalid-invokeID(2), + invalid-serviceError(3), + value-out-of-range(4)}(0..4), + unconfirmedPDU + [4] IMPLICIT INTEGER {other(0), unrecognized-service(1), + invalid-argument(2), + max-recursion-exceeded(3), + value-out-of-range(4)}(0..4), + pdu-error + [5] IMPLICIT INTEGER {unknown-pdu-type(0), invalid-pdu(1), + illegal-acse-mapping(2)}, + cancel-requestPDU + [6] IMPLICIT INTEGER {other(0), invalid-invokeID(1)}(0..1), + cancel-responsePDU + [7] IMPLICIT INTEGER {other(0), invalid-invokeID(1)}(0..1), + cancel-errorPDU + [8] IMPLICIT INTEGER {other(0), invalid-invokeID(1), + invalid-serviceError(2), + value-out-of-range(3)}(0..3), + conclude-requestPDU + [9] IMPLICIT INTEGER {other(0), invalid-argument(1)}(0..1), + conclude-responsePDU + [10] IMPLICIT INTEGER {other(0), invalid-result(1)}(0..1), + conclude-errorPDU + [11] IMPLICIT INTEGER {other(0), invalid-serviceError(1), + value-out-of-range(2)}(0..2)}} + +DefineAccessControlList-Request ::= SEQUENCE { + accessControlListName [0] IMPLICIT Identifier, + accessControlListElements + [1] IMPLICIT SEQUENCE {readAccessCondition + [0] AccessCondition OPTIONAL, + storeAccessCondition + [1] AccessCondition OPTIONAL, + writeAccessCondition + [2] AccessCondition OPTIONAL, + loadAccessCondition + [3] AccessCondition OPTIONAL, + executeAccessCondition + [4] AccessCondition OPTIONAL, + deleteAccessCondition + [5] AccessCondition OPTIONAL, + editAccessCondition + [6] AccessCondition OPTIONAL}} + +DefineAccessControlList-Response ::= NULL + +GetAccessControlListAttributes-Request ::= CHOICE { + accessControlListName [0] IMPLICIT Identifier, + vMD [1] IMPLICIT NULL, + namedObject + [2] IMPLICIT SEQUENCE {objectClass [0] ObjectClass, + objectName [1] ObjectName}} + +GetAccessControlListAttributes-Response ::= SEQUENCE { + name [0] Identifier, + accessControlListElements + [1] IMPLICIT SEQUENCE {readAccessCondition + [0] AccessCondition OPTIONAL, + storeAccessCondition + [1] AccessCondition OPTIONAL, + writeAccessCondition + [2] AccessCondition OPTIONAL, + loadAccessCondition + [3] AccessCondition OPTIONAL, + executeAccessCondition + [4] AccessCondition OPTIONAL, + deleteAccessCondition + [5] AccessCondition OPTIONAL, + editAccessCondition + [6] AccessCondition OPTIONAL}, + vMDuse [2] IMPLICIT BOOLEAN, + references + [3] IMPLICIT SEQUENCE OF + SEQUENCE {objectClass [0] ObjectClass, + objectCount [1] IMPLICIT INTEGER}, + accessControlList [4] IMPLICIT Identifier OPTIONAL + -- shall be included if and only if + -- aco has been negotiated--} + +ReportAccessControlledObjects-Request ::= SEQUENCE { + accessControlList [0] IMPLICIT Identifier, + objectClass [1] ObjectClass, + continueAfter [2] ObjectName OPTIONAL} + +ReportAccessControlledObjects-Response ::= SEQUENCE { + listOfNames [0] IMPLICIT SEQUENCE OF ObjectName, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +DeleteAccessControlList-Request ::= Identifier + +-- Name of Access Control List Object +DeleteAccessControlList-Response ::= NULL + +ChangeAccessControl-Request ::= SEQUENCE { + scopeOfChange + CHOICE {vMDOnly [0] IMPLICIT NULL, + listOfObjects + [1] IMPLICIT SEQUENCE {objectClass [0] ObjectClass, + objectScope + [1] CHOICE {specific + [0] IMPLICIT SEQUENCE OF + ObjectName, + -- Names of the objects (of class objectClass) + -- whose access is to be changed + aa-specific + [1] IMPLICIT NULL, + domain + [2] IMPLICIT Identifier, + -- Name of the Domain whose elements + -- are to be changed + vmd + [3] IMPLICIT NULL}}}, + accessControlListName [2] IMPLICIT Identifier + -- name of the AccessControlList Object that contains + -- the conditions for access control--} + +ChangeAccessControl-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberChanged [1] IMPLICIT Unsigned32} + +ChangeAccessControl-Error ::= Unsigned32 + +StatusResponse ::= SEQUENCE { + vmdLogicalStatus + [0] IMPLICIT INTEGER {state-changes-allowed(0), + no-state-changes-allowed(1), + limited-services-permitted(2), + support-services-allowed(3)}(0..3), + vmdPhysicalStatus + [1] IMPLICIT INTEGER {operational(0), partially-operational(1), + inoperable(2), needs-commissioning(3)}(0..3), + localDetail [2] IMPLICIT BIT STRING(SIZE (0..128)) OPTIONAL} + +CS-Status-Response ::= CHOICE { + fullResponse + SEQUENCE {operationState [0] IMPLICIT OperationState, + extendedStatus [1] IMPLICIT ExtendedStatus, + extendedStatusMask + [2] IMPLICIT ExtendedStatus DEFAULT '1111'B, + selectedProgramInvocation + CHOICE {programInvocation [3] IMPLICIT Identifier, + noneSelected [4] IMPLICIT NULL}}, + noExtraResponse NULL} + +OperationState ::= INTEGER { + idle(0), loaded(1), ready(2), executing(3), motion-paused(4), + manualInterventionRequired(5)}(0..5) + +ExtendedStatus ::= BIT STRING { + safetyInterlocksViolated(0), anyPhysicalResourcePowerOn(1), + allPhysicalResourcesCalibrated(2), localControl(3)}(SIZE (4)) + +Status-Request ::= BOOLEAN -- Extended Derivation + +Status-Response ::= StatusResponse + +UnsolicitedStatus ::= StatusResponse + +GetNameList-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + objectScope + [1] CHOICE {vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL}, + continueAfter [2] IMPLICIT Identifier OPTIONAL} + +GetNameList-Response ::= SEQUENCE { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +Identify-Request ::= NULL + +Identify-Response ::= SEQUENCE { + vendorName [0] IMPLICIT MMSString, + modelName [1] IMPLICIT MMSString, + revision [2] IMPLICIT MMSString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL} + +Rename-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier} + +Rename-Response ::= NULL + +GetCapabilityList-Request ::= SEQUENCE {continueAfter MMSString OPTIONAL} + +GetCapabilityList-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF MMSString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +VMDStop-Request ::= NULL + +VMDStop-Response ::= NULL + +VMDReset-Request ::= BOOLEAN -- Extended Derivation + +VMDReset-Response ::= StatusResponse + +InitiateDownloadSequence-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString, + sharable [2] IMPLICIT BOOLEAN} + +InitiateDownloadSequence-Response ::= NULL + +DownloadSegment-Request ::= Identifier -- Domain Name + +DownloadSegment-Response ::= SEQUENCE { + loadData LoadData, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +LoadData ::= CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL, + embedded EMBEDDED PDV} + +TerminateDownloadSequence-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL} + +TerminateDownloadSequence-Response ::= NULL + +InitiateUploadSequence-Request ::= Identifier -- Domain Name + +InitiateUploadSequence-Response ::= SEQUENCE { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString} + +UploadSegment-Request ::= Integer32 -- ULSM ID + +UploadSegment-Response ::= SEQUENCE { + loadData LoadData, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +TerminateUploadSequence-Request ::= Integer32 -- ULSM ID + +TerminateUploadSequence-Response ::= NULL + +RequestDomainDownload-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName} + +RequestDomainDownload-Response ::= NULL + +RequestDomainUpload-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName} + +RequestDomainUpload-Response ::= NULL + +LoadDomainContent-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName, + thirdParty [5] IMPLICIT ApplicationReference OPTIONAL} + +LoadDomainContent-Response ::= NULL + +StoreDomainContent-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL} + +StoreDomainContent-Response ::= NULL + +DeleteDomain-Request ::= Identifier -- Domain Name + +DeleteDomain-Response ::= NULL + +GetDomainAttributes-Request ::= Identifier -- Domain Name + +GetDomainAttributes-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF MMSString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, + -- Program Invocation Names + uploadInProgress [5] IMPLICIT Integer8, + accessControlList [6] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +CreateProgramInvocation-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring, + -- FALSE indicates CURRENT monitoring--} + +CreateProgramInvocation-Response ::= NULL + +CS-CreateProgramInvocation-Request ::= INTEGER { + normal(0), controlling(1), controlled(2)}(0..2) + +DeleteProgramInvocation-Request ::= Identifier -- Program Invocation Name + +DeleteProgramInvocation-Response ::= NULL + +Start-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument + CHOICE {simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + embeddedString EMBEDDED PDV} OPTIONAL} + +Start-Response ::= NULL + +Start-Error ::= ProgramInvocationState + +CS-Start-Request ::= [0] CHOICE { + normal NULL, + controlling + SEQUENCE {startLocation [0] IMPLICIT VisibleString OPTIONAL, + startCount [1] StartCount DEFAULT cycleCount:1}} + +StartCount ::= CHOICE { + noLimit [0] IMPLICIT NULL, + cycleCount [1] IMPLICIT INTEGER, + stepCount [2] IMPLICIT INTEGER} + +Stop-Request ::= SEQUENCE {programInvocationName [0] IMPLICIT Identifier} + +Stop-Response ::= NULL + +Stop-Error ::= ProgramInvocationState + +Resume-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument + CHOICE {simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV} OPTIONAL} + +Resume-Response ::= NULL + +Resume-Error ::= ProgramInvocationState + +CS-Resume-Request ::= [0] CHOICE { + normal NULL, + controlling + SEQUENCE {modeType + CHOICE {continueMode [0] IMPLICIT NULL, + changeMode [1] StartCount}}} + +Reset-Request ::= SEQUENCE {programInvocationName [0] IMPLICIT Identifier} + +Reset-Response ::= NULL + +Reset-Error ::= ProgramInvocationState + +Kill-Request ::= SEQUENCE {programInvocationName [0] IMPLICIT Identifier} + +Kill-Response ::= NULL + +GetProgramInvocationAttributes-Request ::= + Identifier -- Program Invocation Name + +GetProgramInvocationAttributes-Response ::= SEQUENCE { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + executionArgument + CHOICE {simpleString [5] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV}, + accessControlList [6] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +CS-GetProgramInvocationAttributes-Response ::= SEQUENCE { + errorCode [0] IMPLICIT INTEGER, + control + [1] CHOICE {controlling + [0] IMPLICIT SEQUENCE {controlledPI + [0] IMPLICIT SEQUENCE OF Identifier, + programLocation + [1] IMPLICIT VisibleString OPTIONAL, + runningMode + [2] CHOICE {freeRunning + [0] IMPLICIT NULL, + cycleLimited + [1] IMPLICIT INTEGER, + stepLimited + [2] IMPLICIT INTEGER}}, + controlled + [1] CHOICE {controllingPI [0] IMPLICIT Identifier, + none [1] IMPLICIT NULL}, + normal [2] IMPLICIT NULL}} + +Select-Request ::= SEQUENCE { + controlling [0] IMPLICIT Identifier OPTIONAL, + controlled [1] IMPLICIT SEQUENCE OF Identifier OPTIONAL + -- this field shall appear if and only if the controlling field is included--} + +Select-Response ::= NULL + +AlterProgramInvocationAttributes-Request ::= SEQUENCE { + programInvocation [0] IMPLICIT Identifier, + startCount [1] StartCount DEFAULT cycleCount:1} + +AlterProgramInvocationAttributes-Response ::= NULL + +ReconfigureProgramInvocation-Request ::= SEQUENCE { + oldProgramInvocationName [0] IMPLICIT Identifier, + newProgramInvocationName [1] IMPLICIT Identifier OPTIONAL, + domainsToAdd [2] IMPLICIT SEQUENCE OF Identifier, + domainsToRemove [3] IMPLICIT SEQUENCE OF Identifier} + +ReconfigureProgramInvocation-Response ::= NULL + +ControlElement ::= CHOICE { + beginDomainDef + [0] SEQUENCE {domainName [1] IMPLICIT Identifier, + capabilities [2] IMPLICIT SEQUENCE OF MMSString, + sharable [3] IMPLICIT BOOLEAN, + loadData [4] LoadData OPTIONAL}, + continueDomainDef + [1] SEQUENCE {domainName [1] IMPLICIT Identifier, + loadData [3] LoadData}, + endDomainDef [2] IMPLICIT Identifier, + piDefinition + [3] IMPLICIT SEQUENCE {piName [0] IMPLICIT Identifier, + listOfDomains [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL, + pIState + [4] IMPLICIT ProgramInvocationState OPTIONAL}} + +InitiateUnitControlLoad-Request ::= Identifier -- Unit Control Name + +InitiateUnitControlLoad-Response ::= NULL + +InitiateUnitControl-Error ::= CHOICE { + domain [0] IMPLICIT Identifier, + programInvocation [1] IMPLICIT Identifier} + +UnitControlLoadSegment-Request ::= Identifier -- Unit Control Name + +UnitControlLoadSegment-Response ::= SEQUENCE { + controlElements [0] IMPLICIT SEQUENCE OF ControlElement, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +UnitControlUpload-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, -- Unit Control Name + continueAfter + CHOICE {domain [1] IMPLICIT Identifier, + ulsmID [2] IMPLICIT INTEGER, + programInvocation [3] IMPLICIT Identifier} OPTIONAL} + +UnitControlUpload-Response ::= SEQUENCE { + controlElements [0] IMPLICIT SEQUENCE OF ControlElement, + nextElement + CHOICE {domain [1] IMPLICIT Identifier, + ulsmID [2] IMPLICIT INTEGER, + programInvocation [3] IMPLICIT Identifier} OPTIONAL} + +StartUnitControl-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, -- Unit Control Name + executionArgument + CHOICE {simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV} OPTIONAL} + +StartUnitControl-Response ::= NULL + +StartUnitControl-Error ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + programInvocationState [1] IMPLICIT ProgramInvocationState} + +StopUnitControl-Request ::= Identifier -- Unit Control Name + +StopUnitControl-Response ::= NULL + +StopUnitControl-Error ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + programInvocationState [1] IMPLICIT ProgramInvocationState} + +CreateUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier} + +CreateUnitControl-Response ::= NULL + +AddToUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier} + +AddToUnitControl-Response ::= NULL + +RemoveFromUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier} + +RemoveFromUnitControl-Response ::= NULL + +GetUnitControlAttributes-Request ::= Identifier -- Unit Control Name + +GetUnitControlAttributes-Response ::= SEQUENCE { + domains [0] IMPLICIT SEQUENCE OF Identifier, + programInvocations [1] IMPLICIT SEQUENCE OF Identifier} + +LoadUnitControlFromFile-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL} + +LoadUnitControlFromFile-Response ::= NULL + +LoadUnitControlFromFile-Error ::= CHOICE { + none [0] IMPLICIT NULL, + domain [1] IMPLICIT Identifier, + programInvocation [2] IMPLICIT Identifier} + +StoreUnitControlToFile-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL} + +StoreUnitControlToFile-Response ::= NULL + +DeleteUnitControl-Request ::= Identifier -- Unit Control Name + +DeleteUnitControl-Response ::= NULL + +DeleteUnitControl-Error ::= CHOICE { + domain [0] IMPLICIT Identifier, + programInvocation [1] IMPLICIT Identifier} + +TypeSpecification ::= CHOICE { + typeName [0] ObjectName, + typeDescription TypeDescription} + +AlternateAccess ::= + SEQUENCE OF + CHOICE {unnamed AlternateAccessSelection, + named + [5] IMPLICIT SEQUENCE {componentName [0] IMPLICIT Identifier, + access AlternateAccessSelection}} + +AlternateAccessSelection ::= CHOICE { + selectAlternateAccess + [0] IMPLICIT SEQUENCE {accessSelection + CHOICE {component [0] IMPLICIT Identifier, + index [1] IMPLICIT Unsigned32, + indexRange + [2] IMPLICIT SEQUENCE {lowIndex + [0] IMPLICIT Unsigned32, + numberOfElements + [1] IMPLICIT Unsigned32}, + allElements [3] IMPLICIT NULL}, + alternateAccess AlternateAccess}, + selectAccess + CHOICE {component [1] IMPLICIT Identifier, + index [2] IMPLICIT Unsigned32, + indexRange + [3] IMPLICIT SEQUENCE {lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32}, + allElements [4] IMPLICIT NULL}} + +AccessResult ::= CHOICE {failure [0] IMPLICIT DataAccessError, + success Data} + +Data ::= CHOICE { + -- context tag [0] is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, -- shall not be negative + floating-point [7] IMPLICIT FloatingPoint, + -- [8] is reserved + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + generalized-time [11] IMPLICIT GeneralizedTime, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, -- shall not be negative + booleanArray [14] IMPLICIT BIT STRING, + objId [15] IMPLICIT OBJECT IDENTIFIER, + ..., + mMSString [16] IMPLICIT MMSString, + utc-time [17] IMPLICIT UtcTime -- added by IEC61850 8.1 G3--} + +FloatingPoint ::= OCTET STRING + +DataAccessError ::= INTEGER { + object-invalidated(0), hardware-fault(1), temporarily-unavailable(2), + object-access-denied(3), object-undefined(4), invalid-address(5), + type-unsupported(6), type-inconsistent(7), object-attribute-inconsistent(8), + object-access-unsupported(9), object-non-existent(10), + object-value-invalid(11)}(0..11) + +VariableAccessSpecification ::= CHOICE { + listOfVariable + [0] IMPLICIT SEQUENCE OF + SEQUENCE {variableSpecification VariableSpecification, + alternateAccess + [5] IMPLICIT AlternateAccess OPTIONAL}, + variableListName [1] ObjectName} + +VariableSpecification ::= CHOICE { + name [0] ObjectName, + address [1] Address, + variableDescription + [2] IMPLICIT SEQUENCE {address Address, + typeSpecification TypeSpecification}, + -- the following element is only present to support the services + -- defined in annex E + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, + invalidated [4] IMPLICIT NULL} + +Read-Request ::= SEQUENCE { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification} + +Read-Response ::= SEQUENCE { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult} + +Write-Request ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data} + +Write-Response ::= + SEQUENCE OF + CHOICE {failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL} + +InformationReport ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult} + +GetVariableAccessAttributes-Request ::= CHOICE { + name [0] ObjectName, + address [1] Address} + +GetVariableAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeDescription [2] TypeDescription, + accessControlList [3] IMPLICIT Identifier OPTIONAL, + -- Shall not appear in minor version one or two + meaning [4] IMPLICIT VisibleString OPTIONAL} + +DefineNamedVariable-Request ::= SEQUENCE { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL} + +DefineNamedVariable-Response ::= NULL + +DeleteVariableAccess-Request ::= SEQUENCE { + scopeOfDelete + [0] IMPLICIT INTEGER {specific(0), aa-specific(1), domain(2), vmd(3)}(0..3) + DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL} + +DeleteVariableAccess-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32} + +DeleteVariableAccess-Error ::= Unsigned32 -- numberDeleted + +DefineNamedVariableList-Request ::= SEQUENCE { + variableListName ObjectName, + listOfVariable + [0] IMPLICIT SEQUENCE OF + SEQUENCE {variableSpecification VariableSpecification, + alternateAccess + [5] IMPLICIT AlternateAccess OPTIONAL}} + +DefineNamedVariableList-Response ::= NULL + +GetNamedVariableListAttributes-Request ::= ObjectName -- VariableListName + +GetNamedVariableListAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable + [1] IMPLICIT SEQUENCE OF + SEQUENCE {variableSpecification VariableSpecification, + alternateAccess + [5] IMPLICIT AlternateAccess OPTIONAL}, + accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +DeleteNamedVariableList-Request ::= SEQUENCE { + scopeOfDelete + [0] IMPLICIT INTEGER {specific(0), aa-specific(1), domain(2), vmd(3)}(0..3) + DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL} + +DeleteNamedVariableList-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32} + +DeleteNamedVariableList-Error ::= Unsigned32 -- numberDeleted + +DefineNamedType-Request ::= SEQUENCE { + typeName ObjectName, + typeSpecification TypeSpecification} + +DefineNamedType-Response ::= NULL + +GetNamedTypeAttributes-Request ::= ObjectName --TypeName + +GetNamedTypeAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification, + accessControlList [1] IMPLICIT Identifier OPTIONAL, + -- Shall not appear in minor version one or two + meaning [4] IMPLICIT VisibleString OPTIONAL} + +DeleteNamedType-Request ::= SEQUENCE { + scopeOfDelete + [0] IMPLICIT INTEGER {specific(0), aa-specific(1), domain(2), vmd(3)}(0..3) + DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL} + +DeleteNamedType-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32} + +DeleteNamedType-Error ::= Unsigned32 -- numberDeleted + +ExchangeData-Request ::= SEQUENCE { + dataExchangeName [0] ObjectName, + listOfRequestData [1] IMPLICIT SEQUENCE OF Data} + +ExchangeData-Response ::= SEQUENCE { + listOfResponseData [0] IMPLICIT SEQUENCE OF Data} + +GetDataExchangeAttributes-Request ::= ObjectName + +GetDataExchangeAttributes-Response ::= SEQUENCE { + inUse [0] IMPLICIT BOOLEAN, + listOfRequestTypeDescriptions [1] IMPLICIT SEQUENCE OF TypeDescription, + listOfResponseTypeDescriptions [2] IMPLICIT SEQUENCE OF TypeDescription, + programInvocation [3] IMPLICIT Identifier OPTIONAL, + accessControlList [4] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +TakeControl-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE, + applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL} + +TakeControl-Response ::= CHOICE { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier} + +RelinquishControl-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL} + +RelinquishControl-Response ::= NULL + +DefineSemaphore-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + numberOfTokens [1] IMPLICIT Unsigned16} + +DefineSemaphore-Response ::= NULL + +DeleteSemaphore-Request ::= ObjectName -- Semaphore Name + +DeleteSemaphore-Response ::= NULL + +ReportSemaphoreStatus-Request ::= ObjectName -- Semaphore Name + +ReportSemaphoreStatus-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER {token(0), pool(1)}(0..1), + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16, + accessControlList [5] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +ReportPoolSemaphoreStatus-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL} + +ReportPoolSemaphoreStatus-Response ::= SEQUENCE { + listOfNamedTokens + [0] IMPLICIT SEQUENCE OF + CHOICE {freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier}, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +ReportSemaphoreEntryStatus-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + state + [1] IMPLICIT INTEGER {queued(0), owner(1), hung(2)}(0..2), + entryIDToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL} + +ReportSemaphoreEntryStatus-Response ::= SEQUENCE { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +SemaphoreEntry ::= SEQUENCE { + entryID [0] IMPLICIT OCTET STRING, + entryClass + [1] IMPLICIT INTEGER {simple(0), modifier(1)}(0..1), + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT normalPriority, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE} + +AttachToSemaphore ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE} + +Input-Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, + listOfPromptData [2] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL} + +Input-Response ::= MMSString -- Input String + +Output-Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF MMSString} + +Output-Response ::= NULL + +TriggerEvent-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL} + +TriggerEvent-Response ::= NULL + +EventNotification ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + severity [2] IMPLICIT Severity, + currentState [3] IMPLICIT EC-State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult + [8] IMPLICIT SEQUENCE {eventActionName ObjectName, + successOrFailure + CHOICE {success + [0] IMPLICIT SEQUENCE {confirmedServiceResponse + + ConfirmedServiceResponse, + cs-Response-Detail + + [79] Response-Detail + OPTIONAL + -- shall not be transmitted if value is the + -- value of a tagged type derived from NULL--}, + failure + [1] IMPLICIT SEQUENCE {modifierPosition + [0] IMPLICIT Unsigned32 + OPTIONAL, + serviceError + [1] IMPLICIT ServiceError}}} + OPTIONAL} + +CS-EventNotification ::= [0] CHOICE { + string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + +AcknowledgeEventNotification-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC-State, + timeOfAcknowledgedTransition [3] EventTime} + +AcknowledgeEventNotification-Response ::= NULL + +GetAlarmSummary-Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgementFilter + [2] IMPLICIT INTEGER {not-acked(0), acked(1), all(2)}(0..2) + DEFAULT not-acked, + severityFilter + [3] IMPLICIT SEQUENCE {mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8} + DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL} + +GetAlarmSummary-Response ::= SEQUENCE { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +AlarmSummary ::= SEQUENCE { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC-State, + unacknowledgedState + [3] IMPLICIT INTEGER {none(0), active(1), idle(2), both(3)}(0..3), + displayEnhancement [4] EN-Additional-Detail OPTIONAL, + -- shall not be transmitted if the value is NULL + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL} + +EN-Additional-Detail ::= [0] CHOICE { + string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + +GetAlarmEnrollmentSummary-Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgementFilter + [2] IMPLICIT INTEGER {not-acked(0), acked(1), all(2)}(0..2) + DEFAULT not-acked, + severityFilter + [3] IMPLICIT SEQUENCE {mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8} + DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL} + +GetAlarmEnrollmentSummary-Response ::= SEQUENCE { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +AlarmEnrollmentSummary ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + clientApplication [2] ApplicationReference OPTIONAL, + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC-State, + displayEnhancement [5] EN-Additional-Detail OPTIONAL, + -- shall not be transmitted if the value is NULL + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule, + enrollmentState [8] IMPLICIT EE-State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL} + +AttachToEventCondition ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL} + +DefineEventCondition-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC-Class, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + severity [3] IMPLICIT Unsigned8 DEFAULT normalSeverity, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL} + +DefineEventCondition-Response ::= NULL + +CS-DefineEventCondition-Request ::= [0] CHOICE { + string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + +DeleteEventCondition-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL} + +DeleteEventCondition-Response ::= Unsigned32 --Candidates Not Deleted + +GetEventConditionAttributes-Request ::= ObjectName --Event Condition Name + +GetEventConditionAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC-Class, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + severity [3] IMPLICIT Unsigned8 DEFAULT normalSeverity, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable + [6] CHOICE {variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL} OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL, + accessControlList [8] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +CS-GetEventConditionAttributes-Response ::= SEQUENCE { + groupPriorityOverride + [0] CHOICE {priority [0] IMPLICIT Priority, + undefined [1] IMPLICIT NULL} OPTIONAL, + listOfReferencingECL [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + displayEnhancement + [2] CHOICE {string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement [2] IMPLICIT NULL}} + +ReportEventConditionStatus-Request ::= ObjectName --Event Condition Name + +ReportEventConditionStatus-Response ::= SEQUENCE { + currentState [0] IMPLICIT EC-State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL} + +AlterEventConditionMonitoring-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL, + evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL + -- At least one of enabled, priority, alarmSummaryReports, or + -- evaluationInterval shall be present.--} + +AlterEventConditionMonitoring-Response ::= NULL + +CS-AlterEventConditionMonitoring-Request ::= SEQUENCE { + changeDisplay + CHOICE {string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement [2] NULL} OPTIONAL} + +DefineEventAction-Request ::= SEQUENCE { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL, + confirmedServiceRequest [2] ConfirmedServiceRequest, + cs-extension [79] Request-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL--} + +DefineEventAction-Response ::= NULL + +DeleteEventAction-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL} + +DeleteEventAction-Response ::= Unsigned32 --Candidates Not Deleted + +GetEventActionAttributes-Request ::= ObjectName --EventActionName + +GetEventActionAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier, + confirmedServiceRequest [2] ConfirmedServiceRequest, + cs-extension [79] Request-Detail OPTIONAL, + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL + accessControlList [3] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +ReportEventActionStatus-Request ::= ObjectName -- Event Action Name + +ReportEventActionStatus-Response ::= Unsigned32 -- Number of Event Enrollments + +DefineEventEnrollment-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransitions [2] IMPLICIT Transitions, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL, + clientApplication [5] ApplicationReference OPTIONAL} + +DefineEventEnrollment-Response ::= NULL + +DefineEventEnrollment-Error ::= ObjectName + +CS-DefineEventEnrollment-Request ::= [0] CHOICE { + string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + +DeleteEventEnrollment-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName} + +DeleteEventEnrollment-Response ::= Unsigned32 --Candidates Not Deleted + +GetEventEnrollmentAttributes-Request ::= SEQUENCE { + scopeOfRequest + [0] IMPLICIT INTEGER {specific(0), client(1), ec(2), ea(3)}(0..3) + DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + clientApplication [2] ApplicationReference OPTIONAL, + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL} + +GetEventEnrollmentAttributes-Response ::= SEQUENCE { + listOfEEAttributes [0] IMPLICIT SEQUENCE OF EEAttributes, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +EEAttributes ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName + [1] CHOICE {eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL}, + eventActionName + [2] CHOICE {eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL} OPTIONAL, + clientApplication [3] ApplicationReference OPTIONAL, + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE-Class, + duration [6] IMPLICIT EE-Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32 OPTIONAL, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL, + displayEnhancement + [9] CHOICE {string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + -- shall not be transmitted if the value is NULL--} + +ReportEventEnrollmentStatus-Request ::= ObjectName --Event Enrollment Name + +ReportEventEnrollmentStatus-Response ::= SEQUENCE { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE-Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE-State} + +AlterEventEnrollment-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL} + +AlterEventEnrollment-Response ::= SEQUENCE { + currentState + [0] CHOICE {state [0] IMPLICIT EE-State, + undefined [1] IMPLICIT NULL}, + transitionTime [1] EventTime} + +CS-AlterEventEnrollment-Request ::= SEQUENCE { + changeDisplay + CHOICE {string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement [2] NULL} OPTIONAL} + +EE-State ::= INTEGER { + disabled(0), idle(1), active(2), activeNoAckA(3), idleNoAckI(4), + idleNoAckA(5), idleAcked(6), activeAcked(7), undefined(8)} + +DefineEventConditionList-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName, + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated.--} + +DefineEventConditionList-Response ::= NULL + +DefineEventConditionList-Error ::= ObjectName + +DeleteEventConditionList-Request ::= ObjectName -- EventConditionListName + +DeleteEventConditionList-Response ::= NULL + +AddEventConditionListReference-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName, + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated.--} + +AddEventConditionListReference-Response ::= NULL + +AddEventConditionListReference-Error ::= ObjectName + +RemoveEventConditionListReference-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName, + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName + -- shall appear if an only if recl has been negotiated. --} + +RemoveEventConditionListReference-Response ::= NULL + +RemoveEventConditionListReference-Error ::= CHOICE { + eventCondition [0] ObjectName, + eventConditionList [1] ObjectName} + +GetEventConditionListAttributes-Request ::= + ObjectName -- eventConditionListName + +GetEventConditionListAttributes-Response ::= SEQUENCE { + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName, + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated.--} + +ReportEventConditionListStatus-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, -- Event Condition List Name + continueAfter [1] IMPLICIT Identifier OPTIONAL} + +ReportEventConditionListStatus-Response ::= SEQUENCE { + listOfEventConditionStatus [1] IMPLICIT SEQUENCE OF EventConditionStatus, + moreFollows [2] IMPLICIT BOOLEAN DEFAULT TRUE} + +EventConditionStatus ::= SEQUENCE { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State, + numberOfEventEnrollments [2] IMPLICIT Unsigned32, + enabled [3] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [4] EventTime OPTIONAL, + timeOfLastTransitionToIdle [5] EventTime OPTIONAL} + +AlterEventConditionListMonitoring-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN, + priorityChange + [2] CHOICE {priorityValue [0] IMPLICIT INTEGER, + priorityReset [1] IMPLICIT NULL} OPTIONAL} + +AlterEventConditionListMonitoring-Response ::= NULL + +ReadJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + rangeStartSpecification + [1] CHOICE {startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING} OPTIONAL, + rangeStopSpecification + [2] CHOICE {endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32} OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter + [5] IMPLICIT SEQUENCE {timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING} + OPTIONAL} + +ReadJournal-Response ::= SEQUENCE { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +JournalEntry ::= SEQUENCE { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent} + +WriteJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent} + +WriteJournal-Response ::= NULL + +InitializeJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + limitSpecification + [1] IMPLICIT SEQUENCE {limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL} + OPTIONAL} + +InitializeJournal-Response ::= Unsigned32 -- Entries Deleted + +ReportJournalStatus-Request ::= ObjectName --Journal Name + +ReportJournalStatus-Response ::= SEQUENCE { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN, + accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +CreateJournal-Request ::= SEQUENCE {journalName [0] ObjectName} + +CreateJournal-Response ::= NULL + +DeleteJournal-Request ::= SEQUENCE {journalName [0] ObjectName} + +DeleteJournal-Response ::= NULL + +EntryContent ::= SEQUENCE { + occurrenceTime [0] IMPLICIT TimeOfDay, + entryForm + CHOICE {data + [2] IMPLICIT SEQUENCE {event + [0] IMPLICIT SEQUENCE {eventConditionName + [0] ObjectName, + currentState + + [1] IMPLICIT EC-State} + OPTIONAL, + listOfVariables + [1] IMPLICIT SEQUENCE OF + Journal-Variable OPTIONAL}, + annotation [3] MMSString}} + +END + + + +MMS-Environment-1 {iso standard 9506 part(2) mms-environment-version1(4)} +DEFINITIONS ::= +BEGIN + +EXPORTS ApplicationReference, Authentication-value; + +IMPORTS + AP-title, AP-invocation-identifier, AE-qualifier, AE-invocation-identifier, + Authentication-value + FROM ACSE-1 {joint-iso-itu-t association-control(2) modules(0) apdus(0) + version1(1)}; + +ApplicationReference ::= SEQUENCE { + ap-title [0] ACSE-1.AP-title OPTIONAL, + ap-invocation-id [1] ACSE-1.AP-invocation-identifier OPTIONAL, + ae-qualifier [2] ACSE-1.AE-qualifier OPTIONAL, + ae-invocation-id [3] ACSE-1.AE-invocation-identifier OPTIONAL} + +END + + + +MMS-SCI-Module-1 {iso standard 9506 part(2) mms-file-record-version1(2)} +DEFINITIONS ::= +BEGIN + +IMPORTS + ApplicationReference + FROM MMS-Environment-1 {iso standard 9506 part(2) + mms-environment-version1(4)} + AccessCondition, AdditionalCBBOptions, AdditionalSupportOptions, Address, + AlarmAckRule, Control-State, DomainState, EC-Class, EC-State, EE-Duration, + EE-Class, LogicalStatus, Modifier, ParameterSupportOptions, PhysicalStatus, + Priority, ProgramInvocationState, ServiceSupportOptions, Severity, + Transitions, TypeDescription + FROM MMS-Object-Module-1 {iso standard 9506 part(1) + mms-object-model-version1(2)} + AlternateAccess, ConfirmedServiceRequest, AttachToEventCondition, + AttachToSemaphore, Data, EE-State, Identifier, Integer8, Integer32, + MMSString, MMS255String, ObjectName, TimeOfDay, TypeSpecification, + Unsigned32, Unsigned8 + FROM ISO-9506-MMS-1 {iso standard 9506 part(2) + mms-abstract-syntax-version1(1)}; + +SCI-Information ::= SEQUENCE { + partOne [0] IMPLICIT VMD-File, + partTwo [1] IMPLICIT Service-and-Parameter-CBBs} + +VMD-File ::= SEQUENCE { + executiveFunction [0] IMPLICIT ApplicationReference, + vendorName [1] MMSString, + modelName [2] MMSString, + revision [3] MMSString, + abstractSyntaxes [4] IMPLICIT OBJECT IDENTIFIER, + -- no TRANSACTIONs, + -- no APPLICATION-ASSOCIATIONs, + accessControl [5] IMPLICIT Access-Control-List-instance, + logicalStatus [6] IMPLICIT LogicalStatus, + capabilities [7] IMPLICIT SEQUENCE OF MMSString, + physicalStatus [8] IMPLICIT PhysicalStatus, + local-detail [9] IMPLICIT BIT STRING, + accessControlLists + [10] IMPLICIT SEQUENCE OF Access-Control-List-instance, + domains [11] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [12] IMPLICIT SEQUENCE OF Program-Invocation-instance, + unitControls + [13] IMPLICIT SEQUENCE OF Unit-Control-instance, + unnamedVariables + [14] IMPLICIT SEQUENCE OF Unnamed-Variable-instance, + namedVariables + [15] IMPLICIT SEQUENCE OF Named-Variable-instance, + namedVariableLists + [16] IMPLICIT SEQUENCE OF Named-Variable-List-instance, + namedTypes [17] IMPLICIT SEQUENCE OF Named-Type-instance, + dataExchanges + [18] IMPLICIT SEQUENCE OF Data-Exchange-instance, + semaphores [19] IMPLICIT SEQUENCE OF Semaphore-instance, + operatorStations + [20] IMPLICIT SEQUENCE OF Operator-Station-instance, + eventConditions + [21] IMPLICIT SEQUENCE OF Event-Condition-instance, + eventActions + [22] IMPLICIT SEQUENCE OF Event-Action-instance, + eventEnrollments + [23] IMPLICIT SEQUENCE OF Event-Enrollment-instance, + eventConditionLists + [24] IMPLICIT SEQUENCE OF Event-Condition-List-instance, + journals [25] IMPLICIT SEQUENCE OF Journal-instance, + ..., + selected-Program-Invocation + CHOICE {selectedProgram [26] IMPLICIT Program-Invocation-instance, + noneSelected [27] IMPLICIT NULL}} + +Access-Control-List-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + readAccessCondition + [4] AccessCondition OPTIONAL, + storeAccessCondition + [5] AccessCondition OPTIONAL, + writeAccessCondition + [6] AccessCondition OPTIONAL, + loadAccessCondition + [7] AccessCondition OPTIONAL, + executeAccessCondition + [8] AccessCondition OPTIONAL, + deleteAccessCondition + [9] AccessCondition OPTIONAL, + editAccessCondition + [10] AccessCondition OPTIONAL, + -- + -- The following fields are used to record lists of objects placed + -- under the control of this ACCESS-CONTROL-LIST object. + -- They will be referred to collectively as the Controlled Object Lists + -- + accessControlLists + [11] IMPLICIT SEQUENCE OF + Access-Control-List-instance, + domains + [12] IMPLICIT SEQUENCE OF + Domain-instance, + programInvocations + [13] IMPLICIT SEQUENCE OF + Program-Invocation-instance, + unitControls + [14] IMPLICIT SEQUENCE OF + Unit-Control-instance, + unnamedVariables + [15] IMPLICIT SEQUENCE OF + Unnamed-Variable-instance, + namedVariables + [16] IMPLICIT SEQUENCE OF + Named-Variable-instance, + namedVariableLists + [17] IMPLICIT SEQUENCE OF + Named-Variable-List-instance, + namedTypes + [18] IMPLICIT SEQUENCE OF + Named-Type-instance, + dataExchanges + [19] IMPLICIT SEQUENCE OF + Data-Exchange-instance, + semaphores + [20] IMPLICIT SEQUENCE OF + Semaphore-instance, + operatorStations + [21] IMPLICIT SEQUENCE OF + Operator-Station-instance, + eventConditions + [22] IMPLICIT SEQUENCE OF + Event-Condition-instance, + eventActions + [23] IMPLICIT SEQUENCE OF + Event-Action-instance, + eventEnrollments + [24] IMPLICIT SEQUENCE OF + Event-Enrollment-instance, + journals + [25] IMPLICIT SEQUENCE OF + Journal-instance, + ..., + eventConditionLists + [26] IMPLICIT SEQUENCE OF + Event-Condition-List-instance}}} + +Domain-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {capabilities + [3] IMPLICIT SEQUENCE OF MMSString, + state + [4] IMPLICIT DomainState, + -- The aAssociation is not included + accessControl + [5] IMPLICIT Access-Control-List-instance, + sharable [6] IMPLICIT BOOLEAN, + programInvocations + [7] IMPLICIT SEQUENCE OF + Program-Invocation-instance, + -- uploadsInProgress is not included, + namedVariables + [8] IMPLICIT SEQUENCE OF + Named-Variable-instance, + namedVariableLists + [9] IMPLICIT SEQUENCE OF + Named-Variable-List-instance, + namedTypes + [10] IMPLICIT SEQUENCE OF + Named-Type-instance, + eventConditions + [11] IMPLICIT SEQUENCE OF + Event-Condition-instance, + eventActions + [12] IMPLICIT SEQUENCE OF + Event-Action-instance, + eventEnrollments + [13] IMPLICIT SEQUENCE OF + Event-Enrollment-instance, + eventConditionLists + [14] IMPLICIT SEQUENCE OF + Event-Condition-List-instance}}} + +Program-Invocation-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {programInvocationState + [3] IMPLICIT ProgramInvocationState, + domains + [4] IMPLICIT SEQUENCE OF Domain-instance, + accessControl + [5] IMPLICIT SEQUENCE OF + Access-Control-List-instance, + reusable + [6] IMPLICIT BOOLEAN, + monitor + [7] IMPLICIT BOOLEAN, + -- The following three fields shall all be present if the value of + -- monitor is true. + -- If present, the &name field of each object instance + -- shall have a value equal to the + -- &name field of this instance of the PROGRAM-INVOCATION. + eventCondition + [8] IMPLICIT SEQUENCE OF + Event-Condition-instance + OPTIONAL, + eventAction + [9] IMPLICIT SEQUENCE OF + Event-Action-instance + OPTIONAL, + eventEnrollment + [10] IMPLICIT SEQUENCE OF + Event-Enrollment-instance + OPTIONAL, + executionArgument + [11] MMSString, + ..., + control + [12] IMPLICIT Control-State, + controlling-Program-Invocation + [13] IMPLICIT Program-Invocation-instance, + -- The following field shall be present + -- if and only if the value of the &control field is controlling. + controlled-Program-Invocations + [14] IMPLICIT SEQUENCE OF + Program-Invocation-instance + OPTIONAL}}} + +Unit-Control-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + domains + [4] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [5] IMPLICIT SEQUENCE OF + Program-Invocation-instance}}} + +Unnamed-Variable-instance ::= SEQUENCE { + address [0] Address, + accessControl [1] IMPLICIT Access-Control-List-instance, + typeDescription [2] TypeDescription} + +Named-Variable-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + typeDescription [4] TypeDescription, + address [5] Address OPTIONAL, + meaning + [6] IMPLICIT VisibleString OPTIONAL}}} + +Named-Variable-List-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + listOfVariables + [4] IMPLICIT SEQUENCE OF + Variable-List-Item-instance}}} + +Variable-List-Item-instance ::= SEQUENCE { + -- one and only one of the following two lines shall appear + unnamedItem [0] IMPLICIT Unnamed-Variable-instance OPTIONAL, + namedItem [1] IMPLICIT Named-Variable-instance OPTIONAL, + -- the following specification may be included + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL} + +Named-Type-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + typeDescription [4] TypeDescription, + meaning + [5] IMPLICIT VisibleString OPTIONAL}}} + +Data-Exchange-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + request + [4] IMPLICIT SEQUENCE OF TypeDescription, + response + [5] IMPLICIT SEQUENCE OF TypeDescription, + linked [6] IMPLICIT BOOLEAN, + -- The following attribute shall appear if an only if the value of &linked is true. + programInvocation + [7] IMPLICIT Program-Invocation-instance + OPTIONAL}}} + +Semaphore-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + class + [4] IMPLICIT ENUMERATED {token, pool}, + -- If the value of &class is token, the following field shall appear + numberOfTokens + [5] IMPLICIT INTEGER OPTIONAL, + -- If the value of &class is pool, the following field shall appear + namedTokens + [6] IMPLICIT SEQUENCE OF VisibleString + OPTIONAL, + eventCondition + [7] IMPLICIT Event-Condition-instance}}} + +Operator-Station-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + stationType + [4] IMPLICIT ENUMERATED {entry, + display, + entry-display}}}} + +Event-Condition-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + ecClass + [4] IMPLICIT EC-Class, + ecState + [5] IMPLICIT EC-State, + priority + [6] IMPLICIT Priority, + severity + [7] IMPLICIT Severity, + eventEnrollments + [8] IMPLICIT SEQUENCE OF + Event-Enrollment-instance, + -- The following fields shall be present + -- if and only if the value of &ecClass is monitored. + enabled + [9] IMPLICIT BOOLEAN OPTIONAL, + alarmSummaryReports + [10] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable + CHOICE {named + [11] IMPLICIT Named-Variable-instance, + unnamed + [12] IMPLICIT Unnamed-Variable-instance, + unspecified [13] IMPLICIT NULL} + OPTIONAL, + evaluationInterval + [14] IMPLICIT INTEGER OPTIONAL, + ..., + displayEnhancement + CHOICE {text [15] MMSString, + number [16] IMPLICIT INTEGER, + none [17] IMPLICIT NULL}, + group-Priority-Override + CHOICE {priority + [18] IMPLICIT Priority, + undefined [19] IMPLICIT NULL} + OPTIONAL, + referencingEventConditionLists + [20] IMPLICIT SEQUENCE OF + Event-Condition-List-instance}}} + +Event-Action-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + confirmedServiceRequest + [4] ConfirmedServiceRequest, + modifiers + [5] IMPLICIT SEQUENCE OF Modifier, + eventEnrollments + [6] IMPLICIT SEQUENCE OF + Event-Enrollment-instance}}} + +Event-Enrollment-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + eeClass + [4] IMPLICIT EE-Class, + eventCondition + [5] IMPLICIT Event-Condition-instance, + ecTransitions + [6] IMPLICIT Transitions, + -- The following parameter is present if and only if the + -- value of &eeClass is modifier. + remainingDelay + CHOICE {time [7] IMPLICIT INTEGER, + forever [8] IMPLICIT NULL} + OPTIONAL, + -- The remaining parameters are present if and only if the + -- value of &eeClass is notification. + eventAction + [9] IMPLICIT Event-Action-instance + OPTIONAL, + duration + [10] IMPLICIT EE-Duration OPTIONAL, + clientApplication + [11] IMPLICIT ApplicationReference + OPTIONAL, + aaRule + [12] IMPLICIT AlarmAckRule OPTIONAL, + ..., + displayEnhancement + CHOICE {text [13] MMSString, + number [14] IMPLICIT INTEGER, + none [15] IMPLICIT NULL}}}} + +Event-Condition-List-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + eventConditions + [4] IMPLICIT SEQUENCE OF + Event-Condition-instance, + eventConditionLists + [5] IMPLICIT SEQUENCE OF + Event-Condition-List-instance, + referencingEventConditionLists + [6] IMPLICIT SEQUENCE OF + Event-Condition-List-instance}}} + +Journal-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + entries + [4] IMPLICIT SEQUENCE OF + Journal-Entry-instance}}} + +Journal-Entry-instance ::= SEQUENCE { + journal [0] IMPLICIT Journal-instance, + entry [1] IMPLICIT OCTET STRING, + clientApplication [2] IMPLICIT ApplicationReference, + timeStamp [3] IMPLICIT TimeOfDay, + orderOfReceipt [4] IMPLICIT INTEGER, + informationType [5] IMPLICIT ENUMERATED {annotation, event-data, data}, + -- The following attribute shall appear if and only if the + -- value of &informationType is annotation. + textComment [6] MMS255String OPTIONAL, + --The following attribute shall appear if and only if the + -- value of &informationType is event-data. + eventTransitionRecord + [7] IMPLICIT SEQUENCE {name [8] ObjectName, + currentState [9] IMPLICIT EC-State} OPTIONAL, + -- The following attribute shall appear if and only if the + -- value of &informationType is data or event-data. + journalVariables + [10] IMPLICIT SEQUENCE OF + SEQUENCE {variableTag [11] MMS255String, + valueSpecification [12] Data} OPTIONAL} + +Service-and-Parameter-CBBs ::= SEQUENCE { + services-Client [0] IMPLICIT ServiceSupportOptions, + services-Server [1] IMPLICIT ServiceSupportOptions, + parameters [2] IMPLICIT ParameterSupportOptions, + nest [3] IMPLICIT INTEGER, + extendedServices-Client [4] IMPLICIT AdditionalSupportOptions, + extendedServices-Server [5] IMPLICIT AdditionalSupportOptions, + extendedParameters [6] IMPLICIT AdditionalCBBOptions, + generalManagement [7] IMPLICIT GeneralManagementParameters, + vMDSupport [8] IMPLICIT VMDSupportParameters, + domainManagement [9] IMPLICIT DomainManagementParameters, + programInvocation [10] IMPLICIT ProgramInvocationManagementParameters, + variableAccess [11] IMPLICIT VariableAccessParameters, + dataParameters [12] IMPLICIT DataParameters, + semaphoreManagement [13] IMPLICIT SemaphoreManagementParameters, + operatorCommunication [14] IMPLICIT OperatorCommunicationParameters, + errors [15] IMPLICIT ErrorParameters, + fileManagement [16] IMPLICIT FileManagementParameters} + +GeneralManagementParameters ::= SEQUENCE { + localDetail [0] MMSString, + supportForTime + [1] IMPLICIT SEQUENCE {timeOfDay [2] IMPLICIT BOOLEAN, + timeSequence [3] IMPLICIT BOOLEAN}, + granularityOfTime [4] IMPLICIT INTEGER} + +VMDSupportParameters ::= SEQUENCE { + localDetail [0] MMSString, + extendedDerivation [1] MMSString + -- method used to perform extended derivation--} + +DomainManagementParameters ::= SEQUENCE { + loadDataOctet [0] MMSString, + -- description of the format of Load Data if the octet string form is used + loadDataSyntax [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + -- identifier of the Abstract Syntaxes used + maxUploads [2] IMPLICIT INTEGER} + +ProgramInvocationManagementParameters ::= SEQUENCE { + executionArgMaxSize [0] IMPLICIT INTEGER, + executionArgParseRules [1] MMSString, + executionArgSyntaxes [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + programLoction [3] MMSString, + -- syntax of the program Location notation + stepMode [4] IMPLICIT BOOLEAN + -- if true, step Mode is supported--} + +VariableAccessParameters ::= SEQUENCE { + uninterruptibleAccess [0] MMSString, + -- conditions under which it is guaranteed + singleMode [1] IMPLICIT BOOLEAN, + unnamedMode [2] IMPLICIT BOOLEAN} + +DataParameters ::= SEQUENCE { + bit-string [0] IMPLICIT INTEGER OPTIONAL, + integer [1] IMPLICIT INTEGER OPTIONAL, + unsigned [2] IMPLICIT INTEGER OPTIONAL, + floating-point + [3] IMPLICIT SEQUENCE {total [4] IMPLICIT INTEGER, + exponent [5] IMPLICIT INTEGER} OPTIONAL, + octet-string [10] IMPLICIT INTEGER OPTIONAL, + visible-string [11] IMPLICIT INTEGER OPTIONAL, + binary-time [12] IMPLICIT BOOLEAN OPTIONAL, + bcd [13] IMPLICIT INTEGER OPTIONAL, + mmsString [14] IMPLICIT INTEGER OPTIONAL} + +SemaphoreManagementParameters ::= SEQUENCE { + algorithm [0] IMPLICIT MMSString + -- method of processing the &priority field--} + +OperatorCommunicationParameters ::= SEQUENCE { + input-time-out [0] IMPLICIT INTEGER} + +ErrorParameters ::= SEQUENCE { + additionalCode [0] MMSString, + additionalDetial + [1] IMPLICIT SEQUENCE {size [2] IMPLICIT INTEGER, + syntax [3] MMSString}} + +FileManagementParameters ::= SEQUENCE {fileName [0] MMSString} + +END + + + +ISO-9506-MMS-1A {iso standard 9506 part(2) mms-annex-version1(3)} DEFINITIONS +::= +BEGIN + +EXPORTS + ObtainFile-Request, ObtainFile-Response, ObtainFile-Error, FileOpen-Request, + FileOpen-Response, FileRead-Request, FileRead-Response, FileClose-Request, + FileClose-Response, FileRename-Request, FileRename-Response, + FileRename-Error, FileDelete-Request, FileDelete-Response, + FileDirectory-Request, FileDirectory-Response, ScatteredAccessDescription, + DefineScatteredAccess-Request, DefineScatteredAccess-Response, + GetScatteredAccessAttributes-Request, GetScatteredAccessAttributes-Response; + +IMPORTS + FileName, ObjectName, AlternateAccess, VariableSpecification, Identifier, + Integer32, Unsigned32 + FROM ISO-9506-MMS-1 {iso standard 9506 part(2) + mms-abstract-syntax-version1(1)} + ApplicationReference + FROM MMS-Environment-1 {iso standard 9506 part(2) + mms-environment-version1(4)}; + +ObtainFile-Request ::= SEQUENCE { + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName} + +ObtainFile-Response ::= NULL + +ObtainFile-Error ::= INTEGER {source-file(0), destination-file(1)}(0..1) + +FileOpen-Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32} + +FileOpen-Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes} + +FileRead-Request ::= Integer32 -- FRSM ID + +FileRead-Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +FileClose-Request ::= Integer32 -- FRSM ID + +FileClose-Response ::= NULL + +FileRename-Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName} + +FileRename-Response ::= NULL + +FileRename-Error ::= INTEGER {source-file(0), destination-file(1)}(0..1) + +FileDelete-Request ::= FileName + +FileDelete-Response ::= NULL + +FileDirectory-Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL} + +FileDirectory-Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +DirectoryEntry ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes} + +FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, -- in octets + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL} + +ScatteredAccessDescription ::= + SEQUENCE OF + SEQUENCE {componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification, + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL} + +DefineScatteredAccess-Request ::= SEQUENCE { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription} + +DefineScatteredAccess-Response ::= NULL + +GetScatteredAccessAttributes-Request ::= ObjectName -- ScatteredAccessName + +GetScatteredAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription, + accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +END + + + +-- this part are the ACSE definitions (outside of MMS) +ACSE-1 {joint-iso-itu-t association-control(2) modules(0) apdus(0) version1(1)} +DEFINITIONS ::= +BEGIN + +EXPORTS + AP-title, AP-invocation-identifier, AE-qualifier, AE-invocation-identifier, + Authentication-value; + +AP-title ::= NULL + +AP-invocation-identifier ::= NULL + +AE-qualifier ::= NULL + +AE-invocation-identifier ::= NULL + +Authentication-value ::= NULL + +END \ No newline at end of file diff --git a/asn1/mms/more-asn1-files/mms-ioserver.asn b/asn1/mms/more-asn1-files/mms-ioserver.asn new file mode 100644 index 0000000..2fccbf4 --- /dev/null +++ b/asn1/mms/more-asn1-files/mms-ioserver.asn @@ -0,0 +1,1920 @@ +--Quelle: http://www.ioserver.com/mms.asn +---Corrections made December 15, 1994--- + +MMS { iso(1) standard(0) 9506(2) part(1) mms-general-module-version(1) } + +DEFINITIONS ::= + +BEGIN + +EXPORTS MMSpdu; + +IMPORTS + AP_title, + AP_invocation_identifier, + AE_qualifier, + AE_invocation_identifier +FROM ISO-8650-ACSE-1; + +MMSpdu ::= CHOICE { + confirmed_RequestPDU [0] IMPLICIT Confirmed_RequestPDU, + confirmed_ResponsePDU [1] IMPLICIT Confirmed_ResponsePDU, + confirmed_ErrorPDU [2] IMPLICIT Confirmed_ErrorPDU, + unconfirmed_PDU [3] IMPLICIT Unconfirmed_PDU, + rejectPDU [4] IMPLICIT RejectPDU, + cancel_RequestPDU [5] IMPLICIT Cancel_RequestPDU, + cancel_ResponsePDU [6] IMPLICIT Cancel_ResponsePDU, + cancel_ErrorPDU [7] IMPLICIT Cancel_ErrorPDU, + initiate_RequestPDU [8] IMPLICIT Initiate_RequestPDU, + initiate_ResponsePDU [9] IMPLICIT Initiate_ResponsePDU, + initiate_ErrorPDU [10] IMPLICIT Initiate_ErrorPDU, + conclude_RequestPDU [11] IMPLICIT Conclude_RequestPDU, + conclude_ResponsePDU [12] IMPLICIT Conclude_ResponsePDU, + conclude_ErrorPDU [13] IMPLICIT Conclude_ErrorPDU +} + +Confirmed_RequestPDU ::= SEQUENCE { + invokeID Unsigned32, + listOfModifier SEQUENCE OF Modifier OPTIONAL, + ConfirmedServiceRequest, + [79] Request_Detail OPTIONAL +} + +Unconfirmed_PDU ::= SEQUENCE { + UnconfirmedService, + [79] Request_Detail OPTIONAL +} + +Confirmed_ResponsePDU ::= SEQUENCE { + invokeID Unsigned32, + ConfirmedServiceResponse, + [79] Request_Detail OPTIONAL +} + +Confirmed_ErrorPDU ::= SEQUENCE { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError +} + +UnconfirmedService ::= CHOICE { + informationReport [0] IMPLICIT InformationReport, + unsolicitedStatus [1] IMPLICIT UnsolicitedStatus, + eventNotification [2] IMPLICIT EventNotification, + additionalService [3] AdditionalUnconfirmedService +} + +Modifier ::= CHOICE { + attach_To_Event_Condition [0] IMPLICIT AttachToEventCondition, + attach_To_Semaphore [1] IMPLICIT AttachToSemaphore +} + +ConfirmedServiceRequest ::= CHOICE { + status [0] IMPLICIT Status_Request, + getNameList [1] IMPLICIT GetNameList_Request, + identify [2] IMPLICIT Identify_Request, + rename [3] IMPLICIT Rename_Request, + read [4] IMPLICIT Read_Request, + write [5] IMPLICIT Write_Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes_Request, + defineNamedVariable [7] IMPLICIT DefineNamedVariable_Request, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess_Request, + getScatteredAccessAttributes [9] GetScatteredAccessAttributes_Request, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess_Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList_Request, + getNamedVariableListAttributes [12] GetNamedVariableListAttributes_Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList_Request, + defineNamedType [14] IMPLICIT DefineNamedType_Request, + getNamedTypeAttributes [15] GetNamedTypeAttributes_Request, + deleteNamedType [16] IMPLICIT DeleteNamedType_Request, + input [17] IMPLICIT Input_Request, + output [18] IMPLICIT Output_Request, + takeControl [19] IMPLICIT TakeControl_Request, + relinquishControl [20] IMPLICIT RelinquishControl_Request, + defineSemaphore [21] IMPLICIT DefineSemaphore_Request, + deleteSemaphore [22] DeleteSemaphore_Request, + reportSemaphoreStatus [23] ReportSemaphoreStatus_Request, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus_Request, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus_Request, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence_Request, + downloadSegment [27] IMPLICIT DownloadSegment_Request, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence_Request, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence_Request, + uploadSegment [30] IMPLICIT UploadSegment_Request, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence_Request, + requestDomainDownload [32] IMPLICIT RequestDomainDownload_Request, + requestDomainUpload [33] IMPLICIT RequestDomainUpload_Request, + loadDomainContent [34] IMPLICIT LoadDomainContent_Request, + storeDomainContent [35] IMPLICIT StoreDomainContent_Request, + deleteDomain [36] IMPLICIT DeleteDomain_Request, + getDomainAttributes [37] IMPLICIT GetDomainAttributes_Request, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Request, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation_Request, + start [40] IMPLICIT Start_Request, + stop [41] IMPLICIT Stop_Request, + resume [42] IMPLICIT Resume_Request, + reset [43] IMPLICIT Reset_Request, + kill [44] IMPLICIT Kill_Request, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes_Request, + obtainFile [46] IMPLICIT ObtainFile_Request, + defineEventCondition [47] IMPLICIT DefineEventCondition_Request, + deleteEventCondition [48] DeleteEventCondition_Request, + getEventConditionAttributes [49] GetEventConditionAttributes_Request, + reportEventConditionStatus [50] ReportEventConditionStatus_Request, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Request, + triggerEvent [52] IMPLICIT TriggerEvent_Request, + defineEventAction [53] IMPLICIT DefineEventAction_Request, + deleteEventAction [54] DeleteEventAction_Request, + getEventActionAttributes [55] GetEventActionAttributes_Request, + reportEventActionStatus [56] ReportEventActionStatus_Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Request, + deleteEventEnrollment [58] DeleteEventEnrollment_Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Request, + reportEventEnrollmentStatus [60] ReportEventEnrollmentStatus_Request, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes_Request, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification_Request, + getAlarmSummary [63] IMPLICIT GetAlarmSummary_Request, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary_Request, + readJournal [65] IMPLICIT ReadJournal_Request, + writeJournal [66] IMPLICIT WriteJournal_Request, + initializeJournal [67] IMPLICIT InitializeJournal_Request, + reportJournalStatus [68] ReportJournalStatus_Request, + createJournal [69] IMPLICIT CreateJournal_Request, + deleteJournal [70] IMPLICIT DeleteJournal_Request, + getCapabilityList [71] IMPLICIT GetCapabilityList_Request, + fileOpen [72] IMPLICIT FileOpen_Request, + fileRead [73] IMPLICIT FileRead_Request, + fileClose [74] IMPLICIT FileClose_Request, + fileRename [75] IMPLICIT FileRename_Request, + fileDelete [76] IMPLICIT FileDelete_Request, + fileDirectory [77] IMPLICIT FileDirectory_Request, + additionalService [78] AdditionalService_Request +} + +Request_Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceRequest does not match any of the tags below + otherRequests NULL, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Request, + start [40] IMPLICIT Start_Request, + resume [42] IMPLICIT Resume_Request, + defineEventCondition [47] IMPLICIT DefineEventCondition_Request, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Request +} + +ConfirmedServiceResponse ::= CHOICE { + status [0] IMPLICIT Status_Response, + getNameList [1] IMPLICIT GetNameList_Response, + identify [2] IMPLICIT Identify_Response, + rename [3] IMPLICIT Rename_Response, + read [4] IMPLICIT Read_Response, + write [5] IMPLICIT Write_Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes_Response, + defineNamedVariable [7] IMPLICIT DefineNamedVariable_Response, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess_Response, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes_Response, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess_Response, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList_Response, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes_Response, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList_Response, + defineNamedType [14] IMPLICIT DefineNamedType_Response, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes_Response, + deleteNamedType [16] IMPLICIT DeleteNamedType_Response, + input [17] IMPLICIT Input_Response, + output [18] IMPLICIT Output_Response, + takeControl [19] TakeControl_Response, + relinquishControl [20] IMPLICIT RelinquishControl_Response, + defineSemaphore [21] IMPLICIT DefineSemaphore_Response, + deleteSemaphore [22] IMPLICIT DeleteSemaphore_Response, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus_Response, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus_Response, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus_Response, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence_Response, + downloadSegment [27] IMPLICIT DownloadSegment_Response, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence_Response, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence_Response, + uploadSegment [30] IMPLICIT UploadSegment_Response, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence_Response, + requestDomainDownLoad [32] IMPLICIT RequestDomainDownload_Response, + requestDomainUpload [33] IMPLICIT RequestDomainUpload_Response, + loadDomainContent [34] IMPLICIT LoadDomainContent_Response, + storeDomainContent [35] IMPLICIT StoreDomainContent_Response, + deleteDomain [36] IMPLICIT DeleteDomain_Response, + getDomainAttributes [37] IMPLICIT GetDomainAttributes_Response, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Response, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation_Response, + start [40] IMPLICIT Start_Response, + stop [41] IMPLICIT Stop_Response, + resume [42] IMPLICIT Resume_Response, + reset [43] IMPLICIT Reset_Response, + kill [44] IMPLICIT Kill_Response, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes_Response, + obtainFile [46] IMPLICIT ObtainFile_Response, + fileOpen [72] IMPLICIT FileOpen_Response, + defineEventCondition [47] IMPLICIT DefineEventCondition_Response, + deleteEventCondition [48] IMPLICIT DeleteEventCondition_Response, + getEventConditionAttributes [49] IMPLICIT GetEventConditionAttributes_Response, + reportEventConditionStatus [50] IMPLICIT ReportEventConditionStatus_Response, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Response, + triggerEvent [52] IMPLICIT TriggerEvent_Response, + defineEventAction [53] IMPLICIT DefineEventAction_Response, + deleteEventAction [54] IMPLICIT DeleteEventAction_Response, + getEventActionAttributes [55] IMPLICIT GetEventActionAttributes_Response, + reportActionStatus [56] IMPLICIT ReportEventActionStatus_Response, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Response, + deleteEventEnrollment [58] IMPLICIT DeleteEventEnrollment_Response, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Response, + reportEventEnrollmentStatus [60] IMPLICIT ReportEventEnrollmentStatus_Response, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes_Response, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification_Response, + getAlarmSummary [63] IMPLICIT GetAlarmSummary_Response, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary_Response, + readJournal [65] IMPLICIT ReadJournal_Response, + writeJournal [66] IMPLICIT WriteJournal_Response, + initializeJournal [67] IMPLICIT InitializeJournal_Response, + reportJournalStatus [68] IMPLICIT ReportJournalStatus_Response, + createJournal [69] IMPLICIT CreateJournal_Response, + deleteJournal [70] IMPLICIT DeleteJournal_Response, + getCapabilityList [71] IMPLICIT GetCapabilityList_Response, + fileRead [73] IMPLICIT FileRead_Response, + fileClose [74] IMPLICIT FileClose_Response, + fileRename [75] IMPLICIT FileRename_Response, + fileDelete [76] IMPLICIT FileDelete_Response, + fileDirectory [77] IMPLICIT FileDirectory_Response, + additionalService [78] AdditionalService_Response +} + +--********************************** COMMON MMS TYPES *********************************** + +FileName ::= SEQUENCE OF GraphicString + +---TimeOfDay ::= OCTET STRING -- (SIZE (4 | 6)) + +Identifier ::= VisibleString + +Integer8 ::= INTEGER +Integer16 ::= INTEGER +Integer32 ::= INTEGER + +Unsigned8 ::= INTEGER +Unsigned16 ::= INTEGER +Unsigned32 ::= INTEGER + +ObjectName ::= CHOICE { + vmd_specific [0] IMPLICIT Identifier, + domain_specific [1] IMPLICIT SEQUENCE { + domainId Identifier, + itemId Identifier + }, + aa_specific [2] IMPLICIT Identifier +} + +ApplicationReference ::= SEQUENCE { + ap_title [0] ISO-8650-ACSE-1.AP_title OPTIONAL, + ap_invocation_id [1] ISO-8650-ACSE-1.AP_invocation_identifier OPTIONAL, + ae_qualifier [2] ISO-8650-ACSE-1.AE_qualifie OPTIONAL, + ae_invocation_id [3] ISO-8650-ACSE-1.AE_invocation_identifier OPTIONAL +} + +Priority ::= Unsigned8 + +normalPriority ::= 64 + +-- ************************************ GENERAL ************************************* + +Initiate_ErrorPDU ::= ServiceError + +Initiate_RequestPDU ::= SEQUENCE { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitRequestDetail [4] IMPLICIT InitRequestDetail +} + +InitRequestDetail ::= SEQUENCE { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions +} + +Initiate_ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitResponseDetail [4] IMPLICIT InitResponseDetail +} + +InitResponseDetail ::= SEQUENCE { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions +} + +ParameterSupportOptions ::= BIT STRING { + str1 (0), + str2 (1), + vnam (2), + valt (3), + vadr (4), + vsca (5), + tpy (6), + vlis (7), + real (8), + cei (10) +} + +ServiceSupportOptions ::= BIT STRING { + status (0), + getNameList (1), + identify (2), + rename (3), + read (4), + write (5), + getVariableAccessAttributes (6), + defineNamedVariable (7), + defineScatteredAccess (8), + getScatteredAccessAttributes (9), + deleteVariableAccess (10), + defineNamedVariableList (11), + getNamedVariableListAttributes (12), + deleteNamedVariableList (13), + defineNamedType (14), + getNamedTypeAttributes (15), + deleteNamedType (16), + input (17), + output (18), + takeControl (19), + relinquishControl (20), + defineSemaphore (21), + deleteSemaphore (22), + reportSemaphoreStatus (23), + reportPoolSemaphoreStatus (24), + reportSemaphoreEntryStatus (25), + initiateDownloadSequence (26), + downloadSegment (27), + terminateDownloadSequence (28), + initiateUploadSequence (29), + uploadSegment (30), + terminateUploadSequence (31), + requestDomainDownload (32), + requestDomainUpload (33), + loadDomainContent (34), + storeDomainContent (35), + deleteDomain (36), + getDomainAttributes (37), + createProgramInvocation (38), + deleteProgramInvocation (39), + start (40), + stop (41), + resume (42), + reset (43), + kill (44), + getProgramInvocationAttributes (45), + obtainFile (46), + defineEventCondition (47), + deleteEventCondition (48), + getEventConditionAttributes (49), + reportEventConditionStatus (50), + alterEventConditionMonitoring (51), + triggerEvent (52), + defineEventAction (53), + deleteEventAction (54), + getEventActionAttributes (55), + reportActionStatus (56), + defineEventEnrollment (57), + deleteEventEnrollment (58), + alterEventEnrollment (59), + reportEventEnrollmentStatus (60), + getEventEnrollmentAttributes (61), + acknowledgeEventNotification (62), + getAlarmSummary (63), + getAlarmEnrollmentSummary (64), + readJournal (65), + writeJournal (66), + initializeJournal (67), + reportJournalStatus (68), + createJournal (69), + deleteJournal (70), + getCapabilityList (71), + fileOpen (72), + fileRead (73), + fileClose (74), + fileRename (75), + fileDelete (76), + fileDirectory (77), + unsolicitedStatus (78), + informationReport (79), + eventNotification (80), + attachToEventCondition (81), + attachToSemaphore (82), + conclude (83), + cancel (84) +} + +---------------------------------- CONCLUDE -------------------------------- + +Conclude_RequestPDU ::= NULL + +Conclude_ResponsePDU ::= NULL + +Conclude_ErrorPDU ::= ServiceError + +---------------------------------- CANCEL -------------------------------- + +Cancel_RequestPDU ::= Unsigned32 -- originalInvokeID + +Cancel_ResponsePDU ::= Unsigned32 -- originalInvokeID + +Cancel_ErrorPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError +} + +------------------------------ Service_Error -------------------------------- + +ServiceError ::= SEQUENCE { + errorClass [0] CHOICE { + vmd_state [0] IMPLICIT INTEGER { + other (0), + vmd_state_conflict (1), + vmd_operational_problem (2), + domain_transfer_problem (3), + state_machine_id_invalid (4) + }, + application_reference [1] IMPLICIT INTEGER { + other (0), + aplication_unreachable (1), + connection_lost (2), + application_reference_invalid (3), + context_unsupported (4) + }, + definition [2] IMPLICIT INTEGER { + other (0), + object_undefined (1), + invalid_address (2), + type_unsupported (3), + type_inconsistent (4), + object_exists (5), + object_attribute_inconsistent (6) + }, + resource [3] IMPLICIT INTEGER { + other (0), + memory_unavailable (1), + processor_resource_unavailable (2), + mass_storage_unavailable (3), + capability_unavailable (4), + capability_unknown (5) + }, + service [4] IMPLICIT INTEGER { + other (0), + primitives_out_of_sequence (1), + object_sate_conflict (2), + pdu_size (3), + continuation_invalid (4), + object_constraint_conflict (5) + }, + service_preempt [5] IMPLICIT INTEGER { + other (0), + timeout (1), + deadlock (2), + cancel (3) + }, + time_resolution [6] IMPLICIT INTEGER { + other (0), + unsupportable_time_resolution (1) + }, + access [7] IMPLICIT INTEGER { + other (0), + object_access_unsupported (1), + object_non_existent (2), + object_access_denied (3), + object_invalidated (4) + }, + initiate [8] IMPLICIT INTEGER { + other (0), + version_incompatible (1), + max_segment_insufficient (2), + max_services_outstanding_calling_insufficient (3), + max_services_outstanding_called_insufficient (4), + service_CBB_insufficient (5), + parameter_CBB_insufficient (6), + nesting_level_insufficient (7) + }, + conclude [9] IMPLICIT INTEGER { + other (0), + further_communication_required (1) + }, + cancel [10] IMPLICIT INTEGER { + other (0), + invoke_id_unknown (1), + cancel_not_possible (2) + }, + file [11] IMPLICIT INTEGER { + other (0), + filename_ambiguous (1), + file_busy (2), + filename_syntax_error (3), + content_type_invalid (4), + position_invalid (5), + file_access_denied (6), + file_non_existent (7), + duplicate_filename (8), + insufficient_space_in_filestore (9) + }, + others [12] IMPLICIT INTEGER + }, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInformation [3] CHOICE { + obtainFile [0] IMPLICIT ObtainFile_Error, + start [1] IMPLICIT Start_Error, + stop [2] IMPLICIT Stop_Error, + resume [3] IMPLICIT Resume_Error, + reset [4] IMPLICIT Reset_Error, + deleteVariableAccess [5] IMPLICIT DeleteVariableAccess_Error, + deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList_Error, + deleteNamedType [7] IMPLICIT DeleteNamedType_Error, + defineEventEnrollment_Error [8] DefineEventEnrollment_Error, + fileRename [9] IMPLICIT FileRename_Error, + additionalService [10] AdditionalServiceError + } OPTIONAL +} + +---------------------------------- REJECT -------------------------------- + +RejectPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE { + confirmed_RequestPDU [1] IMPLICIT INTEGER { + other (0), + unrecognized_service (1), + unrecognized_modifier (2), + invalid_invokeID (3), + invalid_argument (4), + invalid_modifier (5), + max_serv_outstanding_exceeded (6), + max_recursion_exceeded (8), + value_out_of_range (9) + }, + + confirmed_responsePDU [2] IMPLICIT INTEGER { + other (0), + unrecognized_service (1), + invalid_invokeID (2), + invalid_result (3), + max_recursion_exceeded (5), + value_out_of_range (6) + }, + + confirmed_errorPDU [3] IMPLICIT INTEGER { + other (0), + unrecognized_service (1), + invalid_invokeID (2), + invalid_serviceError (3), + value_out_of_range (4) + }, + + unconfirmedPDU [4] IMPLICIT INTEGER { + other (0), + unrecognized_service (1), + invalid_argument (2), + max_recursion_exceeded (3), + value_out_of_range (4) + }, + + pdu_error [5] IMPLICIT INTEGER { + unknown_pdu_type (0), + invalid_pdu (1), + illegal_acse_mapping (2) + }, + + cancel_RequestPDU [6] IMPLICIT INTEGER { + other (0), + invalid_invokeID (1) + }, + + cancel_responsePDU [7] IMPLICIT INTEGER { + other (0), + invalid_invokeID (1) + }, + + cancel_errorPDU [8] IMPLICIT INTEGER { + other (0), + invalid_invokeID (1), + invalid_serviceError (2), + value_out_of_range (3) + }, + + conclude_RequestPDU [9] IMPLICIT INTEGER { + other (0), + invalid_argument (1) + }, + + conclude_responsePDU [10] IMPLICIT INTEGER { + other (0), + invalid_result (1) + }, + + conclude_errorPDU [11] IMPLICIT INTEGER { + other (0), + invalid_serviceError (1), + value_out_of_range (2) + } + } +} + +-- *************************************** VMD ******************************************** + +Status_Request ::= BOOLEAN + +Status_Response ::= SEQUENCE { + vmdLogicalStatus [0] IMPLICIT INTEGER { + state_changes_allowed (0), + no_state_changes_allowed (1), + limited_services_allowed (2), + support_services_allowed (3) + }, + vmdPhysicalStatus [1] IMPLICIT INTEGER { + operational (0), + partially_operational (1), + inoperable (2), + needs_commissioning (3) + }, + localDetail [2] IMPLICIT BIT STRING(SIZE(0..128)) OPTIONAL +} + +------------------------------- UNSOLICITEDSTATUS -------------------------------- + +UnsolicitedStatus ::= Status_Response + +--------------------------------- GETNAMELIST -------------------------------- + +GetNameList_Request ::= SEQUENCE { + extendedObjectClass [0] CHOICE { + objectClass [0] IMPLICIT INTEGER { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + }, + objectScope [1] CHOICE { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL +} + +GetNameList_Response ::= SEQUENCE { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +---------------------------------- IDENTIFY -------------------------------- + +Identify_Request ::= NULL + +Identify_Response ::= SEQUENCE { + vendorName [0] IMPLICIT VisibleString, + modelName [1] IMPLICIT VisibleString, + revision [2] IMPLICIT VisibleString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL +} + +---------------------------------- RENAME -------------------------------- + +Rename_Request ::= SEQUENCE { + extendedObjectClass [0] CHOICE { + objectClass [0] IMPLICIT INTEGER { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + }, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier +} + +Rename_Response ::= NULL + +---------------------------------- GET CAPABILITY LIST -------------------------------- + +GetCapabilityList_Request ::= SEQUENCE { + continueAfter VisibleString OPTIONAL +} + +GetCapabilityList_Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +-- ************************************* DOMAIN **************************************** + +InitiateDownloadSequence_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString, + sharable [2] IMPLICIT BOOLEAN +} + +InitiateDownloadSequence_Response ::= NULL + +---------------------------------- DOWNLOAD SEGMENT ----------------------------------- + +DownloadSegment_Request ::= Identifier + +DownloadSegment_Response ::= SEQUENCE { + loadData CHOICE { + non_coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +-------------------------------- TERMINATE DOWNLOAD ----------------------------------- + +TerminateDownloadSequence_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL +} + +TerminateDownloadSequence_Response ::= NULL + +-------------------------------- INITIATE UPLOAD ----------------------------------- + +InitiateUploadSequence_Request ::= Identifier -- Domain Name + +InitiateUploadSequence_Response ::= SEQUENCE { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString +} + +---------------------------------- UPLOAD SEGMENT ----------------------------------- + +UploadSegment_Request ::= Integer32 -- ULSM Identifier + +UploadSegment_Response ::= SEQUENCE { + loadData CHOICE { + non_coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +-------------------------------- TERMINATE UPLOAD ----------------------------------- + +TerminateUploadSequence_Request ::= Integer32 -- ULSM Identifer + +TerminateUploadSequence_Response ::= NULL + +----------------------------- REQUEST DOMAIN DOWNLOAD ----------------------------------- + +RequestDomainDownload_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName +} + +RequestDomainDownload_Response ::= NULL + +----------------------------- REQUEST DOMAIN UPLOAD ----------------------------------- + +RequestDomainUpload_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName +} + +RequestDomainUpload_Response ::= NULL + +----------------------------- LOAD DOMAIN CONTENT ----------------------------------- + +LoadDomainContent_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName, + thirdParty [5] IMPLICIT ApplicationReference OPTIONAL +} + +LoadDomainContent_Response ::= NULL + +----------------------------- STORE DOMAIN CONTENT ----------------------------------- + +StoreDomainContent_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + filenName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL +} + +StoreDomainContent_Response ::= NULL + +----------------------------- DELETE DOMAIN ----------------------------------- + +DeleteDomain_Request ::= Identifier -- Domain Name + +DeleteDomain_Response ::= NULL + +----------------------------- GET DOMAIN ATTRIBUTES ----------------------------------- + +GetDomainAttributes_Request ::= Identifier -- Domain Name + +GetDomainAttributes_Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, -- PI Names + uploadInProgress [5] IMPLICIT Integer8 +} + +DomainState ::= INTEGER { + non_existent (0), + loading (1), + ready (2), + in_use (3), + complete (4), + incomplete (5), + d1 (7), + d2 (8), + d3 (9), + d4 (10), + d5 (11), + d6 (12), + d7 (13), + d8 (14), + d9 (15) +} + +-- ********************************* PROGRAM INVOCATION ********************************* + +----------------------CREATE PROGRAM INVOCATION --------------------- + +CreateProgramInvocation_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainName [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring + -- FALSE indicates CURRENT monitoring +} + +CreateProgramInvocation_Response ::= NULL + +----------------------DELETE PROGRAM INVOCATION --------------------- + +DeleteProgramInvocation_Request ::= Identifier -- Program Invocation Name + +DeleteProgramInvocation_Response ::= NULL + +----------------------------- START ------------------------------------ + +Start_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL +} + +Start_Response ::= NULL + +Start_Error ::= ProgramInvocationState + +----------------------------- STOP ------------------------------------ + +Stop_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier +} + +Stop_Response ::= NULL + +Stop_Error ::= ProgramInvocationState + +---------------------------- RESUME ------------------------------------ + +Resume_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL +} + +Resume_Response ::= NULL + +Resume_Error ::= ProgramInvocationState + +------------------------------ RESET ------------------------------------ + +Reset_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier +} + +Reset_Response ::= NULL + +Reset_Error ::= ProgramInvocationState + +------------------------------ KILL ------------------------------------ + +Kill_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier +} + +Kill_Response ::= NULL + +--------------------------- GET PI ATTRIBUTES ------------------------------------ + +GetProgramInvocationAttributes_Request ::= Identifier -- Program Invocation Name + +GetProgramInvocationAttributes_Response ::= SEQUENCE { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + startArgument [5] IMPLICIT VisibleString, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL +} + +ProgramInvocationState ::= INTEGER { + non_existent (0), + unrunable (1), + idle (2), + running (3), + stopped (4), + starting (5), + stopping (6), + resuming (7), + resetting (8) +} + -- Companion Standard may add additional values + +-- *********************************** VARIABLES **************************************** + +TypeSpecification ::= CHOICE { + typeName [0] ObjectName, + array [1] IMPLICIT SEQUENCE { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification + }, + structure [2] IMPLICIT SEQUENCE { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF SEQUENCE { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + }, + + -- Simple Type -------- Size --------- + boolean [3] IMPLICIT NULL, + bit_string [4] IMPLICIT Integer32, + integer [5] IMPLICIT Unsigned8, + unsigned [6] IMPLICIT Unsigned8, + floating_point [7] IMPLICIT SEQUENCE { + format_width Unsigned8, + exponent_width Unsigned8 + }, + real [8] IMPLICIT SEQUENCE { + base [0] IMPLICIT INTEGER (2|10), + exponent [1] IMPLICIT INTEGER OPTIONAL, + mantissa [2] IMPLICIT INTEGER OPTIONAL + }, + octet_string [9] IMPLICIT Integer32, + visible_string [10] IMPLICIT Integer32, + generalized_time [11] IMPLICIT NULL, + binary_time [12] IMPLICIT BOOLEAN, + bcd [13] IMPLICIT Unsigned8, + objId [15] IMPLICIT NULL +} + +AlternateAccess ::= SEQUENCE OF CHOICE { + unnamed AlternateAccessSelection, + named [5] IMPLICIT SEQUENCE { + componentName [0] IMPLICIT Identifier, + accesst AlternateAccessSelection + } +} + +AlternateAccessSelection ::= CHOICE { + selectAccess CHOICE { + component [1] IMPLICIT Identifier, + index [2] IMPLICIT Unsigned32, + indexRange [3] IMPLICIT SEQUENCE { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [4] IMPLICIT NULL -- all array elements + } +} + +-------------------------------- READ ------------------------------- + +Read_Request ::= SEQUENCE { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification +} + +Read_Response ::= SEQUENCE { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult +} + +-------------------------------- WRITE ------------------------------- + +Write_Request ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data + } + +Write_Response ::= SEQUENCE OF CHOICE { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL +} + +---------------------------- INFORMATION REPORT -------------------------------- + +InformationReport ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult +} + +------------------------- GET VARIABLE ACCESS ATTRIBUTES ------------------------ + +GetVariableAccessAttributes_Request ::= CHOICE { + name [0] ObjectName, + address [1] Address +} + +GetVariableAccessAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeSpecification [2] TypeSpecification +} +--------------------------- DEFINE NAMED VARIABLE -------------------------------- + +DefineNamedVariable_Request ::= SEQUENCE { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL +} + +DefineNamedVariable_Response ::= NULL + +-------------------------- DEFINE SCATTERED ACCESS ------------------------------- + +DefineScatteredAccess_Request ::= SEQUENCE { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription +} + +DefineScatteredAccess_Response ::= NULL + +------------------------- GET SCATTERED ACCESS ATTRIBUTES ------------------------ + +GetScatteredAccessAttributes_Request ::= ObjectName -- ScatteredAccessName + +GetScatteredAccessAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription +} + +----------------------------- DELETE VARIABLE ACCESS ------------------------------ + +DeleteVariableAccess_Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa_specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL +} + +DeleteVariableAccess_Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 +} + +DeleteVariableAccess_Error ::= Unsigned32 -- numberDeleted + +------------------------- DEFINE NAMED VAR. LIST ------------------------------- + +DefineNamedVariableList_Request ::= SEQUENCE { + variableListName ObjectName, + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } +} + +DefineNamedVariableList_Response ::= NULL + +------------------------- GET NAMED VAR. LIST ATTRIBUTES ------------------------ + +GetNamedVariableListAttributes_Request ::= ObjectName -- VariableListName + +GetNamedVariableListAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } +} + +------------------------- DELETE NAMED VAR. LIST ------------------------------- + +DeleteNamedVariableList_Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa_specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL +} + +DeleteNamedVariableList_Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 +} + +DeleteNamedVariableList_Error ::= Unsigned32 -- number Deleted + +------------------------- DEFINE NAMED TYPE ------------------------------- + +DefineNamedType_Request ::= SEQUENCE { + typeName ObjectName, + typeSpecification TypeSpecification +} + +DefineNamedType_Response ::= NULL + +------------------------- GET NAMED TYPE ATTRIB. ------------------------------- + +GetNamedTypeAttributes_Request ::= ObjectName -- TypeName + +GetNamedTypeAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification +} + +------------------------- DELETE NAMED TYPE ------------------------------- + +DeleteNamedType_Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa_specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL +} + +DeleteNamedType_Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 +} + +DeleteNamedType_Error ::= Unsigned32 -- number Deleted + +---------------------------- SUPPORT DEFINITIONS ---------------------------- + +AccessResult ::= CHOICE { + failure [0] IMPLICIT DataAccessError, + success Data +} + +DataAccessError ::= INTEGER { + object_invalidated (0), + hardware_fault (1), + temporarly_unavailable (2), + object_access_denied (3), + object_undefined (4), + invalid_address (5), + type_unsupported (6), + type_inconsistent (7), + object_attribute_inconsistent (8), + object_access_unsupported (9), + object_non_existent (10) +} + +Data ::= CHOICE { + -- context tag 0 is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit_string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, + floating_point [7] IMPLICIT FloatingPoint, + real [8] IMPLICIT REAL, + octet_string [9] IMPLICIT OCTET STRING, + visible_string [10] IMPLICIT VisibleString, + binary_time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, + booleanArray [14] IMPLICIT BIT STRING +} + +---FloatingPoint ::= OCTET STRING + +VariableAccessSpecification ::= CHOICE { + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + }, + variableListName [1] ObjectName +} + +ScatteredAccessDescription ::= SEQUENCE OF SEQUENCE { + componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification, + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL +} + +VariableSpecification ::= CHOICE { + name [0] ObjectName, + address [1] Address, + variableDescription [2] IMPLICIT SEQUENCE { + address Address, + typeSpecification TypeSpecification + }, + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, + invalidated [4] IMPLICIT NULL +} + +Address ::= CHOICE { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] IMPLICIT VisibleString, + unconstrainedAddress [2] IMPLICIT OCTET STRING +} + +-- ********************************* SEMAPHORES ***************************************** + +TakeControl_Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE, + applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL +} + +TakeControl_Response ::= CHOICE { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier +} + +-------------------------------- RELINQUISH CONTROL ----------------------------- + +RelinquishControl_Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL +} + +RelinquishControl_Response ::= NULL + +------------------------------- DEFINE SEMAPHORE -------------------------------- + +DefineSemaphore_Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + numbersOfTokens [1] IMPLICIT Unsigned16 +} + +DefineSemaphore_Response ::= NULL + +------------------------------- DELETE SEMAPHORE -------------------------------- + +DeleteSemaphore_Request ::= ObjectName -- Semaphore Name + +DeleteSemaphore_Response ::= NULL + +--------------------------- REPORT SEMAPHORE STATUS ----------------------------- + +ReportSemaphoreStatus_Request ::= ObjectName -- SemaphoreName + +ReportSemaphoreStatus_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER { + token (0), + pool (1) + }, + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16 +} + +--------------------------- REPORT POOL SEMAPHORE STATUS ----------------------------- + +ReportPoolSemaphoreStatus_Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL +} + +ReportPoolSemaphoreStatus_Response ::= SEQUENCE { + listOfNamedTokens [0] IMPLICIT SEQUENCE OF CHOICE { + freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +--------------------------- REPORT SEMAPHORE ENTRY STATUS ----------------------------- + +ReportSemaphoreEntryStatus_Request ::=SEQUENCE { + semaphoreName [0] ObjectName, + state [1] IMPLICIT INTEGER { + queued (0), + owner (1), + hung (2) + }, + entryIdToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL +} + +ReportSemaphoreEntryStatus_Response ::= SEQUENCE { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +AttachToSemaphore ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE +} + +SemaphoreEntry ::= SEQUENCE { + entryId [0] IMPLICIT OCTET STRING, + entryClass [1] IMPLICIT INTEGER { + simple (0), + modifier (1) + }, + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT 64, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE +} + +--******************************** OPERATOR COMMUNICATION ***************************** + +------------------------------------------ INPUT ------------------------------------ + +Input_Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, + listOfPromptData [2] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL +} + +Input_Response ::= VisibleString -- Input String + +--------------------------------------- OUTPUT ------------------------------------- + +Output_Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF VisibleString +} + +Output_Response ::= NULL + +-- ************************************ EVENTS ********************************************* + +DefineEventCondition_Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC_Class, + prio_rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL +} + +DefineEventCondition_Response ::= NULL + +DeleteEventCondition_Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa_specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL +} + +DeleteEventCondition_Response ::= Unsigned32 -- Candidates Not Deleted + +GetEventConditionAttributes_Request ::= ObjectName -- Event Condition Name + +GetEventConditionAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC_Class, + prio_rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable [6] CHOICE { + variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL + } OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL +} + +ReportEventConditionStatus_Request ::= ObjectName -- EventConditionName + +ReportEventConditionStatus_Response ::= SEQUENCE { + currentState [0] IMPLICIT EC_State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL +} + +AlterEventConditionMonitoring_Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL, + evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL +} + +AlterEventConditionMonitoring_Response ::= NULL + +TriggerEvent_Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL +} + +TriggerEvent_Response ::= NULL + +DefineEventAction_Request ::= SEQUENCE { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL, + confirmed_Service_Request [2] ConfirmedServiceRequest +} + +DefineEventAction_Response ::= NULL + +DeleteEventAction_Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa_specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL +} + +DeleteEventAction_Response ::= Unsigned32 -- candidates not deleted + +GetEventActionAttributes_Request ::= ObjectName -- Event Action Name + +GetEventActionAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier, + confirmed_Service_Request [2] ConfirmedServiceRequest +} + +ReportEventActionStatus_Request ::= ObjectName -- EventActionName + +ReportEventActionStatus_Response ::= Unsigned32 -- Number of Event Enrollments + +DefineEventEnrollment_Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransition [2] IMPLICIT Transitions, + alarmAcknowledgementRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL, + clientApplication [5] ApplicationReference OPTIONAL +} + +DefineEventEnrollment_Response ::= NULL + +DefineEventEnrollment_Error ::= ObjectName + +DeleteEventEnrollment_Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName +} + +DeleteEventEnrollment_Response ::= Unsigned32 -- candidates not deleted + +GetEventEnrollmentAttributes_Request ::= SEQUENCE { + scopeOfRequest [0] IMPLICIT INTEGER { + specific (0), + client (1), + ec (2), + ea (3) + } DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + clientApplication [2] ApplicationReference OPTIONAL, + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL +} + +EventEnrollment ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + eventActionName [2] CHOICE { + eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL + } OPTIONAL, + clientApplication [3] ApplicationReference OPTIONAL, + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE_Class, + duration [6] IMPLICIT EE_Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL +} + +GetEventEnrollmentAttributes_Response ::= SEQUENCE { + listOfEventEnrollment [0] IMPLICIT SEQUENCE OF EventEnrollment, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +ReportEventEnrollmentStatus_Request ::= ObjectName -- Event Enrollment Name + +ReportEventEnrollmentStatus_Response ::= SEQUENCE { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE_Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE_State +} + +AlterEventEnrollment_Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL +} + +AlterEventEnrollment_Response ::= SEQUENCE { + currentState [0] CHOICE { + state [0] IMPLICIT EE_State, + undefined [1] IMPLICIT NULL + }, + transitionTime [1] EventTime +} + +AcknowledgeEventNotification_Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC_State, + timeOfAcknowledgedTransition [3] EventTime +} + +AcknowledgeEventNotification_Response ::= NULL + +GetAlarmSummary_Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER { + not_acked (0), + acked (1), + all (2) + } DEFAULT not_acked, + severityFilter [3] IMPLICIT SEQUENCE { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL +} + +GetAlarmSummary_Response ::= SEQUENCE { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +AlarmSummary ::= SEQUENCE { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC_State, + unacknowledgedState [3] IMPLICIT INTEGER { + none (0), + active (1), + idle (2), + both (3) + }, + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL +} + +GetAlarmEnrollmentSummary_Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER { + not_acked (0), + acked (1), + all (2) + } DEFAULT not_acked, + severityFilter [3] IMPLICIT SEQUENCE { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL +} + +GetAlarmEnrollmentSummary_Response ::= SEQUENCE { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +AlarmEnrollmentSummary ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + clientApplication [2] ApplicationReference OPTIONAL, + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC_State, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + enrollementState [8] IMPLICIT EE_State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL +} + +EventNotification ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + severity [2] IMPLICIT Unsigned8, + currentState [3] IMPLICIT EC_State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult [8] IMPLICIT SEQUENCE { + eventActioName ObjectName, + eventActionResult CHOICE { + success [0] ConfirmedServiceResponse, + failure [1] IMPLICIT ServiceError + } + } OPTIONAL +} + +AttachToEventCondition ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL +} + +EventTime ::= CHOICE { + timeOfDayT [0] IMPLICIT TimeOfDay, + timeSequenceIdentifier [1] IMPLICIT Unsigned32 +} + +EC_Class ::= INTEGER { + network_triggered (0), + monitored (1) +} + +EC_State ::= INTEGER { + disabled (0), + idle (1), + active (2) +} + +EE_State ::= INTEGER { + disabled (0), + idle (1), + active (2), + activeNoAckA (3), + idleNoAckI (4), + idleNoAckA (5), + idleAcked (6), + activeAcked (7) +} + +Transitions ::= BIT STRING { + idle_to_disabled (0), + active_to_disabled (1), + disabled_to_idle (2), + active_to_idle (3), + disabled_to_active (4), + idle_to_active (5), + any_to_deleted (6) +} + +AlarmAckRule ::= INTEGER { + none (0), + simple (1), + ack_active (2), + ack_all (3) +} + +EE_Class ::= INTEGER { + modifier (0), + notification (1) +} + +EE_Duration ::= INTEGER { + current (0), + permanent (1) +} + +-- ********************************** JOURNAL ******************************************* + +---------------------------------- READ JOURNAL ---------------------------------- + +ReadJournal_Request ::= SEQUENCE { + journalName [0] ObjectName, + rangeStartSpecification [1] CHOICE { + startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING + } OPTIONAL, + rangeStopSpecification [2] CHOICE { + endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32 + } OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter [5] IMPLICIT SEQUENCE { + timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING + } +} + +ReadJournal_Response ::= SEQUENCE { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +JournalEntry ::= SEQUENCE { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent +} + +---------------------------------- WRITE JOURNAL ---------------------------------- + +WriteJournal_Request ::= SEQUENCE { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent +} + +WriteJournal_Response ::= NULL + +-------------------------------- INITIALIZE JOURNAL ---------------------------------- + +InitializeJournal_Request ::= SEQUENCE { + journalName [0] ObjectName, + limitSpecification [1] IMPLICIT SEQUENCE { + limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL + } OPTIONAL +} + +InitializeJournal_Response ::= Unsigned32 -- entries deleted + +---------------------------------- REPORT JOURNAL STATUS ----------------------------- + +ReportJournalStatus_Request ::= ObjectName -- Journal Name + +ReportJournalStatus_Response ::= SEQUENCE { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN +} + +---------------------------------- CREATE JOURNAL ---------------------------------- + +CreateJournal_Request ::= SEQUENCE { + journalName [0] ObjectName +} + +CreateJournal_Response ::= NULL + +---------------------------------- DELETE JOURNAL ---------------------------------- + +DeleteJournal_Request ::= SEQUENCE { + journalName [0] ObjectName +} + +DeleteJournal_Response ::= NULL + +-------------------------------- SUPPORTING PRODUCTIONS ---------------------------- + +EntryContent ::= SEQUENCE { + occurenceTime [0] IMPLICIT TimeOfDay, + additionalDetail [1] JOU_Additional_Detail OPTIONAL, + -- additionalDetail shall be omitted + -- from abstract syntax defined in this standard + entryForm CHOICE { + data [2] IMPLICIT SEQUENCE { + event [0] IMPLICIT SEQUENCE { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC_State + } OPTIONAL, + listOfVariables [1] IMPLICIT SEQUENCE OF SEQUENCE { + variableTag [0] IMPLICIT VisibleString, + valueSpecification [1] Data + } OPTIONAL + }, + annotation [3] IMPLICIT VisibleString + } +} + +JOU_Additional_Detail ::= NULL -- Defined by Companion Standard + +-- **************************************** FILES ********************************************* + +ObtainFile_Request ::= SEQUENCE { + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName +} + +ObtainFile_Response ::= NULL + +ObtainFile_Error ::= INTEGER { + source_file (0), + destination_file (1) +} + +FileOpen_Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32 +} + +FileOpen_Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes +} + +FileRead_Request ::= Integer32 + +FileRead_Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +FileClose_Request ::= Integer32 + +FileClose_Response ::= NULL + +FileRename_Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName +} + +FileRename_Response ::= NULL + +FileRename_Error ::= INTEGER { + source_file (0), + destination_file (1) +} + +FileDelete_Request ::= FileName + +FileDelete_Response ::= NULL + +FileDirectory_Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL +} + +FileDirectory_Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +DirectoryEntry ::= SEQUENCE { + filename [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes +} + +FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL +} + +END diff --git a/asn1/mms/more-asn1-files/mms-iso.asn b/asn1/mms/more-asn1-files/mms-iso.asn new file mode 100644 index 0000000..a5f2aee --- /dev/null +++ b/asn1/mms/more-asn1-files/mms-iso.asn @@ -0,0 +1,4767 @@ +--Quelle: http://isotc.iso.org/livelink/livelink/8434785/protocol.txt?func=doc.Fetch&nodeid=8434785 + ISO-9506-MMS-1 { iso standard 9506 part(2) mms-abstract-syntax-version1(1) } +DEFINITIONS ::= BEGIN + + EXPORTS AlternateAccess, + AttachToEventCondition, + AttachToSemaphore, + ConfirmedServiceRequest, + Data, + EE-State, + FileName, + Identifier, + Integer8, + Integer32, + MMSString, + MMS255String, + ObjectName, + TimeOfDay, + TypeSpecification, + Unsigned32, + Unsigned8, + VariableSpecification; + + IMPORTS ApplicationReference, + Authentication-value FROM + MMS-Environment-1 { iso standard 9506 part(2) mms-environment-version1 (4) } + ObtainFile-Request, + ObtainFile-Response, + ObtainFile-Error, + FileOpen-Request, + FileOpen-Response, + FileRead-Request, + FileRead-Response, + FileClose-Request, + FileClose-Response, + FileRename-Request, + FileRename-Response, + FileRename-Error, + FileDelete-Request, + FileDelete-Response, + FileDirectory-Request, + FileDirectory-Response, + DefineScatteredAccess-Request, + DefineScatteredAccess-Response, + ScatteredAccessDescription, + GetScatteredAccessAttributes-Request, + GetScatteredAccessAttributes-Response FROM + ISO-9506-MMS-1A { iso standard 9506 part(2) mms-annex-version1(3) } + AccessCondition, + AdditionalCBBOptions, + AdditionalSupportOptions, + Address, + AlarmAckRule, + Control-State, + DomainState, + EC-State, + EC-Class, + EE-Duration, + EE-Class, + EventTime, + Journal-Variable, + LogicalStatus, + Modifier, + normalPriority, + normalSeverity, + ParameterSupportOptions, + PhysicalStatus, + Priority, + ProgramInvocationState, + Running-Mode, + ServiceSupportOptions, + Severity, + Transitions, + TypeDescription, + ULState, + VMDState + FROM MMS-Object-Module-1 + { iso standard 9506 part(1) mms-object-model-version1(2) }; + + MMSpdu ::= CHOICE { + confirmed-RequestPDU [0] IMPLICIT Confirmed-RequestPDU, + confirmed-ResponsePDU [1] IMPLICIT Confirmed-ResponsePDU, + confirmed-ErrorPDU [2] IMPLICIT Confirmed-ErrorPDU, +IF ( unsolicitedStatus informationReport eventNotification ) + unconfirmed-PDU [3] IMPLICIT Unconfirmed-PDU, +ELSE + unconfirmed-PDU [3] IMPLICIT NULL, +ENDIF + rejectPDU [4] IMPLICIT RejectPDU, +IF (cancel) + cancel-RequestPDU [5] IMPLICIT Cancel-RequestPDU, + cancel-ResponsePDU [6] IMPLICIT Cancel-ResponsePDU, + cancel-ErrorPDU [7] IMPLICIT Cancel-ErrorPDU, +ELSE + cancel-RequestPDU [5] IMPLICIT NULL, + cancel-ResponsePDU [6] IMPLICIT NULL, + cancel-ErrorPDU [7] IMPLICIT NULL, +ENDIF + initiate-RequestPDU [8] IMPLICIT Initiate-RequestPDU, + initiate-ResponsePDU [9] IMPLICIT Initiate-ResponsePDU, + initiate-ErrorPDU [10] IMPLICIT Initiate-ErrorPDU, + conclude-RequestPDU [11] IMPLICIT Conclude-RequestPDU, + conclude-ResponsePDU [12] IMPLICIT Conclude-ResponsePDU, + conclude-ErrorPDU [13] IMPLICIT Conclude-ErrorPDU + } + + Confirmed-RequestPDU ::= SEQUENCE { + invokeID Unsigned32, +IF (attachToEventCondition attachToSemaphore ) + listOfModifiers SEQUENCE OF Modifier OPTIONAL, +ENDIF + service ConfirmedServiceRequest, + ... +IF ( csr cspi ), + service-ext [79] Request-Detail OPTIONAL +ENDIF + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL + } + + ConfirmedServiceRequest ::= CHOICE { +IF ( status ) + status + [0] IMPLICIT Status-Request +ELSE + status + [0] IMPLICIT NULL +ENDIF +IF ( getNameList ) +, getNameList + [1] IMPLICIT GetNameList-Request +ELSE +, getNameList + [1] IMPLICIT NULL +ENDIF +IF ( identify ) +, identify + [2] IMPLICIT Identify-Request +ELSE +, identify + [2] IMPLICIT NULL +ENDIF +IF ( rename ) +, rename + [3] IMPLICIT Rename-Request +ELSE +, rename + [3] IMPLICIT NULL +ENDIF +IF ( read ) +, read + [4] IMPLICIT Read-Request +ELSE +, read + [4] IMPLICIT NULL +ENDIF +IF ( write ) +, write + [5] IMPLICIT Write-Request +ELSE +, write + [5] IMPLICIT NULL +ENDIF +IF ( vnam vadr ) +IF ( getVariableAccessAttributes ) +, getVariableAccessAttributes + [6] GetVariableAccessAttributes-Request +ELSE +, getVariableAccessAttributes + [6] IMPLICIT NULL +ENDIF +ELSE +, getVariableAccessAttributes + [6] IMPLICIT NULL +ENDIF +IF ( vnam ) +IF ( vadr ) +IF ( defineNamedVariable ) +, defineNamedVariable + [7] IMPLICIT DefineNamedVariable-Request +ELSE +, defineNamedVariable + [7] IMPLICIT NULL +ENDIF +ELSE +, defineNamedVariable + [7] IMPLICIT NULL +ENDIF +ELSE +, defineNamedVariable + [7] IMPLICIT NULL +ENDIF +IF ( vsca ) + -- [8] is reserved for a service defined in Annex E +IF ( defineScatteredAccess ) +, defineScatteredAccess + [8] IMPLICIT DefineScatteredAccess-Request +ELSE +, defineScatteredAccess + [8] IMPLICIT NULL +ENDIF + -- [9] is reserved for a service defined in Annex E +IF ( getScatteredAccessAttributes ) +, getScatteredAccessAttributes + [9] GetScatteredAccessAttributes-Request +ELSE +, getScatteredAccessAttributes + [9] IMPLICIT NULL +ENDIF +ELSE +, defineScatteredAccess + [8] IMPLICIT NULL, + getScatteredAccessAttributes + [9] IMPLICIT NULL +ENDIF +IF ( vnam ) +IF ( deleteVariableAccess ) +, deleteVariableAccess + [10] IMPLICIT DeleteVariableAccess-Request +ELSE +, deleteVariableAccess + [10] IMPLICIT NULL +ENDIF +ELSE +, deleteVariableAccess + [10] IMPLICIT NULL +ENDIF +IF ( vlis ) +IF ( vnam ) +IF ( defineNamedVariableList ) +, defineNamedVariableList + [11] IMPLICIT DefineNamedVariableList-Request +ELSE +, defineNamedVariableList + [11] IMPLICIT NULL +ENDIF +IF ( getNamedVariableListAttributes ) + , getNamedVariableListAttributes + [12] GetNamedVariableListAttributes-Request +ELSE +, getNamedVariableListAttributes + [12] IMPLICIT NULL +ENDIF +IF ( deleteNamedVariableList ) +, deleteNamedVariableList + [13] IMPLICIT DeleteNamedVariableList-Request +ELSE +, deleteNamedVariableList + [13] IMPLICIT NULL +ENDIF +ELSE +, defineNamedVariableList + [11] IMPLICIT NULL, + getNamedVariableListAttribute + [12] IMPLICIT NULL, + deleteNamedVariableList + [13] IMPLICIT NULL +ENDIF +ELSE +, defineNamedVariableList + [11] IMPLICIT NULL, + getNamedVariableListAttributes + [12] IMPLICIT NULL, + deleteNamedVariableList + [13] IMPLICIT NULL +ENDIF +ENDIF +IF ( vnam ) +IF ( defineNamedType ) +, defineNamedType + [14] IMPLICIT DefineNamedType-Request +ELSE +, defineNamedType + [14] IMPLICIT NULL +ENDIF +IF ( getNamedTypeAttributes ) +, getNamedTypeAttributes + [15] GetNamedTypeAttributes-Request +ELSE +, getNamedTypeAttributes + [15] IMPLICIT NULL +ENDIF +IF ( deleteNamedType ) +, deleteNamedType + [16] IMPLICIT DeleteNamedType-Request +ELSE +, deleteNamedType + [16] IMPLICIT NULL +ENDIF +ELSE +, defineNamedType + [14] IMPLICIT NULL, + getNamedTypeAttributes + [15] IMPLICIT NULL, + deleteNamedType + [16] IMPLICIT NULL +ENDIF +IF ( input ) +, input + [17] IMPLICIT Input-Request +ELSE +, input + [17] IMPLICIT NULL +ENDIF +IF ( output ) +, output + [18] IMPLICIT Output-Request +ELSE +, output + [18] IMPLICIT NULL +ENDIF +IF ( takeControl ) +, takeControl + [19] IMPLICIT TakeControl-Request +ELSE +, takeControl + [19] IMPLICIT NULL +ENDIF +IF ( relinquishControl ) +, relinquishControl + [20] IMPLICIT RelinquishControl-Request +ELSE +, relinquishControl + [20] IMPLICIT NULL +ENDIF +IF ( defineSemaphore ) +, defineSemaphore + [21] IMPLICIT DefineSemaphore-Request +ELSE +, defineSemaphore + [21] IMPLICIT NULL +ENDIF +IF ( deleteSemaphore ) +, deleteSemaphore + [22] DeleteSemaphore-Request +ELSE +, deleteSemaphore + [22] IMPLICIT NULL +ENDIF +IF ( reportSemaphoreStatus ) +, reportSemaphoreStatus + [23] ReportSemaphoreStatus-Request +ELSE +, reportSemaphoreStatus + [23] IMPLICIT NULL +ENDIF +IF ( reportPoolSemaphoreStatus ) +, reportPoolSemaphoreStatus + [24] IMPLICIT ReportPoolSemaphoreStatus-Request +ELSE +, reportPoolSemaphoreStatus + [24] IMPLICIT NULL +ENDIF +IF ( reportSemaphoreEntryStatus ) +, reportSemaphoreEntryStatus + [25] IMPLICIT ReportSemaphoreEntryStatus-Request +ELSE +, reportSemaphoreEntryStatus + [25] IMPLICIT NULL +ENDIF +IF ( initiateDownloadSequence ) +, initiateDownloadSequence + [26] IMPLICIT InitiateDownloadSequence-Request, + downloadSegment + [27] IMPLICIT DownloadSegment-Request, + terminateDownloadSequence + [28] IMPLICIT TerminateDownloadSequence-Request +ELSE +, initiateDownloadSequence + [26] IMPLICIT NULL, + downloadSegment + [27] IMPLICIT NULL, + terminateDownloadSequence + [28] IMPLICIT NULL +ENDIF +IF ( initiateUploadSequence ) +, initiateUploadSequence + [29] IMPLICIT InitiateUploadSequence-Request, + uploadSegment + [30] IMPLICIT UploadSegment-Request, + terminateUploadSequence + [31] IMPLICIT TerminateUploadSequence-Request +ELSE +, initiateUploadSequence + [29] IMPLICIT NULL, + uploadSegment + [30] IMPLICIT NULL, + terminateUploadSequence + [31] IMPLICIT NULL +ENDIF +IF ( requestDomainDownload ) +, requestDomainDownload + [32] IMPLICIT RequestDomainDownload-Request +ELSE +, requestDomainDownload + [32] IMPLICIT NULL +ENDIF +IF ( requestDomainUpload ) +, requestDomainUpload + [33] IMPLICIT RequestDomainUpload-Request +ELSE +, requestDomainUpload + [33] IMPLICIT NULL +ENDIF +IF ( loadDomainContent ) +, loadDomainContent + [34] IMPLICIT LoadDomainContent-Request +ELSE +, loadDomainContent + [34] IMPLICIT NULL +ENDIF +IF ( storeDomainContent ) +, storeDomainContent + [35] IMPLICIT StoreDomainContent-Request +ELSE +, storeDomainContent + [35] IMPLICIT NULL +ENDIF +IF ( deleteDomain ) +, deleteDomain + [36] IMPLICIT DeleteDomain-Request +ELSE +, deleteDomain + [36] IMPLICIT NULL +ENDIF +IF ( getDomainAttributes ) +, getDomainAttributes + [37] IMPLICIT GetDomainAttributes-Request +ELSE +, getDomainAttributes + [37] IMPLICIT NULL +ENDIF +IF ( createProgramInvocation ) +, createProgramInvocation + [38] IMPLICIT CreateProgramInvocation-Request +ELSE +, createProgramInvocation + [38] IMPLICIT NULL +ENDIF +IF ( deleteProgramInvocation ) +, deleteProgramInvocation + [39] IMPLICIT DeleteProgramInvocation-Request +ELSE +, deleteProgramInvocation + [39] IMPLICIT NULL +ENDIF +IF ( start ) +, start + [40] IMPLICIT Start-Request +ELSE +, start + [40] IMPLICIT NULL +ENDIF +IF ( stop ) +, stop + [41] IMPLICIT Stop-Request +ELSE +, stop + [41] IMPLICIT NULL +ENDIF +IF ( resume ) +, resume + [42] IMPLICIT Resume-Request +ELSE +, resume + [42] IMPLICIT NULL +ENDIF +IF ( reset ) +, reset + [43] IMPLICIT Reset-Request +ELSE +, reset + [43] IMPLICIT NULL +ENDIF +IF ( kill ) +, kill + [44] IMPLICIT Kill-Request +ELSE +, kill + [44] IMPLICIT NULL +ENDIF +IF ( getProgramInvocationAttributes ) +, getProgramInvocationAttributes + [45] IMPLICIT GetProgramInvocationAttributes-Request +ELSE +, getProgramInvocationAttributes + [45] IMPLICIT NULL +ENDIF +IF ( obtainFile ) +, obtainFile + [46] IMPLICIT ObtainFile-Request +ELSE +, obtainFile + [46] IMPLICIT NULL +ENDIF +IF ( defineEventCondition ) +, defineEventCondition + [47] IMPLICIT DefineEventCondition-Request +ELSE +, defineEventCondition + [47] IMPLICIT NULL +ENDIF +IF ( deleteEventCondition ) +, deleteEventCondition + [48] DeleteEventCondition-Request +ELSE +, deleteEventCondition + [48] IMPLICIT NULL +ENDIF +IF ( getEventConditionAttributes ) +, getEventConditionAttributes + [49] GetEventConditionAttributes-Request +ELSE +, getEventConditionAttributes + [49] IMPLICIT NULL +ENDIF +IF ( reportEventConditionStatus ) +, reportEventConditionStatus + [50] ReportEventConditionStatus-Request +ELSE +, reportEventConditionStatus + [50] IMPLICIT NULL +ENDIF +IF ( alterEventConditionMonitoring ) +, alterEventConditionMonitoring + [51] IMPLICIT AlterEventConditionMonitoring-Request +ELSE +, alterEventConditionMonitoring + [51] IMPLICIT NULL +ENDIF +IF ( triggerEvent ) +, triggerEvent + [52] IMPLICIT TriggerEvent-Request +ELSE +, triggerEvent + [52] IMPLICIT NULL +ENDIF +IF ( defineEventAction ) +, defineEventAction + [53] IMPLICIT DefineEventAction-Request +ELSE +, defineEventAction + [53] IMPLICIT NULL +ENDIF +IF ( deleteEventAction ) +, deleteEventAction + [54] DeleteEventAction-Request +ELSE +, deleteEventAction + [54] IMPLICIT NULL +ENDIF +IF ( getEventActionAttributes ) +, getEventActionAttributes + [55] GetEventActionAttributes-Request +ELSE +, getEventActionAttributes + [55] IMPLICIT NULL +ENDIF +IF ( reportEventActionStatus ) +, reportEventActionStatus + [56] ReportEventActionStatus-Request +ELSE +, reportEventActionStatus + [56] IMPLICIT NULL +ENDIF +IF ( defineEventEnrollment ) +, defineEventEnrollment + [57] IMPLICIT DefineEventEnrollment-Request +ELSE +, defineEventEnrollment + [57] IMPLICIT NULL +ENDIF +IF ( deleteEventEnrollment ) +, deleteEventEnrollment + [58] DeleteEventEnrollment-Request +ELSE +, deleteEventEnrollment + [58] IMPLICIT NULL +ENDIF +IF ( alterEventEnrollment ) +, alterEventEnrollment + [59] IMPLICIT AlterEventEnrollment-Request +ELSE +, alterEventEnrollment + [59] IMPLICIT NULL +ENDIF +IF ( reportEventEnrollmentStatus ) +, reportEventEnrollmentStatus + [60] ReportEventEnrollmentStatus-Request +ELSE +, reportEventEnrollmentStatus + [60] IMPLICIT NULL +ENDIF +IF ( getEventEnrollmentAttributes ) +, getEventEnrollmentAttributes + [61] IMPLICIT GetEventEnrollmentAttributes-Request +ELSE +, getEventEnrollmentAttributes + [61] IMPLICIT NULL +ENDIF +IF ( acknowledgeEventNotification ) +, acknowledgeEventNotification + [62] IMPLICIT AcknowledgeEventNotification-Request +ELSE +, acknowledgeEventNotification + [62] IMPLICIT NULL +ENDIF +IF ( getAlarmSummary ) +, getAlarmSummary + [63] IMPLICIT GetAlarmSummary-Request +ELSE +, getAlarmSummary + [63] IMPLICIT NULL +ENDIF +IF ( getAlarmEnrollmentSummary ) +, getAlarmEnrollmentSummary + [64] IMPLICIT GetAlarmEnrollmentSummary-Request +ELSE +, getAlarmEnrollmentSummary + [64] IMPLICIT NULL +ENDIF +IF ( readJournal ) +, readJournal + [65] IMPLICIT ReadJournal-Request +ELSE +, readJournal + [65] IMPLICIT NULL +ENDIF +IF ( writeJournal ) +, writeJournal + [66] IMPLICIT WriteJournal-Request +ELSE +, writeJournal + [66] IMPLICIT NULL +ENDIF +IF ( initializeJournal ) +, initializeJournal + [67] IMPLICIT InitializeJournal-Request +ELSE +, initializeJournal + [67] IMPLICIT NULL +ENDIF +IF ( reportJournalStatus ) +, reportJournalStatus + [68] ReportJournalStatus-Request +ELSE +, reportJournalStatus + [68] IMPLICIT NULL +ENDIF +IF ( createJournal ) +, createJournal + [69] IMPLICIT CreateJournal-Request +ELSE +, createJournal + [69] IMPLICIT NULL +ENDIF +IF ( deleteJournal ) +, deleteJournal + [70] IMPLICIT DeleteJournal-Request +ELSE +, deleteJournal + [70] IMPLICIT NULL +ENDIF +IF ( getCapabilityList ) +, getCapabilityList + [71] IMPLICIT GetCapabilityList-Request +ELSE +, getCapabilityList + [71] IMPLICIT NULL +ENDIF + -- choices [72] through [77] are reserved for use by services + -- defined in annex D +IF ( fileOpen ) +, fileOpen + [72] IMPLICIT FileOpen-Request +ELSE +, fileOpen + [72] IMPLICIT NULL +ENDIF +IF ( fileRead ) +, fileRead + [73] IMPLICIT FileRead-Request +ELSE +, fileRead + [73] IMPLICIT NULL +ENDIF +IF ( fileClose ) +, fileClose + [74] IMPLICIT FileClose-Request +ELSE +, fileClose + [74] IMPLICIT NULL +ENDIF +IF ( fileRename ) +, fileRename + [75] IMPLICIT FileRename-Request +ELSE +, fileRename + [75] IMPLICIT NULL +ENDIF +IF ( fileDelete ) +, fileDelete + [76] IMPLICIT FileDelete-Request +ELSE +, fileDelete + [76] IMPLICIT NULL +ENDIF +IF ( fileDirectory ) +, fileDirectory + [77] IMPLICIT FileDirectory-Request +ELSE +, fileDirectory + [77] IMPLICIT NULL +ENDIF +,... +IF ( csr cspi ) +, additionalService + [78] AdditionalService-Request +ENDIF + -- choice [79] is reserved +IF ( getDataExchangeAttributes ) +, getDataExchangeAttributes + [80] GetDataExchangeAttributes-Request + -- Shall not appear in minor version 1 +ENDIF +IF ( exchangeData ) +, exchangeData + [81] IMPLICIT ExchangeData-Request + -- Shall not appear in minor version 1 +ENDIF +IF ( defineAccessControlList ) +, defineAccessControlList + [82] IMPLICIT DefineAccessControlList-Request + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( getAccessControlListAttributes ) +, getAccessControlListAttributes + [83] GetAccessControlListAttributes-Request + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( reportAccessControlledObjects ) +, reportAccessControlledObjects + [84] IMPLICIT ReportAccessControlledObjects-Request + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( deleteAccessControlList ) +, deleteAccessControlList + [85] IMPLICIT DeleteAccessControlList-Request + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( changeAccessControl ) +, changeAccessControl + [86] IMPLICIT ChangeAccessControl-Request + -- Shall not appear in minor version 1 or 2 +ENDIF + ,... + } + + AdditionalService-Request ::= CHOICE { +IF ( csr ) +IF ( vMDStop ) + vMDStop + [0] IMPLICIT VMDStop-Request +ELSE + vMDStop + [0] IMPLICIT NULL +ENDIF +IF ( vMDReset ) +, vMDReset + [1] IMPLICIT VMDReset-Request +ELSE +, vMDReset + [1] IMPLICIT NULL +ENDIF +IF ( select ) +, select + [2] IMPLICIT Select-Request +ELSE +, select + [2] IMPLICIT NULL +ENDIF +IF ( alterProgramInvocationAttributes ) +, alterPI + [3] IMPLICIT AlterProgramInvocationAttributes-Request +ELSE +, alterPI + [3] IMPLICIT NULL +ENDIF +ELSE +, vMDStop + [0] IMPLICIT NULL, + vMDReset + [1] IMPLICIT NULL, + select + [2] IMPLICIT NULL, + alterPI + [3] IMPLICIT NULL +ENDIF +IF ( cspi ) +IF ( initiateUnitControlLoad ) +, initiateUCLoad + [4] IMPLICIT InitiateUnitControlLoad-Request +ELSE +, initiateUCLoad + [4] IMPLICIT NULL +ENDIF +IF ( unitControlLoadSegment ) +, uCLoad + [5] IMPLICIT UnitControlLoadSegment-Request +ELSE +, uCLoad + [5] IMPLICIT NULL +ENDIF +IF ( unitControlUpload ) +, uCUpload + [6] IMPLICIT UnitControlUpload-Request +ELSE +, uCUpload + [6] IMPLICIT NULL +ENDIF +IF ( startUnitControl ) +, startUC + [7] IMPLICIT StartUnitControl-Request +ELSE +, startUC + [7] IMPLICIT NULL +ENDIF +IF ( stopUnitControl ) +, stopUC + [8] IMPLICIT StopUnitControl-Request +ELSE +, stopUC + [8] IMPLICIT NULL +ENDIF + IF ( createUnitControl ) +, createUC + [9] IMPLICIT CreateUnitControl-Request +ELSE +, createUC + [9] IMPLICIT NULL +ENDIF +IF ( addToUnitControl ) +, addToUC + [10] IMPLICIT AddToUnitControl-Request +ELSE +, addToUC + [10] IMPLICIT NULL +ENDIF +IF ( removeFromUnitControl ) +, removeFromUC + [11] IMPLICIT RemoveFromUnitControl-Request +ELSE +, removeFromUC + [11] IMPLICIT NULL +ENDIF +IF ( getUnitControlAttributes ) +, getUCAttributes + [12] IMPLICIT GetUnitControlAttributes-Request +ELSE +, getUCAttributes + [12] IMPLICIT NULL +ENDIF +IF ( loadUnitControlFromFile ) +, loadUCFromFile + [13] IMPLICIT LoadUnitControlFromFile-Request +ELSE +, loadUCFromFile + [13] IMPLICIT NULL +ENDIF +IF ( storeUnitControlToFile ) +, storeUCToFile + [14] IMPLICIT StoreUnitControlToFile-Request +ELSE +, storeUCToFile + [14] IMPLICIT NULL +ENDIF +IF ( deleteUnitControl ) +, deleteUC + [15] IMPLICIT DeleteUnitControl-Request +ELSE +, deleteUC + [15] IMPLICIT NULL +ENDIF +IF ( defineEventConditionList ) +, defineECL + [16] DefineEventConditionList-Request +ELSE +, defineECL + [16] IMPLICIT NULL +ENDIF +IF ( deleteEventConditionList ) +, deleteECL + [17] DeleteEventConditionList-Request +ELSE +, deleteECL + [17] IMPLICIT NULL +ENDIF +IF ( addEventConditionListReference ) +, addECLReference + [18] IMPLICIT AddEventConditionListReference-Request +ELSE +, addECLReference + [18] IMPLICIT NULL +ENDIF +IF ( removeEventConditionListReference ) +, removeECLReference + [19] IMPLICIT RemoveEventConditionListReference-Request +ELSE +, removeECLReference + [19] IMPLICIT NULL +ENDIF +IF ( getEventConditionListAttributes ) +, getECLAttributes + [20] GetEventConditionListAttributes-Request +ELSE +, getECLAttributes + [20] IMPLICIT NULL +ENDIF +IF ( reportEventConditionListStatus ) +, reportECLStatus + [21] IMPLICIT ReportEventConditionListStatus-Request +ELSE +, reportECLStatus + [21] IMPLICIT NULL +ENDIF +IF ( alterEventConditionListMonitoring ) +, alterECLMonitoring + [22] IMPLICIT AlterEventConditionListMonitoring-Request +ELSE +, alterECLMonitoring + [22] IMPLICIT NULL +ENDIF +ELSE +, initiateUCLoad + [4] IMPLICIT NULL, + uCLoad + [5] IMPLICIT NULL, + uCUpload + [6] IMPLICIT NULL, + startUC + [7] IMPLICIT NULL, + stopUC + [8] IMPLICIT NULL, + createUC + [9] IMPLICIT NULL, + addToUC + [10] IMPLICIT NULL, + removeFromUC + [11] IMPLICIT NULL, + getUCAttributes + [12] IMPLICIT NULL, + loadUCFromFile + [13] IMPLICIT NULL, + storeUCToFile + [14] IMPLICIT NULL, + deleteUC + [15] IMPLICIT NULL, + defineECL + [16] IMPLICIT NULL, + deleteECL + [17] IMPLICIT NULL, + addECLReference + [18] IMPLICIT NULL, + removeECLReference + [19] IMPLICIT NULL, + getECLAttributes + [20] IMPLICIT NULL, + reportECLStatus + [21] IMPLICIT NULL, + alterECLMonitoring + [22] IMPLICIT NULL +ENDIF + } + + Request-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceRequest does not match any of the tags below + otherRequests NULL +IF ( createProgramInvocation ) +, createProgramInvocation + [38] IMPLICIT CS-CreateProgramInvocation-Request +ELSE +, createProgramInvocation + [38] IMPLICIT NULL +ENDIF +IF ( start ) +, start + [40] IMPLICIT CS-Start-Request +ELSE +, start + [40] IMPLICIT NULL +ENDIF +IF ( resume ) +, resume + [42] IMPLICIT CS-Resume-Request +ELSE +, resume + [42] IMPLICIT NULL +ENDIF +IF ( defineEventCondition ) +, defineEventCondition + [47] IMPLICIT CS-DefineEventCondition-Request +ELSE +, defineEventCondition + [47] IMPLICIT NULL +ENDIF +IF ( alterEventConditionMonitoring ) +, alterEventConditionMonitoring + [51] IMPLICIT CS-AlterEventConditionMonitoring-Request +ELSE +, alterEventConditionMonitoring + [51] IMPLICIT NULL +ENDIF +IF ( defineEventEnrollment ) +, defineEventEnrollment + [57] IMPLICIT CS-DefineEventEnrollment-Request +ELSE +, defineEventEnrollment + [57] IMPLICIT NULL +ENDIF +IF ( alterEventEnrollment ) +, alterEventEnrollment + [59] IMPLICIT CS-AlterEventEnrollment-Request +ELSE +, alterEventEnrollment + [59] IMPLICIT NULL +ENDIF + } + + Unconfirmed-PDU ::= SEQUENCE { + service UnconfirmedService, + ... +IF ( cspi ) +, service-ext [79] Unconfirmed-Detail OPTIONAL +ENDIF + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL + } + + UnconfirmedService ::= CHOICE { +IF (informationReport ) + informationReport + [0] IMPLICIT InformationReport +ELSE + informationReport + [0] IMPLICIT NULL +ENDIF +IF ( unsolicitedStatus ) +, unsolicitedStatus + [1] IMPLICIT UnsolicitedStatus +ELSE +, unsolicitedStatus + [1] IMPLICIT NULL +ENDIF +IF ( eventNotification ) +, eventNotification + [2] IMPLICIT EventNotification +ELSE +, eventNotification + [2] IMPLICIT NULL +ENDIF + } + + Unconfirmed-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- UnconfirmedService does not match any of the tags below + otherRequests NULL +IF ( cspi ) +, eventNotification + [2] IMPLICIT CS-EventNotification +ENDIF + } + + Confirmed-ResponsePDU ::= SEQUENCE { + invokeID Unsigned32, + service ConfirmedServiceResponse, + ... +IF ( csr cspi ), + service-ext [79] Response-Detail OPTIONAL +ENDIF + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL + } + + ConfirmedServiceResponse ::= CHOICE { +IF ( status ) + status + [0] IMPLICIT Status-Response +ELSE + status + [0] IMPLICIT RejectPDU +ENDIF +IF ( getNameList ) +, getNameList + [1] IMPLICIT GetNameList-Response +ELSE +, getNameList + [1] IMPLICIT RejectPDU +ENDIF +IF ( identify ) +, identify + [2] IMPLICIT Identify-Response +ELSE +, identify + [2] IMPLICIT RejectPDU +ENDIF +IF ( rename ) +, rename + [3] IMPLICIT Rename-Response +ELSE +, rename + [3] IMPLICIT RejectPDU +ENDIF +IF ( read ) +, read + [4] IMPLICIT Read-Response +ELSE +, read + [4] IMPLICIT RejectPDU + ENDIF +IF ( write ) +, write + [5] IMPLICIT Write-Response +ELSE +, write + [5] IMPLICIT RejectPDU +ENDIF +IF ( vnam vadr ) +IF ( getVariableAccessAttributes ) +, getVariableAccessAttributes + [6] IMPLICIT GetVariableAccessAttributes-Response +ELSE +, getVariableAccessAttributes + [6] IMPLICIT RejectPDU +ENDIF +ELSE +, getVariableAccessAttributes + [6] IMPLICIT RejectPDU +ENDIF +IF ( vnam ) +IF ( vadr ) +IF ( defineNamedVariable ) +, defineNamedVariable + [7] IMPLICIT DefineNamedVariable-Response +ELSE +, defineNamedVariable + [7] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedVariable + [7] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedVariable + [7] IMPLICIT RejectPDU +ENDIF +IF ( vsca ) + -- choice [8] is reserved for a service defined in Annex E +IF ( defineScatteredAccess ) +, defineScatteredAccess + [8] IMPLICIT DefineScatteredAccess-Response +ELSE +, defineScatteredAccess + [8] IMPLICIT RejectPDU +ENDIF + -- choice [9] is reserved for a service defined in Annex E +IF ( getScatteredAccessAttributes ) +, getScatteredAccessAttributes + [9] IMPLICIT GetScatteredAccessAttributes-Response +ELSE +, getScatteredAccessAttributes + [9] IMPLICIT RejectPDU +ENDIF +ELSE +, defineScatteredAccess + [8] IMPLICIT RejectPDU, + getScatteredAccessAttributes + [9] IMPLICIT RejectPDU +ENDIF +IF ( vnam ) +IF ( deleteVariableAccess ) +, deleteVariableAccess + [10] IMPLICIT DeleteVariableAccess-Response +ELSE +, deleteVariableAccess + [10] IMPLICIT RejectPDU +ENDIF +ELSE +, deleteVariableAccess + [10] IMPLICIT RejectPDU +ENDIF +IF ( vlis ) +IF ( vnam ) +IF ( defineNamedVariableList ) +, defineNamedVariableList + [11] IMPLICIT DefineNamedVariableList-Response +ELSE +, defineNamedVariableList + [11] IMPLICIT RejectPDU +ENDIF +IF ( getNamedVariableListAttributes ) +, getNamedVariableListAttributes + [12] IMPLICIT GetNamedVariableListAttributes-Response +ELSE +, getNamedVariableListAttributes + [12] IMPLICIT RejectPDU +ENDIF +IF ( deleteNamedVariableList ) +, deleteNamedVariableList + [13] IMPLICIT DeleteNamedVariableList-Response +ELSE +, deleteNamedVariableList + [13] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedVariableList + [11] IMPLICIT RejectPDU, + getNamedVariableListAttributes + [12] IMPLICIT RejectPDU, + deleteNamedVariableList + [13] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedVariableList + [11] IMPLICIT RejectPDU, + getNamedVariableListAttributes + [12] IMPLICIT RejectPDU, + deleteNamedVariableList + [13] IMPLICIT RejectPDU +ENDIF +IF ( vnam ) +IF ( defineNamedType ) +, defineNamedType + [14] IMPLICIT DefineNamedType-Response +ELSE +, defineNamedType + [14] IMPLICIT RejectPDU +ENDIF +IF ( getNamedTypeAttributes ) +, getNamedTypeAttributes + [15] IMPLICIT GetNamedTypeAttributes-Response +ELSE +, getNamedTypeAttributes + [15] IMPLICIT RejectPDU +ENDIF +IF ( deleteNamedType ) +, deleteNamedType + [16] IMPLICIT DeleteNamedType-Response +ELSE +, deleteNamedType + [16] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedType + [14] IMPLICIT RejectPDU, + getNamedTypeAttributes + [15] IMPLICIT RejectPDU, + deleteNamedType + [16] IMPLICIT RejectPDU +ENDIF +IF ( input ) +, input + [17] IMPLICIT Input-Response +ELSE +, input + [17] IMPLICIT RejectPDU +ENDIF +IF ( output ) +, output + [18] IMPLICIT Output-Response +ELSE +, output + [18] IMPLICIT RejectPDU +ENDIF +IF ( takeControl ) +, takeControl + [19] TakeControl-Response +ELSE +, takeControl + [19] IMPLICIT RejectPDU +ENDIF +IF ( relinquishControl ) +, relinquishControl + [20] IMPLICIT RelinquishControl-Response +ELSE +, relinquishControl + [20] IMPLICIT RejectPDU +ENDIF +IF ( defineSemaphore ) +, defineSemaphore + [21] IMPLICIT DefineSemaphore-Response +ELSE +, defineSemaphore + [21] IMPLICIT RejectPDU +ENDIF +IF ( deleteSemaphore ) +, deleteSemaphore + [22] IMPLICIT DeleteSemaphore-Response +ELSE +, deleteSemaphore + [22] IMPLICIT RejectPDU +ENDIF +IF ( reportSemaphoreStatus ) +, reportSemaphoreStatus + [23] IMPLICIT ReportSemaphoreStatus-Response +ELSE +, reportSemaphoreStatus + [23] IMPLICIT RejectPDU +ENDIF +IF ( reportPoolSemaphoreStatus ) +, reportPoolSemaphoreStatus + [24] IMPLICIT ReportPoolSemaphoreStatus-Response +ELSE +, reportPoolSemaphoreStatus + [24] IMPLICIT RejectPDU +ENDIF +IF ( reportSemaphoreEntryStatus ) +, reportSemaphoreEntryStatus + [25] IMPLICIT ReportSemaphoreEntryStatus-Response +ELSE +, reportSemaphoreEntryStatus + [25] IMPLICIT RejectPDU +ENDIF +IF ( initiateDownloadSequence ) +, initiateDownloadSequence + [26] IMPLICIT InitiateDownloadSequence-Response, + downloadSegment + [27] IMPLICIT DownloadSegment-Response, + terminateDownloadSequence + [28] IMPLICIT TerminateDownloadSequence-Response +ELSE +, initiateDownloadSequence + [26] IMPLICIT RejectPDU, + downloadSegment + [27] IMPLICIT RejectPDU, + terminateDownloadSequence + [28] IMPLICIT RejectPDU +ENDIF +IF ( initiateUploadSequence ) +, initiateUploadSequence + [29] IMPLICIT InitiateUploadSequence-Response, + uploadSegment + [30] IMPLICIT UploadSegment-Response, + terminateUploadSequence + [31] IMPLICIT TerminateUploadSequence-Response +ELSE +, initiateUploadSequence + [29] IMPLICIT RejectPDU, + uploadSegment + [30] IMPLICIT RejectPDU, + terminateUploadSequence + [31] IMPLICIT RejectPDU +ENDIF +IF ( requestDomainDownload ) +, requestDomainDownload + [32] IMPLICIT RequestDomainDownload-Response +ELSE +, requestDomainDownload + [32] IMPLICIT RejectPDU +ENDIF +IF ( requestDomainUpload ) +, requestDomainUpload + [33] IMPLICIT RequestDomainUpload-Response +ELSE +, requestDomainUpload + [33] IMPLICIT RejectPDU +ENDIF +IF ( loadDomainContent ) +, loadDomainContent + [34] IMPLICIT LoadDomainContent-Response +ELSE +, loadDomainContent + [34] IMPLICIT RejectPDU +ENDIF +IF ( storeDomainContent ) +, storeDomainContent + [35] IMPLICIT StoreDomainContent-Response +ELSE +, storeDomainContent + [35] IMPLICIT RejectPDU +ENDIF +IF ( deleteDomain ) +, deleteDomain + [36] IMPLICIT DeleteDomain-Response +ELSE +, deleteDomain + [36] IMPLICIT RejectPDU +ENDIF +IF ( getDomainAttributes ) +, getDomainAttributes + [37] IMPLICIT GetDomainAttributes-Response +ELSE +, getDomainAttributes + [37] IMPLICIT RejectPDU +ENDIF +IF ( createProgramInvocation ) +, createProgramInvocation + [38] IMPLICIT CreateProgramInvocation-Response +ELSE +, createProgramInvocation + [38] IMPLICIT RejectPDU +ENDIF +IF ( deleteProgramInvocation ) +, deleteProgramInvocation + [39] IMPLICIT DeleteProgramInvocation-Response +ELSE +, deleteProgramInvocation + [39] IMPLICIT RejectPDU +ENDIF +IF ( start ) +, start + [40] IMPLICIT Start-Response +ELSE +, start + [40] IMPLICIT RejectPDU +ENDIF +IF ( stop ) +, stop + [41] IMPLICIT Stop-Response +ELSE +, stop + [41] IMPLICIT RejectPDU +ENDIF +IF ( resume ) +, resume + [42] IMPLICIT Resume-Response +ELSE +, resume + [42] IMPLICIT RejectPDU +ENDIF +IF ( reset ) +, reset + [43] IMPLICIT Reset-Response +ELSE +, reset + [43] IMPLICIT RejectPDU +ENDIF +IF ( kill ) +, kill + [44] IMPLICIT Kill-Response +ELSE +, kill + [44] IMPLICIT RejectPDU +ENDIF +IF ( getProgramInvocationAttributes ) +, getProgramInvocationAttributes + [45] IMPLICIT GetProgramInvocationAttributes-Response +ELSE +, getProgramInvocationAttributes + [45] IMPLICIT RejectPDU +ENDIF +IF ( obtainFile ) +, obtainFile + [46] IMPLICIT ObtainFile-Response +ELSE +, obtainFile + [46] IMPLICIT RejectPDU +ENDIF +IF ( defineEventCondition ) +, defineEventCondition + [47] IMPLICIT DefineEventCondition-Response +ELSE +, defineEventCondition + [47] IMPLICIT RejectPDU +ENDIF +IF ( deleteEventCondition ) +, deleteEventCondition + [48] IMPLICIT DeleteEventCondition-Response +ELSE +, deleteEventCondition + [48] IMPLICIT RejectPDU +ENDIF +IF ( getEventConditionAttributes ) +, getEventConditionAttributes + [49] IMPLICIT GetEventConditionAttributes-Response +ELSE +, getEventConditionAttributes + [49] IMPLICIT RejectPDU +ENDIF +IF ( reportEventConditionStatus ) +, reportEventConditionStatus + [50] IMPLICIT ReportEventConditionStatus-Response +ELSE +, reportEventConditionStatus + [50] IMPLICIT RejectPDU +ENDIF +IF ( alterEventConditionMonitoring ) +, alterEventConditionMonitoring + [51] IMPLICIT AlterEventConditionMonitoring-Response +ELSE +, alterEventConditionMonitoring + [51] IMPLICIT RejectPDU +ENDIF +IF ( triggerEvent ) +, triggerEvent + [52] IMPLICIT TriggerEvent-Response +ELSE +, triggerEvent + [52] IMPLICIT RejectPDU +ENDIF +IF ( defineEventAction ) +, defineEventAction + [53] IMPLICIT DefineEventAction-Response +ELSE +, defineEventAction + [53] IMPLICIT RejectPDU +ENDIF +IF ( deleteEventAction ) +, deleteEventAction + [54] IMPLICIT DeleteEventAction-Response +ELSE +, deleteEventAction + [54] IMPLICIT RejectPDU +ENDIF +IF ( getEventActionAttributes ) +, getEventActionAttributes + [55] IMPLICIT GetEventActionAttributes-Response +ELSE +, getEventActionAttributes + [55] IMPLICIT RejectPDU +ENDIF +IF ( reportEventActionStatus ) +, reportEventActionStatus + [56] IMPLICIT ReportEventActionStatus-Response +ELSE +, reportEventActionStatus + [56] IMPLICIT RejectPDU +ENDIF +IF ( defineEventEnrollment ) +, defineEventEnrollment + [57] IMPLICIT DefineEventEnrollment-Response +ELSE +, defineEventEnrollment + [57] IMPLICIT RejectPDU +ENDIF +IF ( deleteEventEnrollment ) +, deleteEventEnrollment + [58] IMPLICIT DeleteEventEnrollment-Response +ELSE +, deleteEventEnrollment + [58] IMPLICIT RejectPDU +ENDIF +IF ( alterEventEnrollment ) +, alterEventEnrollment + [59] IMPLICIT AlterEventEnrollment-Response +ELSE +, alterEventEnrollment + [59] IMPLICIT RejectPDU +ENDIF +IF ( reportEventEnrollmentStatus ) +, reportEventEnrollmentStatus + [60] IMPLICIT ReportEventEnrollmentStatus-Response +ELSE +, reportEventEnrollmentStatus + [60] IMPLICIT RejectPDU +ENDIF +IF ( getEventEnrollmentAttributes ) +, getEventEnrollmentAttributes + [61] IMPLICIT GetEventEnrollmentAttributes-Response +ELSE +, getEventEnrollmentAttributes + [61] IMPLICIT RejectPDU +ENDIF +IF ( acknowledgeEventNotification ) +, acknowledgeEventNotification + [62] IMPLICIT AcknowledgeEventNotification-Response +ELSE +, acknowledgeEventNotification + [62] IMPLICIT RejectPDU +ENDIF +IF ( getAlarmSummary ) +, getAlarmSummary + [63] IMPLICIT GetAlarmSummary-Response +ELSE +, getAlarmSummary + [63] IMPLICIT RejectPDU +ENDIF +IF ( getAlarmEnrollmentSummary ) +, getAlarmEnrollmentSummary + [64] IMPLICIT GetAlarmEnrollmentSummary-Response +ELSE +, getAlarmEnrollmentSummary + [64] IMPLICIT RejectPDU +ENDIF +IF ( readJournal ) +, readJournal + [65] IMPLICIT ReadJournal-Response +ELSE +, readJournal + [65] IMPLICIT RejectPDU +ENDIF +IF ( writeJournal ) +, writeJournal + [66] IMPLICIT WriteJournal-Response +ELSE +, writeJournal + [66] IMPLICIT RejectPDU +ENDIF +IF ( initializeJournal ) +, initializeJournal + [67] IMPLICIT InitializeJournal-Response +ELSE +, initializeJournal + [67] IMPLICIT RejectPDU +ENDIF +IF ( reportJournalStatus ) +, reportJournalStatus + [68] IMPLICIT ReportJournalStatus-Response +ELSE +, reportJournalStatus + [68] IMPLICIT RejectPDU +ENDIF +IF ( createJournal ) +, createJournal + [69] IMPLICIT CreateJournal-Response +ELSE +, createJournal + [69] IMPLICIT RejectPDU +ENDIF +IF ( deleteJournal ) +, deleteJournal + [70] IMPLICIT DeleteJournal-Response +ELSE +, deleteJournal + [70] IMPLICIT RejectPDU +ENDIF +IF ( getCapabilityList ) +, getCapabilityList + [71] IMPLICIT GetCapabilityList-Response +ELSE +, getCapabilityList + [71] IMPLICIT RejectPDU +ENDIF + -- choices [72] through [77] are reserved for use by services + -- defined in annex D +IF ( fileOpen ) +, fileOpen + [72] IMPLICIT FileOpen-Response +ELSE +, fileOpen + [72] IMPLICIT RejectPDU +ENDIF +IF ( fileRead ) +, fileRead + [73] IMPLICIT FileRead-Response +ELSE +, fileRead + [73] IMPLICIT RejectPDU +ENDIF +IF ( fileClose ) +, fileClose + [74] IMPLICIT FileClose-Response +ELSE +, fileClose + [74] IMPLICIT RejectPDU +ENDIF +IF ( fileRename ) +, fileRename + [75] IMPLICIT FileRename-Response +ELSE +, fileRename + [75] IMPLICIT RejectPDU +ENDIF +IF ( fileDelete ) +, fileDelete + [76] IMPLICIT FileDelete-Response +ELSE +, fileDelete + [76] IMPLICIT RejectPDU +ENDIF +IF ( fileDirectory ) +, fileDirectory + [77] IMPLICIT FileDirectory-Response +ELSE +, fileDirectory + [77] IMPLICIT RejectPDU +ENDIF +,... +IF ( csr cspi ) +, additionalService + [78] AdditionalService-Response + -- choice [79] is reserved +IF ( getDataExchangeAttributes ), +, getDataExchangeAttributes + [80] GetDataExchangeAttributes-Response + -- Shall not appear in minor version 1 +ENDIF +IF ( exchangeData ), +, exchangeData + [81] IMPLICIT ExchangeData-Response + -- Shall not appear in minor version 1 +ENDIF +IF ( defineAccessControlList ), +, defineAccessControlList + [82] IMPLICIT DefineAccessControlList-Response + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( getAccessControlListAttributes ), +, getAccessControlListAttributes + [83] IMPLICIT GetAccessControlListAttributes-Response + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( reportAccessControlledObjects ), +, reportAccessControlledObjects + [84] IMPLICIT ReportAccessControlledObjects-Response + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( deleteAccessControlList ), +, deleteAccessControlList + [85] IMPLICIT DeleteAccessControlList-Response + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( changeAccessControl ), +, changeAccessControl + [86] IMPLICIT ChangeAccessControl-Response + -- Shall not appear in minor version 1 or 2 +ENDIF + ,... + } + + AdditionalService-Response ::= CHOICE { +IF ( csr ) +IF ( vMDStop ) + vMDStop + [0] IMPLICIT VMDStop-Response +ELSE + vMDStop + [0] IMPLICIT RejectPDU +ENDIF +IF ( vMDReset ) +, vMDReset + [1] IMPLICIT VMDReset-Response +ELSE +, vMDReset + [1] IMPLICIT RejectPDU +ENDIF +IF ( select ) +, select + [2] IMPLICIT Select-Response +ELSE +, select + [2] IMPLICIT RejectPDU +ENDIF +IF ( alterProgramInvocationAttributes ) +, alterPI + [3] IMPLICIT AlterProgramInvocationAttributes-Response +ELSE +, alterPI + [3] IMPLICIT RejectPDU +ENDIF +ELSE +, vMDStop + [0] IMPLICIT RejectPDU, + vMDReset + [1] IMPLICIT RejectPDU, + select + [2] IMPLICIT RejectPDU, + alterPI + [3] IMPLICIT RejectPDU +ENDIF +IF ( cspi ) +IF ( initiateUnitControlLoad ) +, initiateUCLoad + [4] IMPLICIT InitiateUnitControlLoad-Response +ELSE +, initiateUCLoad + [4] IMPLICIT RejectPDU +ENDIF +IF ( unitControlLoadSegment ) +, uCLoad + [5] IMPLICIT UnitControlLoadSegment-Response +ELSE +, uCLoad + [5] IMPLICIT RejectPDU +ENDIF +IF ( unitControlUpload ) +, uCUpload + [6] IMPLICIT UnitControlUpload-Response +ELSE +, uCUpload + [6] IMPLICIT RejectPDU +ENDIF +IF ( startUnitControl ) +, startUC + [7] IMPLICIT StartUnitControl-Response +ELSE +, startUC + [7] IMPLICIT RejectPDU +ENDIF +IF ( stopUnitControl ) +, stopUC + [8] IMPLICIT StopUnitControl-Response +ELSE +, stopUC + [8] IMPLICIT RejectPDU +ENDIF +IF ( createUnitControl ) +, createUC + [9] IMPLICIT CreateUnitControl-Response +ELSE +, createUC + [9] IMPLICIT RejectPDU +ENDIF +IF ( addToUnitControl ) +, addToUC + [10] IMPLICIT AddToUnitControl-Response +ELSE +, addToUC + [10] IMPLICIT RejectPDU +ENDIF +IF ( removeFromUnitControl ) +, removeFromUC + [11] IMPLICIT RemoveFromUnitControl-Response +ELSE +, removeFromUC + [11] IMPLICIT RejectPDU +ENDIF +IF ( getUnitControlAttributes ) +, getUCAttributes + [12] IMPLICIT GetUnitControlAttributes-Response +ELSE +, getUCAttributes + [12] IMPLICIT RejectPDU +ENDIF +IF ( loadUnitControlFromFile ) +, loadUCFromFile + [13] IMPLICIT LoadUnitControlFromFile-Response +ELSE +, loadUCFromFile + [13] IMPLICIT RejectPDU +ENDIF +IF ( storeUnitControlToFile ) +, storeUCToFile + [14] IMPLICIT StoreUnitControlToFile-Response +ELSE +, storeUCToFile + [14] IMPLICIT RejectPDU +ENDIF +IF ( deleteUnitControl ) +, deleteUC + [15] IMPLICIT DeleteUnitControl-Response +ELSE +, deleteUC + [15] IMPLICIT RejectPDU +ENDIF +IF ( defineEventConditionList ) +, defineECL + [16] IMPLICIT DefineEventConditionList-Response +ELSE +, defineECL + [16] IMPLICIT RejectPDU +ENDIF +IF ( deleteEventConditionList ) +, deleteECL + [17] IMPLICIT DeleteEventConditionList-Response +ELSE +, deleteECL + [17] IMPLICIT RejectPDU +ENDIF +IF ( addEventConditionListReference ) +, addECLReference + [18] IMPLICIT AddEventConditionListReference-Response +ELSE +, addECLReference + [18] IMPLICIT RejectPDU +ENDIF +IF ( removeEventConditionListReference ) +, removeECLReference + [19] IMPLICIT RemoveEventConditionListReference-Response +ELSE +, removeECLReference + [19] IMPLICIT RejectPDU +ENDIF +IF ( getEventConditionListAttributes ) +, getECLAttributes + [20] IMPLICIT GetEventConditionListAttributes-Response +ELSE +, getECLAttributes + [20] IMPLICIT RejectPDU +ENDIF +IF ( reportEventConditionListStatus ) +, reportECLStatus + [21] IMPLICIT ReportEventConditionListStatus-Response +ELSE +, reportECLStatus + [21] IMPLICIT RejectPDU +ENDIF +IF ( alterEventConditionListMonitoring ) +, alterECLMonitoring + [22] IMPLICIT AlterEventConditionListMonitoring-Response +ELSE +, alterECLMonitoring + [22] IMPLICIT RejectPDU +ENDIF +ELSE +, initiateUCLoad + [4] IMPLICIT RejectPDU, + uCLoad + [5] IMPLICIT RejectPDU, + uCUpload + [6] IMPLICIT RejectPDU, + startUC + [7] IMPLICIT RejectPDU, + stopUC + [8] IMPLICIT RejectPDU, + createUC + [9] IMPLICIT RejectPDU, + addToUC + [10] IMPLICIT RejectPDU, + removeFromUC + [11] IMPLICIT RejectPDU, + getUCAttributes + [12] IMPLICIT RejectPDU, + loadUCFromFile + [13] IMPLICIT RejectPDU, + storeUCToFile + [14] IMPLICIT RejectPDU, + deleteUC + [15] IMPLICIT RejectPDU, + defineECL + [16] IMPLICIT RejectPDU, + deleteECL + [17] IMPLICIT RejectPDU, + addECLReference + [18] IMPLICIT RejectPDU, + removeECLReference + [19] IMPLICIT RejectPDU, + getECLAttributes + [20] IMPLICIT RejectPDU, + reportECLStatus + [21] IMPLICIT RejectPDU, + alterECLMonitoring + [22] IMPLICIT RejectPDU +ENDIF + } + + Response-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceResponse does not match any of the tags below + otherRequests NULL +IF ( status ) +, status + [0] CS-Status-Response +ENDIF +IF ( getProgramInvocationAttributes ) +, getProgramInvocationAttributes + [45] IMPLICIT CS-GetProgramInvocationAttributes-Response +ENDIF +IF ( getEventConditionAttributes ) +, getEventConditionAttributes + [49] IMPLICIT CS-GetEventConditionAttributes-Response +ENDIF + } + + Confirmed-ErrorPDU ::= SEQUENCE { + invokeID [0] IMPLICIT Unsigned32, +IF ( attachToEventCondition attachToSemaphore ) + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, +ENDIF + serviceError [2] IMPLICIT ServiceError + } + + ServiceError ::= SEQUENCE { + errorClass [0] CHOICE { + vmd-state [0] IMPLICIT INTEGER { + other (0), + vmd-state-conflict (1), + vmd-operational-problem (2), + domain-transfer-problem (3), + state-machine-id-invalid (4) + } (0..4), + application-reference [1] IMPLICIT INTEGER { + other (0), + application-unreachable (1), + connection-lost (2), + application-reference-invalid (3), + context-unsupported (4) + } (0..4), + definition [2] IMPLICIT INTEGER { + other (0), + object-undefined (1), + invalid-address (2), + type-unsupported (3), + type-inconsistent (4), + object-exists (5), + object-attribute-inconsistent (6) + } (0..6), + resource [3] IMPLICIT INTEGER { + other (0), + memory-unavailable (1), + processor-resource-unavailable (2), + mass-storage-unavailable (3), + capability-unavailable (4), + capability-unknown (5) + } (0..5), + service [4] IMPLICIT INTEGER { + other (0), + primitives-out-of-sequence (1), + object-state-conflict (2), + -- Value 3 reserved for further definition + continuation-invalid (4), + object-constraint-conflict (5) + } (0..5), + service-preempt [5] IMPLICIT INTEGER { + other (0), + timeout (1), + deadlock (2), + cancel (3) + } (0..3), + time-resolution [6] IMPLICIT INTEGER { + other (0), + unsupportable-time-resolution (1) + } (0..1), + access [7] IMPLICIT INTEGER { + other (0), + object-access-unsupported (1), + object-non-existent (2), + object-access-denied (3), + object-invalidated (4) + } (0..4), + initiate [8] IMPLICIT INTEGER { + other (0), + -- Values 1 and 2 are reserved for further definition + max-services-outstanding-calling-insufficient (3), + max-services-outstanding-called-insufficient (4), + service-CBB-insufficient (5), + parameter-CBB-insufficient (6), + nesting-level-insufficient (7) + } (0..7), + conclude [9] IMPLICIT INTEGER { + other (0), + further-communication-required (1) + } (0..1) +IF ( cancel ) +, cancel [10] IMPLICIT INTEGER { + other (0), + invoke-id-unknown (1), + cancel-not-possible (2) + } (0..2) +ELSE +, cancel [10] IMPLICIT NULL +ENDIF +IF ( fileOpen fileClose fileRead fileRename fileDelete fileDirectory obtainFile ) +, file [11] IMPLICIT INTEGER { + other (0), + filename-ambiguous (1), + file-busy (2), + filename-syntax-error (3), + content-type-invalid (4), + position-invalid (5), + file-access-denied (6), + file-non-existent (7), + duplicate-filename (8), + insufficient-space-in-filestore (9) + } (0..9) +ELSE +, file [11] IMPLICIT NULL +ENDIF +, others [12] IMPLICIT INTEGER + } , + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInfo [3] CHOICE { +IF ( obtainFile ) + obtainFile [0] IMPLICIT ObtainFile-Error +ELSE + obtainFile [0] IMPLICIT NULL +ENDIF +IF ( start ) +, start [1] IMPLICIT Start-Error +ELSE +, start [1] IMPLICIT NULL +ENDIF +IF ( stop ) +, stop [2] IMPLICIT Stop-Error +ELSE +, stop [2] IMPLICIT NULL +ENDIF +IF ( resume ) +, resume [3] IMPLICIT Resume-Error +ELSE +, resume [3] IMPLICIT NULL +ENDIF +IF ( reset ) +, reset [4] IMPLICIT Reset-Error +ELSE +, reset [4] IMPLICIT NULL +ENDIF +IF ( deleteVariableAccess ) +, deleteVariableAccess [5] IMPLICIT DeleteVariableAccess-Error +ELSE +, deleteVariableAccess [5] IMPLICIT NULL +ENDIF +IF ( deleteNamedVariableList ) +, deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList-Error +ELSE +, deleteNamedVariableList [6] IMPLICIT NULL +ENDIF +IF ( deleteNamedType ) +, deleteNamedType [7] IMPLICIT DeleteNamedType-Error +ELSE +, deleteNamedType [7] IMPLICIT NULL +ENDIF +IF ( defineEventEnrollment ) + , defineEventEnrollment-Error [8] DefineEventEnrollment-Error +ELSE + , defineEventEnrollment-Error [8] IMPLICIT NULL +ENDIF + -- [9] Reserved for use by annex D +IF ( fileRename ) +, fileRename [9] IMPLICIT FileRename-Error +ELSE +, fileRename [9] IMPLICIT NULL +ENDIF +IF ( csr cspi ) +, additionalService [10] AdditionalService-Error +ELSE +, additionalService [10] IMPLICIT NULL +ENDIF +IF ( changeAccessControl ) +, changeAccessControl [11] IMPLICIT ChangeAccessControl-Error +ELSE + changeAccessControl 11] IMPLICIT NULL +ENDIF + } OPTIONAL + } + + AdditionalService-Error ::= CHOICE { +IF ( defineEventConditionList ) + defineEcl [0] DefineEventConditionList-Error +ELSE + defineEcl [0] IMPLICIT NULL +ENDIF +IF ( addEventConditionListReference ) +, addECLReference [1] AddEventConditionListReference-Error +ELSE +, addECLReference [1] IMPLICIT NULL +ENDIF +IF ( removeEventConditionListReference ) +, removeECLReference [2] RemoveEventConditionListReference-Error +ELSE +, removeECLReference [2] IMPLICIT NULL +ENDIF +IF ( initiateUnitControlLoad ) +, initiateUC [3] InitiateUnitControl-Error +ELSE +, initiateUC [3] IMPLICIT NULL +ENDIF +IF ( startUnitControl ) +, startUC [4] IMPLICIT StartUnitControl-Error +ELSE +, startUC [4] IMPLICIT NULL +ENDIF +IF ( stopUnitControl ) +, stopUC [5] IMPLICIT StopUnitControl-Error +ELSE +, stopUC [5] IMPLICIT NULL +ENDIF +IF ( deleteUnitControl ) +, deleteUC [6] DeleteUnitControl-Error +ELSE +, deleteUC [6] IMPLICIT NULL +ENDIF +IF ( loadUnitControlFromFile ) +, loadUCFromFile [7] LoadUnitControlFromFile-Error +ELSE +, loadUCFromFile [7] IMPLICIT NULL +ENDIF + } + + TimeOfDay ::= OCTET STRING (SIZE(4|6)) + + maxIdentifier INTEGER ::= 32 + +Identifier ::= +IF (char) + UTF8String (SIZE(1..maxIdentifier)) +ELSE + VisibleString ( FROM + ("A"|"a"|"B"|"b"|"C"|"c"|"D"|"d"|"E"|"e"|"F"|"f"| + "G"|"g"|"H"|"h"|"I"|"i"|"J"|"j"|"K"|"k"|"L"|"l"| + "M"|"m"|"N"|"n"|"O"|"o"|"P"|"p"|"Q"|"q"|"R"|"r"| + "S"|"s"|"T"|"t"|"U"|"u"|"V"|"v"|"W"|"w"|"X"|"x"| + "Y"|"y"|"Z"|"z"|"$"|"_"|"0"|"1"|"2"|"3"|"4"|"5"| + "6"|"7"|"8"|"9") ) (SIZE(1..maxIdentifier)) +ENDIF + + Integer8 ::= INTEGER(-128..127) -- range -128 <= i <= 127 + + Integer16 ::= INTEGER(-32768..32767) -- range -32,768 <= i <= 32,767 + + Integer32 ::= INTEGER(-2147483648..2147483647) -- range -2**31 <= i <= 2**31 - 1 + + Unsigned8 ::= INTEGER(0..127) -- range 0 <= i <= 127 + + Unsigned16 ::= INTEGER(0..32767) -- range 0 <= i <= 32767 + + Unsigned32 ::= INTEGER(0..2147483647) -- range 0 <= i <= 2**31 - 1 + + ObjectName ::= CHOICE { + vmd-specific [0] IMPLICIT Identifier, + domain-specific [1] IMPLICIT SEQUENCE { + domainID Identifier, + itemID Identifier + }, + aa-specific [2] IMPLICIT Identifier + } + + ObjectClass ::= CHOICE { + basicObjectClass [0] IMPLICIT INTEGER { +IF ( vnam ) + namedVariable (0) +ENDIF + -- value 1 is reserved for definition in Annex E +IF ( vsca ) +, scatteredAccess (1) +ENDIF +IF ( vlis ) +, namedVariableList (2) +ENDIF +IF ( vnam ) +, namedType (3) +ENDIF +, semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11), + dataExchange (12), + -- Shall not appear in minor version 1 + accessControlList (13) + -- Shall not appear in minor version 1 or 2 + } (0..13), + ... +IF ( cspi ) +, csObjectClass [1] IMPLICIT INTEGER { + eventConditionList (0), + unitControl (1) } (0..1) +ENDIF + } + + MMSString ::= +IF ( char ) + UTF8String +ELSE + VisibleString +ENDIF + + MMS255String ::= +IF ( char ) + UTF8String (SIZE(1..255)) +ELSE + VisibleString (SIZE(1..255)) +ENDIF + + FileName ::= SEQUENCE OF GraphicString + + Initiate-RequestPDU ::= SEQUENCE { + + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initRequestDetail [4] IMPLICIT SEQUENCE { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions , + ... +IF (csr cspi) +, additionalSupportedCalling [3] IMPLICIT AdditionalSupportOptions +ENDIF +IF (cspi) +, additionalCbbSupportedCalling [4] IMPLICIT AdditionalCBBOptions, + privilegeClassIdentityCalling [5] IMPLICIT VisibleString +ENDIF + } + } + + Initiate-ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initResponseDetail [4] IMPLICIT SEQUENCE { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions, + ... +IF (csr cspi) +, additionalSupportedCalled [3] IMPLICIT AdditionalSupportOptions +ENDIF +IF (cspi ) +, additionalCbbSupportedCalled [4] IMPLICIT AdditionalCBBOptions, + privilegeClassIdentityCalled [5] IMPLICIT VisibleString +ENDIF + } + } + + Initiate-ErrorPDU ::= ServiceError + + Conclude-RequestPDU ::= NULL + + Conclude-ResponsePDU ::= NULL + + Conclude-ErrorPDU ::= ServiceError + + Cancel-RequestPDU ::= Unsigned32 -- originalInvokeID + + Cancel-ResponsePDU ::= Unsigned32 -- originalInvokeID + + Cancel-ErrorPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError + } + + RejectPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE { + confirmed-requestPDU [1] IMPLICIT INTEGER { + other (0), + unrecognized-service (1), + unrecognized-modifier (2), + invalid-invokeID (3), + invalid-argument (4), + invalid-modifier (5), + max-serv-outstanding-exceeded (6), + -- Value 7 reserved for further definition + max-recursion-exceeded (8), + value-out-of-range (9) + } (0..9), + confirmed-responsePDU [2] IMPLICIT INTEGER { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-result (3), + -- Value 4 reserved for further definition + max-recursion-exceeded (5), + value-out-of-range (6) + } (0..6), + confirmed-errorPDU [3] IMPLICIT INTEGER { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-serviceError (3), + value-out-of-range (4) + } (0..4), + unconfirmedPDU [4] IMPLICIT INTEGER { + other (0), + unrecognized-service (1), + invalid-argument (2), + max-recursion-exceeded (3), + value-out-of-range (4) + } (0..4), + pdu-error [5] IMPLICIT INTEGER { + unknown-pdu-type (0), + invalid-pdu (1), + illegal-acse-mapping (2) + }, +IF ( cancel ) + cancel-requestPDU [6] IMPLICIT INTEGER { + other (0), + invalid-invokeID (1) + } (0..1), + cancel-responsePDU [7] IMPLICIT INTEGER { + other (0), + invalid-invokeID (1) + } (0..1), + cancel-errorPDU [8] IMPLICIT INTEGER { + other (0), + invalid-invokeID (1), + invalid-serviceError (2), + value-out-of-range (3) + } (0..3), +ELSE + cancel-requestPDU [6] IMPLICIT NULL, + cancel-responsePDU [7] IMPLICIT NULL, + cancel-errorPDU [8] IMPLICIT NULL, +ENDIF + conclude-requestPDU [9] IMPLICIT INTEGER { + other (0), + invalid-argument (1) + } (0..1), + conclude-responsePDU [10] IMPLICIT INTEGER { + other (0), + invalid-result (1) + } (0..1), + conclude-errorPDU [11] IMPLICIT INTEGER { + other (0), + invalid-serviceError (1), + value-out-of-range (2) + } (0..2) + } + } + + DefineAccessControlList-Request ::= SEQUENCE { + accessControlListName [0] IMPLICIT Identifier, + accessControlListElements [1] IMPLICIT SEQUENCE { + readAccessCondition [0] AccessCondition OPTIONAL, + storeAccessCondition [1] AccessCondition OPTIONAL, + writeAccessCondition [2] AccessCondition OPTIONAL, + loadAccessCondition [3] AccessCondition OPTIONAL, + executeAccessCondition [4] AccessCondition OPTIONAL, + deleteAccessCondition [5] AccessCondition OPTIONAL, + editAccessCondition [6] AccessCondition OPTIONAL + } + } + + DefineAccessControlList-Response ::= NULL + + GetAccessControlListAttributes-Request ::= CHOICE { + accessControlListName [0] IMPLICIT Identifier, + vMD [1] IMPLICIT NULL, + namedObject [2] IMPLICIT SEQUENCE { + objectClass [0] ObjectClass, + objectName [1] ObjectName + } + } + + GetAccessControlListAttributes-Response ::= SEQUENCE { + name [0] Identifier, + accessControlListElements [1] IMPLICIT SEQUENCE { + readAccessCondition [0] AccessCondition OPTIONAL, + storeAccessCondition [1] AccessCondition OPTIONAL, + writeAccessCondition [2] AccessCondition OPTIONAL, + loadAccessCondition [3] AccessCondition OPTIONAL, + executeAccessCondition [4] AccessCondition OPTIONAL, + deleteAccessCondition [5] AccessCondition OPTIONAL, + editAccessCondition [6] AccessCondition OPTIONAL + }, + vMDuse [2] IMPLICIT BOOLEAN, + references [3] IMPLICIT SEQUENCE OF SEQUENCE { + objectClass [0] ObjectClass, + objectCount [1] IMPLICIT INTEGER + } +IF ( aco ) +, accessControlList [4] IMPLICIT Identifier OPTIONAL + -- shall be included if and only if + -- aco has been negotiated +ENDIF + } + + ReportAccessControlledObjects-Request ::= SEQUENCE { + accessControlList [0] IMPLICIT Identifier, + objectClass [1] ObjectClass, + continueAfter [2] ObjectName OPTIONAL + } + +ReportAccessControlledObjects-Response ::= SEQUENCE { + listOfNames [0] IMPLICIT SEQUENCE OF ObjectName, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + DeleteAccessControlList-Request ::= Identifier + -- Name of Access Control List Object + + DeleteAccessControlList-Response ::= NULL + + ChangeAccessControl-Request ::= SEQUENCE { + scopeOfChange CHOICE { + vMDOnly [0] IMPLICIT NULL, + listOfObjects [1] IMPLICIT SEQUENCE { + objectClass [0] ObjectClass, + objectScope [1] CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + -- Names of the objects (of class objectClass) + -- whose access is to be changed + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + -- Name of the Domain whose elements + -- are to be changed + vmd [3] IMPLICIT NULL + } + } + }, + accessControlListName [2] IMPLICIT Identifier + -- name of the AccessControlList Object that contains + -- the conditions for access control + } + + ChangeAccessControl-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberChanged [1] IMPLICIT Unsigned32 + } + + ChangeAccessControl-Error ::= Unsigned32 + + StatusResponse ::= SEQUENCE { + vmdLogicalStatus [0] IMPLICIT INTEGER { + state-changes-allowed (0), + no-state-changes-allowed (1), + limited-services-permitted (2), + support-services-allowed (3) + } (0..3), + vmdPhysicalStatus [1] IMPLICIT INTEGER { + operational (0), + partially-operational (1), + inoperable (2), + needs-commissioning (3) + } (0..3), + localDetail [2] IMPLICIT BIT STRING (SIZE(0..128)) OPTIONAL + } + + CS-Status-Response ::= CHOICE { +IF ( csr ) + fullResponse SEQUENCE { + operationState [0] IMPLICIT OperationState, + extendedStatus [1] IMPLICIT ExtendedStatus, + extendedStatusMask [2] IMPLICIT ExtendedStatus DEFAULT '1111'B, + selectedProgramInvocation CHOICE { + programInvocation [3] IMPLICIT Identifier, + noneSelected [4] IMPLICIT NULL } } +ENDIF +IF ( csr cspi ) +, +ENDIF +IF ( cspi ) + noExtraResponse NULL +ENDIF + } + + OperationState ::= INTEGER { + idle (0), + loaded (1), + ready (2), + executing (3), + motion-paused (4), + manualInterventionRequired (5) } (0..5) + + ExtendedStatus ::= BIT STRING { + safetyInterlocksViolated (0), + anyPhysicalResourcePowerOn (1), + allPhysicalResourcesCalibrated (2), + localControl (3) } (SIZE(4)) + + Status-Request ::= BOOLEAN -- Extended Derivation + + Status-Response ::= StatusResponse + + UnsolicitedStatus ::= StatusResponse + + GetNameList-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + objectScope [1] CHOICE { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL }, + continueAfter [2] IMPLICIT Identifier OPTIONAL } + + GetNameList-Response ::= SEQUENCE { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + Identify-Request ::= NULL + + Identify-Response ::= SEQUENCE { + vendorName [0] IMPLICIT MMSString, + modelName [1] IMPLICIT MMSString, + revision [2] IMPLICIT MMSString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL + } + + Rename-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier } + + Rename-Response ::= NULL + + GetCapabilityList-Request ::= SEQUENCE { + continueAfter MMSString OPTIONAL + } + + GetCapabilityList-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF MMSString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + VMDStop-Request ::= NULL + + VMDStop-Response ::= NULL + + VMDReset-Request ::= BOOLEAN -- Extended Derivation + + VMDReset-Response ::= StatusResponse + + InitiateDownloadSequence-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString, + sharable [2] IMPLICIT BOOLEAN } + + InitiateDownloadSequence-Response ::= NULL + + DownloadSegment-Request ::= Identifier -- Domain Name + + DownloadSegment-Response ::= SEQUENCE { + loadData LoadData, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + LoadData ::= CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL, + embedded EMBEDDED PDV } + + TerminateDownloadSequence-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL } + + TerminateDownloadSequence-Response ::= NULL + + InitiateUploadSequence-Request ::= Identifier -- Domain Name + + InitiateUploadSequence-Response ::= SEQUENCE { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString } + + UploadSegment-Request ::= Integer32 -- ULSM ID + + UploadSegment-Response ::= SEQUENCE { + loadData LoadData, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + TerminateUploadSequence-Request ::= Integer32 -- ULSM ID + + TerminateUploadSequence-Response ::= NULL + + RequestDomainDownload-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName } + + RequestDomainDownload-Response ::= NULL + + RequestDomainUpload-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName } + + RequestDomainUpload-Response ::= NULL + + LoadDomainContent-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName +IF ( tpy ) +, thirdParty [5] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + LoadDomainContent-Response ::= NULL + + StoreDomainContent-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName +IF ( tpy ) +, thirdParty [2] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + StoreDomainContent-Response ::= NULL + + DeleteDomain-Request ::= Identifier -- Domain Name + + DeleteDomain-Response ::= NULL + + GetDomainAttributes-Request ::= Identifier -- Domain Name + + GetDomainAttributes-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF MMSString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, + -- Program Invocation Names + uploadInProgress [5] IMPLICIT Integer8 +IF ( aco ) +, accessControlList [6] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + CreateProgramInvocation-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE +IF ( eventNotification ) +IF ( getProgramInvocationAttributes ) +, monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring, + -- FALSE indicates CURRENT monitoring +ENDIF +ENDIF + } + + CreateProgramInvocation-Response ::= NULL + + CS-CreateProgramInvocation-Request ::= INTEGER { + normal (0), + controlling (1), + controlled (2) + } (0..2) + + DeleteProgramInvocation-Request ::= Identifier -- Program Invocation Name + + DeleteProgramInvocation-Response ::= NULL + + Start-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + embeddedString EMBEDDED PDV } OPTIONAL } + + Start-Response ::= NULL + + Start-Error ::= ProgramInvocationState + + CS-Start-Request ::= [0] CHOICE { + normal NULL, + controlling SEQUENCE { + startLocation [0] IMPLICIT VisibleString OPTIONAL, + startCount [1] StartCount DEFAULT cycleCount: 1 + } } + + StartCount ::= CHOICE { + noLimit [0] IMPLICIT NULL, + cycleCount [1] IMPLICIT INTEGER, + stepCount [2] IMPLICIT INTEGER } + + Stop-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier } + + Stop-Response ::= NULL + + Stop-Error ::= ProgramInvocationState + + Resume-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV } OPTIONAL + } + + Resume-Response ::= NULL + + Resume-Error ::= ProgramInvocationState + + CS-Resume-Request ::= [0] CHOICE { + normal NULL, + controlling SEQUENCE { + modeType CHOICE { + continueMode [0] IMPLICIT NULL, + changeMode [1] StartCount + } } } + + Reset-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier } + + Reset-Response ::= NULL + + Reset-Error ::= ProgramInvocationState + + Kill-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier } + + Kill-Response ::= NULL + + GetProgramInvocationAttributes-Request ::= Identifier -- Program Invocation Name + + GetProgramInvocationAttributes-Response ::= SEQUENCE { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + executionArgument CHOICE { + simpleString [5] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV } +IF ( aco ) +, accessControlList [6] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + CS-GetProgramInvocationAttributes-Response ::= SEQUENCE { + errorCode [0] IMPLICIT INTEGER, + control [1] CHOICE { + controlling [0] IMPLICIT SEQUENCE { + controlledPI [0] IMPLICIT SEQUENCE OF Identifier, + programLocation [1] IMPLICIT VisibleString OPTIONAL, + runningMode [2] CHOICE { + freeRunning [0] IMPLICIT NULL, + cycleLimited [1] IMPLICIT INTEGER, + stepLimited [2] IMPLICIT INTEGER } + }, + controlled [1] CHOICE { + controllingPI [0] IMPLICIT Identifier, + none [1] IMPLICIT NULL + }, + normal [2] IMPLICIT NULL } } + + Select-Request ::= SEQUENCE { + controlling [0] IMPLICIT Identifier OPTIONAL, + controlled [1] IMPLICIT SEQUENCE OF Identifier OPTIONAL + -- this field shall appear if and only if the controlling field is included + } + + Select-Response ::= NULL + + AlterProgramInvocationAttributes-Request ::= SEQUENCE { + programInvocation [0] IMPLICIT Identifier, + startCount [1] StartCount DEFAULT cycleCount: 1 } + + AlterProgramInvocationAttributes-Response ::= NULL + + ReconfigureProgramInvocation-Request ::= SEQUENCE { + oldProgramInvocationName [0] IMPLICIT Identifier, + newProgramInvocationName [1] IMPLICIT Identifier OPTIONAL, + domainsToAdd [2] IMPLICIT SEQUENCE OF Identifier, + domainsToRemove [3] IMPLICIT SEQUENCE OF Identifier } + + ReconfigureProgramInvocation-Response ::= NULL + + ControlElement ::= CHOICE { + beginDomainDef [0] SEQUENCE { + domainName [1] IMPLICIT Identifier, + capabilities [2] IMPLICIT SEQUENCE OF MMSString, + sharable [3] IMPLICIT BOOLEAN, + loadData [4] LoadData OPTIONAL + }, + continueDomainDef [1] SEQUENCE { + domainName [1] IMPLICIT Identifier, + loadData [3] LoadData + }, + endDomainDef [2] IMPLICIT Identifier, + piDefinition [3] IMPLICIT SEQUENCE { + piName [0] IMPLICIT Identifier, + listOfDomains [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL, + pIState [4] IMPLICIT ProgramInvocationState OPTIONAL + } } + + InitiateUnitControlLoad-Request ::= Identifier -- Unit Control Name + + InitiateUnitControlLoad-Response ::= NULL + + InitiateUnitControl-Error ::= CHOICE { + domain [0] IMPLICIT Identifier, + programInvocation [1] IMPLICIT Identifier + } + + UnitControlLoadSegment-Request ::= Identifier -- Unit Control Name + + UnitControlLoadSegment-Response ::= SEQUENCE { + controlElements [0] IMPLICIT SEQUENCE OF ControlElement, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + UnitControlUpload-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, -- Unit Control Name + continueAfter CHOICE { + domain [1] IMPLICIT Identifier, + ulsmID [2] IMPLICIT INTEGER, + programInvocation [3] IMPLICIT Identifier } OPTIONAL + } + + UnitControlUpload-Response ::= SEQUENCE { + controlElements [0] IMPLICIT SEQUENCE OF ControlElement, + nextElement CHOICE { + domain [1] IMPLICIT Identifier, + ulsmID [2] IMPLICIT INTEGER, + programInvocation [3] IMPLICIT Identifier } OPTIONAL + } + + StartUnitControl-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, -- Unit Control Name + executionArgument CHOICE { + simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV } OPTIONAL + } + + StartUnitControl-Response ::= NULL + + StartUnitControl-Error ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + programInvocationState [1] IMPLICIT ProgramInvocationState } + + StopUnitControl-Request ::= Identifier -- Unit Control Name + + StopUnitControl-Response ::= NULL + + StopUnitControl-Error ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + programInvocationState [1] IMPLICIT ProgramInvocationState } + + CreateUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier } + + CreateUnitControl-Response ::= NULL + + AddToUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier } + + AddToUnitControl-Response ::= NULL + + RemoveFromUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier } + + RemoveFromUnitControl-Response ::= NULL + + GetUnitControlAttributes-Request ::= Identifier -- Unit Control Name + + GetUnitControlAttributes-Response ::= SEQUENCE { + domains [0] IMPLICIT SEQUENCE OF Identifier, + programInvocations [1] IMPLICIT SEQUENCE OF Identifier } + + LoadUnitControlFromFile-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName +IF ( tpy ) +, thirdParty [2] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + LoadUnitControlFromFile-Response ::= NULL + + LoadUnitControlFromFile-Error ::= CHOICE { + none [0] IMPLICIT NULL, + domain [1] IMPLICIT Identifier, + programInvocation [2] IMPLICIT Identifier + } + + StoreUnitControlToFile-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName +IF ( tpy ) +, thirdParty [2] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + StoreUnitControlToFile-Response ::= NULL + + DeleteUnitControl-Request ::= Identifier -- Unit Control Name + + DeleteUnitControl-Response ::= NULL + + DeleteUnitControl-Error ::= CHOICE { + domain [0] IMPLICIT Identifier, + programInvocation [1] IMPLICIT Identifier } + + TypeSpecification ::= CHOICE { + typeName [0] ObjectName, + typeDescription TypeDescription } + + AlternateAccess ::= SEQUENCE OF CHOICE { + unnamed AlternateAccessSelection +IF ( str2 ) +, named [5] IMPLICIT SEQUENCE { + componentName [0] IMPLICIT Identifier, + access AlternateAccessSelection } +ENDIF + } + + AlternateAccessSelection ::= CHOICE { + selectAlternateAccess [0] IMPLICIT SEQUENCE { + accessSelection CHOICE { +IF ( str2 ) + component [0] IMPLICIT Identifier, +ELSE + component [0] IMPLICIT NULL, +ENDIF +IF ( str1 ) + index [1] IMPLICIT Unsigned32, + indexRange [2] IMPLICIT SEQUENCE { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, +ELSE + index [1] IMPLICIT NULL, + indexRange [2] IMPLICIT NULL, +ENDIF + allElements [3] IMPLICIT NULL + }, + alternateAccess AlternateAccess + }, + selectAccess CHOICE { +IF ( str2 ) + component [1] IMPLICIT Identifier, +ELSE + component [1] IMPLICIT NULL, +ENDIF +IF ( str1 ) + index [2] IMPLICIT Unsigned32, + indexRange [3] IMPLICIT SEQUENCE { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, +ELSE + index [2] IMPLICIT NULL, + indexRange [3] IMPLICIT NULL, +ENDIF + allElements [4] IMPLICIT NULL + } } + + AccessResult ::= CHOICE { + failure [0] IMPLICIT DataAccessError, + success Data } + + Data ::= CHOICE { + -- context tag 0 is reserved for AccessResult +IF ( str1 ) + array [1] IMPLICIT SEQUENCE OF Data, +ELSE + array [1] IMPLICIT NULL, +ENDIF +IF ( str2 ) + structure [2] IMPLICIT SEQUENCE OF Data, +ELSE + structure [2] IMPLICIT NULL, +ENDIF + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, -- shall not be negative + floating-point [7] IMPLICIT FloatingPoint, + -- [8] is reserved + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + generalized-time [11] IMPLICIT GeneralizedTime, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, -- shall not be negative + booleanArray [14] IMPLICIT BIT STRING, + objId [15] IMPLICIT OBJECT IDENTIFIER, + ..., + mMSString [16] IMPLICIT MMSString + } + + FloatingPoint ::= OCTET STRING + + DataAccessError ::= INTEGER { + object-invalidated (0), + hardware-fault (1), + temporarily-unavailable (2), + object-access-denied (3), + object-undefined (4), + invalid-address (5), + type-unsupported (6), + type-inconsistent (7), + object-attribute-inconsistent (8), + object-access-unsupported (9), + object-non-existent (10), + object-value-invalid (11) + } (0..11) + + VariableAccessSpecification ::= CHOICE { + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, +IF ( valt ) + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL +ENDIF + } +IF ( vlis ) +, variableListName [1] ObjectName +ENDIF + } + + VariableSpecification ::= CHOICE { +IF ( vnam ) + name [0] ObjectName, +ENDIF +IF ( vadr ) + address [1] Address, + variableDescription [2] IMPLICIT SEQUENCE { + address Address, + typeSpecification TypeSpecification + }, +ENDIF + -- the following element is only present to support the services + -- defined in annex E +IF ( vsca ) + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, +ELSE + scatteredAccessDescription [3] IMPLICIT NULL, +ENDIF + invalidated [4] IMPLICIT NULL + } + + Read-Request ::= SEQUENCE { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification } + + Read-Response ::= SEQUENCE { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult } + + Write-Request ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data } + + Write-Response ::= SEQUENCE OF CHOICE { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL } + + InformationReport ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult } + + GetVariableAccessAttributes-Request ::= CHOICE { +IF ( vnam ) + name [0] ObjectName +IF ( vadr ) +, +ENDIF +IF ( vadr) + address [1] Address +ENDIF + } + + GetVariableAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, +IF ( vadr ) + address [1] Address OPTIONAL, +ENDIF + typeDescription [2] TypeDescription +IF ( aco ) +, accessControlList [3] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF +IF ( sem ) +, meaning [4] IMPLICIT VisibleString OPTIONAL +ENDIF + } + + DefineNamedVariable-Request ::= SEQUENCE { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL } + + DefineNamedVariable-Response ::= NULL + + DeleteVariableAccess-Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } (0..3) DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL } + + DeleteVariableAccess-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 } + + DeleteVariableAccess-Error ::= Unsigned32 -- numberDeleted + + DefineNamedVariableList-Request ::= SEQUENCE { + variableListName ObjectName, + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification +IF (valt) +, alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL +ENDIF + } } + + DefineNamedVariableList-Response ::= NULL + + GetNamedVariableListAttributes-Request ::= ObjectName -- VariableListName + + GetNamedVariableListAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification +IF ( valt ) +, alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL } +ENDIF +IF ( aco ) +, accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + DeleteNamedVariableList-Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } (0..3) DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL } + + DeleteNamedVariableList-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 } + + DeleteNamedVariableList-Error ::= Unsigned32 -- numberDeleted + + DefineNamedType-Request ::= SEQUENCE { + typeName ObjectName, + typeSpecification TypeSpecification } + + DefineNamedType-Response ::= NULL + + GetNamedTypeAttributes-Request ::= ObjectName --TypeName + + GetNamedTypeAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification +IF ( aco ) +, accessControlList [1] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF +IF ( sem ) +, meaning [4] IMPLICIT VisibleString OPTIONAL +ENDIF + } + + DeleteNamedType-Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } (0..3) DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL } + + DeleteNamedType-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + DeleteNamedType-Error ::= Unsigned32 -- numberDeleted + + ExchangeData-Request ::= SEQUENCE { + dataExchangeName [0] ObjectName, + listOfRequestData [1] IMPLICIT SEQUENCE OF Data } + + ExchangeData-Response ::= SEQUENCE { + listOfResponseData [0] IMPLICIT SEQUENCE OF Data } + + GetDataExchangeAttributes-Request ::= ObjectName + + GetDataExchangeAttributes-Response ::= SEQUENCE { + inUse [0] IMPLICIT BOOLEAN, + listOfRequestTypeDescriptions [1] IMPLICIT SEQUENCE OF TypeDescription, + listOfResponseTypeDescriptions [2] IMPLICIT SEQUENCE OF TypeDescription, + programInvocation [3] IMPLICIT Identifier OPTIONAL +IF (aco) +, accessControlList [4] IMPLICIT Identifier OPTIONAL +ENDIF + -- Shall not appear in minor version one or two + } + + TakeControl-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE +IF ( tpy ) +, applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + TakeControl-Response ::= CHOICE { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier } + + RelinquishControl-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL } + + RelinquishControl-Response ::= NULL + + DefineSemaphore-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + numberOfTokens [1] IMPLICIT Unsigned16 } + + DefineSemaphore-Response ::= NULL + + DeleteSemaphore-Request ::= ObjectName -- Semaphore Name + + DeleteSemaphore-Response ::= NULL + + ReportSemaphoreStatus-Request ::= ObjectName -- Semaphore Name + + ReportSemaphoreStatus-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER { + token (0), + pool (1) } (0..1), + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16 +IF (aco) +, accessControlList [5] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + ReportPoolSemaphoreStatus-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL } + + ReportPoolSemaphoreStatus-Response ::= SEQUENCE { + listOfNamedTokens [0] IMPLICIT SEQUENCE OF CHOICE { + freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + ReportSemaphoreEntryStatus-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + state [1] IMPLICIT INTEGER { + queued (0), + owner (1), + hung (2) } (0..2), + entryIDToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL } + + ReportSemaphoreEntryStatus-Response ::= SEQUENCE { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + SemaphoreEntry ::= SEQUENCE { + entryID [0] IMPLICIT OCTET STRING, + entryClass [1] IMPLICIT INTEGER { + simple (0), + modifier (1) } (0..1), + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT normalPriority, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE } + + AttachToSemaphore ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE } + + Input-Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, +IF (output) + listOfPromptData [2] IMPLICIT SEQUENCE OF MMSString OPTIONAL, +ENDIF + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL } + + Input-Response ::= MMSString -- Input String + + Output-Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF MMSString } + + Output-Response ::= NULL + + TriggerEvent-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL } + + TriggerEvent-Response ::= NULL + + EventNotification ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + severity [2] IMPLICIT Severity, + currentState [3] IMPLICIT EC-State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult [8] IMPLICIT SEQUENCE { + eventActionName ObjectName, + successOrFailure CHOICE { + success [0] IMPLICIT SEQUENCE { + confirmedServiceResponse ConfirmedServiceResponse +IF ( csr cspi ) +, cs-Response-Detail [79] Response-Detail OPTIONAL + -- shall not be transmitted if value is the + -- value of a tagged type derived from NULL +ENDIF + }, + failure [1] IMPLICIT SEQUENCE { + modifierPosition [0] IMPLICIT Unsigned32 OPTIONAL, + serviceError [1] IMPLICIT ServiceError } + } + } OPTIONAL + } + + CS-EventNotification ::= [0] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + + AcknowledgeEventNotification-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC-State, + timeOfAcknowledgedTransition [3] EventTime } + + AcknowledgeEventNotification-Response ::= NULL + + GetAlarmSummary-Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgementFilter [2] IMPLICIT INTEGER { + not-acked (0), + acked (1), + all (2) + } (0..2) DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 } + DEFAULT { mostSevere 0, leastSevere 127 }, + continueAfter [5] ObjectName OPTIONAL + } + + GetAlarmSummary-Response ::= SEQUENCE { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + AlarmSummary ::= SEQUENCE { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC-State, + unacknowledgedState [3] IMPLICIT INTEGER { + none (0), + active (1), + idle (2), + both (3) + } (0..3), +IF ( csr cspi ) + displayEnhancement [4] EN-Additional-Detail OPTIONAL, + -- shall not be transmitted if the value is NULL +ELSE + displayEnhancement [4] NULL, +ENDIF + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL } + + EN-Additional-Detail ::= [0] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + + GetAlarmEnrollmentSummary-Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgementFilter [2] IMPLICIT INTEGER { + not-acked (0), + acked (1), + all (2) + } (0..2) DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 } + DEFAULT { mostSevere 0, leastSevere 127 }, + continueAfter [5] ObjectName OPTIONAL + } + + GetAlarmEnrollmentSummary-Response ::= SEQUENCE { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF +AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + AlarmEnrollmentSummary ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, +IF ( tpy ) + clientApplication [2] ApplicationReference OPTIONAL, +ELSE + clientApplication [2] NULL, +ENDIF + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC-State, +IF ( cspi ) + displayEnhancement [5] EN-Additional-Detail OPTIONAL, + -- shall not be transmitted if the value is NULL +ELSE + displayEnhancement [5] NULL, +ENDIF + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule, + enrollmentState [8] IMPLICIT EE-State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL } + + AttachToEventCondition ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL } + + DefineEventCondition-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC-Class, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + severity [3] IMPLICIT Unsigned8 DEFAULT normalSeverity, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL } + + DefineEventCondition-Response ::= NULL + + CS-DefineEventCondition-Request ::= [0] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + + DeleteEventCondition-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL } + + DeleteEventCondition-Response ::= Unsigned32 --Candidates Not Deleted + + GetEventConditionAttributes-Request ::= ObjectName --Event Condition Name + + GetEventConditionAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC-Class, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + severity [3] IMPLICIT Unsigned8 DEFAULT normalSeverity, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable [6] CHOICE { + variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL } OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL +IF (aco), + accessControlList [8] IMPLICIT Identifier OPTIONAL +ENDIF + -- Shall not appear in minor version one or two + } + + CS-GetEventConditionAttributes-Response ::= SEQUENCE { + groupPriorityOverride [0] CHOICE { + priority [0] IMPLICIT Priority, + undefined [1] IMPLICIT NULL } OPTIONAL, + listOfReferencingECL [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + displayEnhancement [2] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement [2] IMPLICIT NULL } + } + + ReportEventConditionStatus-Request ::= ObjectName --Event Condition Name + + ReportEventConditionStatus-Response ::= SEQUENCE { + currentState [0] IMPLICIT EC-State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL } + + AlterEventConditionMonitoring-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL +IF ( cei ) +, evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL +ENDIF + -- At least one of enabled, priority, alarmSummaryReports, or + -- evaluationInterval shall be present. + } + + AlterEventConditionMonitoring-Response ::= NULL + + CS-AlterEventConditionMonitoring-Request ::= SEQUENCE { + changeDisplay CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement [2] NULL } OPTIONAL + } + + DefineEventAction-Request ::= SEQUENCE { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL, + confirmedServiceRequest [2] ConfirmedServiceRequest +IF ( csr cspi ) +, cs-extension [79] Request-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL +ENDIF + } + + DefineEventAction-Response ::= NULL + + DeleteEventAction-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL } + + DeleteEventAction-Response ::= Unsigned32 --Candidates Not Deleted + + GetEventActionAttributes-Request ::= ObjectName --EventActionName + + GetEventActionAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier, + confirmedServiceRequest [2] ConfirmedServiceRequest +IF ( csr cspi ) +, cs-extension [79] Request-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL +ENDIF +IF (aco) +, accessControlList [3] IMPLICIT Identifier OPTIONAL +ENDIF + -- Shall not appear in minor version one or two + } + + ReportEventActionStatus-Request ::= ObjectName -- Event Action Name + + ReportEventActionStatus-Response ::= Unsigned32 -- Number of Event Enrollments + + DefineEventEnrollment-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransitions [2] IMPLICIT Transitions, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL +IF ( tpy ) +, clientApplication [5] ApplicationReference OPTIONAL +ENDIF + } + + DefineEventEnrollment-Response ::= NULL + + DefineEventEnrollment-Error ::= ObjectName + + CS-DefineEventEnrollment-Request ::= [0] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + + DeleteEventEnrollment-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName } + + DeleteEventEnrollment-Response ::= Unsigned32 --Candidates Not Deleted + + GetEventEnrollmentAttributes-Request ::= SEQUENCE { + scopeOfRequest [0] IMPLICIT INTEGER { + specific (0), + client (1), + ec (2), + ea (3) } (0..3) DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, +IF ( tpy ) + clientApplication [2] ApplicationReference OPTIONAL, +ELSE + clientApplication [2] NULL, +ENDIF + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL } + + GetEventEnrollmentAttributes-Response ::= SEQUENCE { + listOfEEAttributes [0] IMPLICIT SEQUENCE OF EEAttributes, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + EEAttributes ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL }, + eventActionName [2] CHOICE { + eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL } OPTIONAL, +IF ( tpy ) + clientApplication [3] ApplicationReference OPTIONAL, +ELSE + clientApplication [3] NULL, +ENDIF + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE-Class, + duration [6] IMPLICIT EE-Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32 OPTIONAL, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL +IF ( csr cspi ) +, displayEnhancement [9] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + -- shall not be transmitted if the value is NULL +ELSE + displayEnhancement [9] NULL +IF ( aco ) +, accessControlList [11] IMPLICIT Identifier + -- shall not appear in minor version one or two +ENDIF + } + + ReportEventEnrollmentStatus-Request ::= ObjectName --Event Enrollment Name + + ReportEventEnrollmentStatus-Response ::= SEQUENCE { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE-Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE-State } + + AlterEventEnrollment-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL } + + AlterEventEnrollment-Response ::= SEQUENCE { + currentState [0] CHOICE { + state [0] IMPLICIT EE-State, + undefined [1] IMPLICIT NULL }, + transitionTime [1] EventTime } + + CS-AlterEventEnrollment-Request ::= SEQUENCE { + changeDisplay CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement [2] NULL } OPTIONAL } + + EE-State ::= INTEGER { + disabled (0), + idle (1), + active (2), + activeNoAckA (3), + idleNoAckI (4), + idleNoAckA (5), + idleAcked (6), + activeAcked (7), + undefined (8) + } + + DefineEventConditionList-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName +IF ( recl ), + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated. +ENDIF + } + + DefineEventConditionList-Response ::= NULL + + DefineEventConditionList-Error ::= ObjectName + + DeleteEventConditionList-Request ::= ObjectName -- EventConditionListName + + DeleteEventConditionList-Response ::= NULL + + AddEventConditionListReference-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName +IF ( recl ) +, listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated. +ENDIF + } + + AddEventConditionListReference-Response ::= NULL + + AddEventConditionListReference-Error ::= ObjectName + + RemoveEventConditionListReference-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName +IF ( recl ) +, listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName + -- shall appear if an only if recl has been negotiated. +ENDIF + } + + RemoveEventConditionListReference-Response ::= NULL + + RemoveEventConditionListReference-Error ::= CHOICE { + eventCondition [0] ObjectName, + eventConditionList [1] ObjectName } + + GetEventConditionListAttributes-Request ::= ObjectName -- eventConditionListName + + GetEventConditionListAttributes-Response ::= SEQUENCE { + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName +IF ( recl ) +, listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated. +ENDIF + } + + ReportEventConditionListStatus-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, -- Event Condition List Name + continueAfter [1] IMPLICIT Identifier OPTIONAL } + + ReportEventConditionListStatus-Response ::= SEQUENCE { + listOfEventConditionStatus [1] IMPLICIT SEQUENCE OF EventConditionStatus, + moreFollows [2] IMPLICIT BOOLEAN DEFAULT TRUE } + + EventConditionStatus ::= SEQUENCE { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State, + numberOfEventEnrollments [2] IMPLICIT Unsigned32, + enabled [3] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [4] EventTime OPTIONAL, + timeOfLastTransitionToIdle [5] EventTime OPTIONAL } + + AlterEventConditionListMonitoring-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN, + priorityChange [2] CHOICE { + priorityValue [0] IMPLICIT INTEGER, + priorityReset [1] IMPLICIT NULL } OPTIONAL + } + + AlterEventConditionListMonitoring-Response ::= NULL + + ReadJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + rangeStartSpecification [1] CHOICE { + startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING } OPTIONAL, + rangeStopSpecification [2] CHOICE { + endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32 } OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter [5] IMPLICIT SEQUENCE { + timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING } OPTIONAL + } + + ReadJournal-Response ::= SEQUENCE { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + JournalEntry ::= SEQUENCE { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent } + + WriteJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent } + + WriteJournal-Response ::= NULL + + InitializeJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + limitSpecification [1] IMPLICIT SEQUENCE { + limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL } OPTIONAL + } + + InitializeJournal-Response ::= Unsigned32 -- Entries Deleted + + ReportJournalStatus-Request ::= ObjectName --Journal Name + + ReportJournalStatus-Response ::= SEQUENCE { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN +IF ( aco ) +, accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + CreateJournal-Request ::= SEQUENCE { + journalName [0] ObjectName } + + CreateJournal-Response ::= NULL + + DeleteJournal-Request ::= SEQUENCE { + journalName [0] ObjectName } + + DeleteJournal-Response ::= NULL + + EntryContent ::= SEQUENCE { + occurrenceTime [0] IMPLICIT TimeOfDay, + entryForm CHOICE { + data [2] IMPLICIT SEQUENCE { + event [0] IMPLICIT SEQUENCE { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State } OPTIONAL, + listOfVariables [1] IMPLICIT SEQUENCE OF Journal-Variable OPTIONAL + }, + annotation [3] MMSString } + } + + END + + MMS-Environment-1 { iso standard 9506 part(2) mms-environment-version1(4)} +DEFINITIONS ::= BEGIN + +EXPORTS + ApplicationReference, + Authentication-value; + +IMPORTS + AP-title, + AP-invocation-identifier, + AE-qualifier, + AE-invocation-identifier, + Authentication-value + FROM ACSE-1 + { joint-iso-itu-t association-control(2) modules(0) apdus(0) version1(1)}; + + ApplicationReference ::= SEQUENCE { + ap-title [0] ACSE-1.AP-title OPTIONAL, + ap-invocation-id [1] ACSE-1.AP-invocation-identifier OPTIONAL, + ae-qualifier [2] ACSE-1.AE-qualifier OPTIONAL, + ae-invocation-id [3] ACSE-1.AE-invocation-identifier OPTIONAL + } + + END + + MMS-SCI-Module-1 { iso standard 9506 part(2) mms-file-record-version1(2) } +DEFINITIONS ::= BEGIN + + IMPORTS ApplicationReference + FROM MMS-Environment-1 { iso standard 9506 part(2) mms-environment-version1(4) } + AccessCondition, + AdditionalCBBOptions, + AdditionalSupportOptions, + Address, + AlarmAckRule, + Control-State, + DomainState, + EC-Class, + EC-State, + EE-Duration, + EE-Class, + LogicalStatus, + Modifier, + ParameterSupportOptions, + PhysicalStatus, + Priority, + ProgramInvocationState, + ServiceSupportOptions, + Severity, + Transitions, + TypeDescription + FROM MMS-Object-Module-1 { iso standard 9506 part(1) mms-object-model1(1) } + AlternateAccess, + ConfirmedServiceRequest, + AttachToEventCondition, + AttachToSemaphore, + Data, + EE-State, + Identifier, + Integer8, + Integer32, + MMSString, + MMS255String, + ObjectName, + TimeOfDay, + TypeSpecification, + Unsigned32, + Unsigned8 + FROM ISO-9506-MMS-1 { iso standard 9506 part(2) mms-abstract-syntax-version1(1) +}; + + SCI-Information ::= SEQUENCE { + partOne [0] IMPLICIT VMD-File, + partTwo [1] IMPLICIT Service-and-Parameter-CBBs + } + + VMD-File ::= SEQUENCE { + executiveFunction + [0] IMPLICIT ApplicationReference, + vendorName + [1] MMSString, + modelName + [2] MMSString, + revision + [3] MMSString, + abstractSyntaxes + [4] IMPLICIT OBJECT IDENTIFIER, + -- no TRANSACTIONs, + -- no APPLICATION-ASSOCIATIONs, + accessControl + [5] IMPLICIT Access-Control-List-instance, + logicalStatus + [6] IMPLICIT LogicalStatus, + capabilities + [7] IMPLICIT SEQUENCE OF MMSString, + physicalStatus + [8] IMPLICIT PhysicalStatus, + local-detail + [9] IMPLICIT BIT STRING, + accessControlLists + [10] IMPLICIT SEQUENCE OF Access-Control-List-instance, + domains + [11] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [12] IMPLICIT SEQUENCE OF Program-Invocation-instance, + unitControls + [13] IMPLICIT SEQUENCE OF Unit-Control-instance +IF (vadr) +, unnamedVariables + [14] IMPLICIT SEQUENCE OF Unnamed-Variable-instance +ELSE +, unnamedVariables + [14] IMPLICIT NULL +ENDIF +IF (vnam) +, namedVariables + [15] IMPLICIT SEQUENCE OF Named-Variable-instance +IF (vlis) +, namedVariableLists + [16] IMPLICIT SEQUENCE OF Named-Variable-List-instance +ELSE +, namedVariableLists + [16] IMPLICIT NULL +ENDIF +, namedTypes + [17] IMPLICIT SEQUENCE OF Named-Type-instance +ELSE +, namedVariables + [15] IMPLICIT NULL, + namedVariableLists + [16] IMPLICIT NULL, + namedTypes + [17] IMPLICIT NULL +ENDIF +, dataExchanges + [18] IMPLICIT SEQUENCE OF Data-Exchange-instance, + semaphores + [19] IMPLICIT SEQUENCE OF Semaphore-instance, + operatorStations + [20] IMPLICIT SEQUENCE OF Operator-Station-instance, + eventConditions + [21] IMPLICIT SEQUENCE OF Event-Condition-instance, + eventActions + [22] IMPLICIT SEQUENCE OF Event-Action-instance, + eventEnrollments + [23] IMPLICIT SEQUENCE OF Event-Enrollment-instance +IF (cspi) +, eventConditionLists + [24] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ELSE +, eventConditionLists + [24] IMPLICIT NULL +ENDIF +, journals + [25] IMPLICIT SEQUENCE OF Journal-instance, + ... +IF (csr) + , selected-Program-Invocation CHOICE { + selectedProgram + [26] IMPLICIT Program-Invocation-instance, + noneSelected + [27] IMPLICIT NULL } +ENDIF + } + + Access-Control-List-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + readAccessCondition + [4] AccessCondition OPTIONAL, + storeAccessCondition + [5] AccessCondition OPTIONAL, + writeAccessCondition + [6] AccessCondition OPTIONAL, + loadAccessCondition + [7] AccessCondition OPTIONAL, + executeAccessCondition + [8] AccessCondition OPTIONAL, + deleteAccessCondition + [9] AccessCondition OPTIONAL, + editAccessCondition + [10] AccessCondition OPTIONAL, + -- + -- The following fields are used to record lists of objects placed + -- under the control of this ACCESS-CONTROL-LIST object. + -- They will be referred to collectively as the Controlled Object Lists + -- + accessControlLists + [11] IMPLICIT SEQUENCE OF Access-Control-List-instance, + domains + [12] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [13] IMPLICIT SEQUENCE OF Program-Invocation-instance, + unitControls + [14] IMPLICIT SEQUENCE OF Unit-Control-instance +IF (vadr) +, unnamedVariables + [15] IMPLICIT SEQUENCE OF Unnamed-Variable-instance +ELSE +, unnamedVariables + [15] IMPLICIT NULL +ENDIF +IF (vnam) +, namedVariables + [16] IMPLICIT SEQUENCE OF Named-Variable-instance +IF (vlis) +, namedVariableLists + [17] IMPLICIT SEQUENCE OF Named-Variable-List-instance +ELSE +, namedVariableLists + [17] IMPLICIT NULL +ENDIF +, namedTypes + [18] IMPLICIT SEQUENCE OF Named-Type-instance +ELSE +, namedVariables + [16] IMPLICIT NULL, + namedVariableLists + [17] IMPLICIT NULL, + namedTypes + [18] IMPLICIT NULL +ENDIF +, dataExchanges + [19] IMPLICIT SEQUENCE OF Data-Exchange-instance, + semaphores + [20] IMPLICIT SEQUENCE OF Semaphore-instance, + operatorStations + [21] IMPLICIT SEQUENCE OF Operator-Station-instance, + eventConditions + [22] IMPLICIT SEQUENCE OF Event-Condition-instance, + eventActions + [23] IMPLICIT SEQUENCE OF Event-Action-instance, + eventEnrollments + [24] IMPLICIT SEQUENCE OF Event-Enrollment-instance, + journals + [25] IMPLICIT SEQUENCE OF Journal-instance, + ... +IF (cspi) +, eventConditionLists + [26] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ENDIF + } } } + + Domain-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + capabilities [3] IMPLICIT SEQUENCE OF MMSString, + state [4] IMPLICIT DomainState, + -- The aAssociation is not included + accessControl + [5] IMPLICIT Access-Control-List-instance, + sharable [6] IMPLICIT BOOLEAN, + programInvocations + [7] IMPLICIT SEQUENCE OF Program-Invocation-instance + -- uploadsInProgress is not included +IF (vnam) +, namedVariables + [8] IMPLICIT SEQUENCE OF Named-Variable-instance +IF (vlis) + , namedVariableLists + [9] IMPLICIT SEQUENCE OF Named-Variable-List-instance +ELSE +, namedVariableLists + [9] IMPLICIT NULL +ENDIF +, namedTypes + [10] IMPLICIT SEQUENCE OF Named-Type-instance +ELSE +, namedVariables + [8] IMPLICIT NULL, + namedVariableLists + [9] IMPLICIT NULL, + namedTypes + [10] IMPLICIT NULL +ENDIF +, eventConditions + [11] IMPLICIT SEQUENCE OF Event-Condition-instance, + eventActions + [12] IMPLICIT SEQUENCE OF Event-Action-instance, + eventEnrollments + [13] IMPLICIT SEQUENCE OF Event-Enrollment-instance +IF (cspi) +, eventConditionLists + [14] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ENDIF + } } } + + Program-Invocation-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + programInvocationState + [3] IMPLICIT ProgramInvocationState, + domains + [4] IMPLICIT SEQUENCE OF Domain-instance, + accessControl + [5] IMPLICIT SEQUENCE OF Access-Control-List-instance, + reusable + [6] IMPLICIT BOOLEAN, + monitor + [7] IMPLICIT BOOLEAN, + -- The following three fields shall all be present if the value of + -- monitor is true. + -- If present, the &name field of each object instance + -- shall have a value equal to the + -- &name field of this instance of the PROGRAM-INVOCATION. + eventCondition + [8] IMPLICIT SEQUENCE OF Event-Condition-instance OPTIONAL, + eventAction + [9] IMPLICIT SEQUENCE OF Event-Action-instance OPTIONAL, + eventEnrollment + [10] IMPLICIT SEQUENCE OF Event-Enrollment-instance OPTIONAL, + executionArgument + [11] MMSString, + ... +IF (csr) +, control + [12] IMPLICIT Control-State, + controlling-Program-Invocation + [13] IMPLICIT Program-Invocation-instance, + -- The following field shall be present + -- if and only if the value of the &control field is controlling. + controlled-Program-Invocations + [14] IMPLICIT SEQUENCE OF Program-Invocation-instance OPTIONAL +ENDIF + } } } + + Unit-Control-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + domains + [4] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [5] IMPLICIT SEQUENCE OF Program-Invocation-instance + } } } + + Unnamed-Variable-instance ::= SEQUENCE { + address [0] Address, + accessControl [1] IMPLICIT Access-Control-List-instance, + typeDescription [2] TypeDescription + } + + Named-Variable-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + typeDescription [4] TypeDescription +IF ( vadr ) +, address [5] Address OPTIONAL +ELSE +, [5] NULL +ENDIF +IF ( sem ) +, meaning [6] IMPLICIT VisibleString OPTIONAL +ENDIF + } } } + + Named-Variable-List-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + listOfVariables + [4] IMPLICIT SEQUENCE OF Variable-List-Item-instance + } } } + + Variable-List-Item-instance ::= SEQUENCE { + -- one and only one of the following two lines shall appear +IF ( vadr ) + unnamedItem [0] IMPLICIT Unnamed-Variable-instance OPTIONAL +ELSE + unnamedItem [0] IMPLICIT NULL OPTIONAL +ENDIF +IF ( vnam ) +, namedItem [1] IMPLICIT Named-Variable-instance OPTIONAL +ELSE +, namedItem [1] IMPLICIT NULL OPTIONAL +ENDIF +IF (valt) + -- the following specification may be included +, alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL +ENDIF + } + + Named-Type-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + typeDescription [4] TypeDescription +IF (sem) +, meaning [5] IMPLICIT VisibleString OPTIONAL +ENDIF + } } } + + Data-Exchange-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + request [4] IMPLICIT SEQUENCE OF TypeDescription, + response [5] IMPLICIT SEQUENCE OF TypeDescription, + linked [6] IMPLICIT BOOLEAN, + -- The following attribute shall appear if an only if the value of &linked is true. + programInvocation [7] IMPLICIT Program-Invocation-instance OPTIONAL + } } } + + Semaphore-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + class [4] IMPLICIT ENUMERATED { + token, + pool }, +-- If the value of &class is token, the following field shall appear + numberOfTokens [5] IMPLICIT INTEGER OPTIONAL, +-- If the value of &class is pool, the following field shall appear + namedTokens [6] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + eventCondition [7] IMPLICIT Event-Condition-instance + } } } + + Operator-Station-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + stationType [4] IMPLICIT ENUMERATED { + entry, + display, + entry-display } + } } } + + Event-Condition-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + ecClass [4] IMPLICIT EC-Class, + ecState [5] IMPLICIT EC-State, + priority [6] IMPLICIT Priority, + severity [7] IMPLICIT Severity, + eventEnrollments [8] IMPLICIT SEQUENCE OF Event-Enrollment-instance, + -- The following fields shall be present + -- if and only if the value of &ecClass is monitored. + enabled [9] IMPLICIT BOOLEAN OPTIONAL, + alarmSummaryReports [10] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable CHOICE { + named [11] IMPLICIT Named-Variable-instance, + unnamed [12] IMPLICIT Unnamed-Variable-instance, + unspecified [13] IMPLICIT NULL } OPTIONAL, + evaluationInterval [14] IMPLICIT INTEGER OPTIONAL, + ... +IF (cspi) +, displayEnhancement CHOICE { +IF (des) + text [15] MMSString +ENDIF +IF (dei) +, number [16] IMPLICIT INTEGER +ENDIF +, none [17] IMPLICIT NULL + }, + group-Priority-Override CHOICE { + priority [18] IMPLICIT Priority, + undefined [19] IMPLICIT NULL + } OPTIONAL, + referencingEventConditionLists + [20] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ENDIF + } } } + + Event-Action-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + confirmedServiceRequest [4] ConfirmedServiceRequest, + modifiers [5] IMPLICIT SEQUENCE OF Modifier, + eventEnrollments + [6] IMPLICIT SEQUENCE OF Event-Enrollment-instance + } } } + + Event-Enrollment-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + eeClass [4] IMPLICIT EE-Class , + eventCondition [5] IMPLICIT Event-Condition-instance, + ecTransitions [6] IMPLICIT Transitions, + -- The following parameter is present if and only if the + -- value of &eeClass is modifier. + remainingDelay CHOICE { + time [7] IMPLICIT INTEGER, + forever [8] IMPLICIT NULL } OPTIONAL, + -- The remaining parameters are present if and only if the + -- value of &eeClass is notification. + eventAction [9] IMPLICIT Event-Action-instance OPTIONAL, + duration [10] IMPLICIT EE-Duration OPTIONAL, + clientApplication [11] IMPLICIT ApplicationReference OPTIONAL, + aaRule [12] IMPLICIT AlarmAckRule OPTIONAL, + ... +IF (cspi) +, displayEnhancement CHOICE { +IF (des) + text [13] MMSString + ENDIF +IF (dei) +, number [14] IMPLICIT INTEGER +ENDIF +, none [15] IMPLICIT NULL + } +ENDIF + } } } + + Event-Condition-List-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + eventConditions + [4] IMPLICIT SEQUENCE OF Event-Condition-instance +IF (recl) + , eventConditionLists + [5] IMPLICIT SEQUENCE OF Event-Condition-List-instance, + referencingEventConditionLists + [6] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ENDIF + } } } + + Journal-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + entries [4] IMPLICIT SEQUENCE OF Journal-Entry-instance + } } } + + Journal-Entry-instance ::= SEQUENCE { + journal [0] IMPLICIT Journal-instance, + entry [1] IMPLICIT OCTET STRING, + clientApplication [2] IMPLICIT ApplicationReference, + timeStamp [3] IMPLICIT TimeOfDay, + orderOfReceipt [4] IMPLICIT INTEGER, + informationType [5] IMPLICIT ENUMERATED { + annotation, + event-data, + data }, + -- The following attribute shall appear if and only if the + -- value of &informationType is annotation. + textComment [6] MMS255String OPTIONAL, + --The following attribute shall appear if and only if the + -- value of &informationType is event-data. + eventTransitionRecord [7] IMPLICIT SEQUENCE { + name [8] ObjectName, + currentState [9] IMPLICIT EC-State + } OPTIONAL, + -- The following attribute shall appear if and only if the + -- value of &informationType is data or event-data. + journalVariables [10] IMPLICIT SEQUENCE OF SEQUENCE { + variableTag [11] MMS255String, + valueSpecification [12] Data + } OPTIONAL + } + + Service-and-Parameter-CBBs ::= SEQUENCE { + services-Client [0] IMPLICIT ServiceSupportOptions, + services-Server [1] IMPLICIT ServiceSupportOptions, + parameters [2] IMPLICIT ParameterSupportOptions, + nest [3] IMPLICIT INTEGER +IF (csr cspi) +, extendedServices-Client [4] IMPLICIT AdditionalSupportOptions, + extendedServices-Server [5] IMPLICIT AdditionalSupportOptions +ELSE +, extendedServices-Client [4] IMPLICIT NULL, + extendedServices-Server [5] IMPLICIT NULL +ENDIF +IF (cspi) +, extendedParameters [6] IMPLICIT AdditionalCBBOptions +ELSE +, extendedParameters [6] IMPLICIT NULL +ENDIF +, generalManagement [7] IMPLICIT GeneralManagementParameters, + vMDSupport [8] IMPLICIT VMDSupportParameters, + domainManagement [9] IMPLICIT DomainManagementParameters, + programInvocation [10] IMPLICIT ProgramInvocationManagementParameters, + variableAccess [11] IMPLICIT VariableAccessParameters, + dataParameters [12] IMPLICIT DataParameters, + semaphoreManagement [13] IMPLICIT SemaphoreManagementParameters, + operatorCommunication [14] IMPLICIT OperatorCommunicationParameters, + errors [15] IMPLICIT ErrorParameters, + fileManagement [16] IMPLICIT FileManagementParameters + } + + GeneralManagementParameters ::= SEQUENCE { + localDetail [0] MMSString, + supportForTime [1] IMPLICIT SEQUENCE { + timeOfDay [2] IMPLICIT BOOLEAN, + timeSequence [3] IMPLICIT BOOLEAN + }, + granularityOfTime [4] IMPLICIT INTEGER + } + + VMDSupportParameters ::= SEQUENCE { + localDetail [0] MMSString, + extendedDerivation [1] MMSString + -- method used to perform extended derivation + } + + DomainManagementParameters ::= SEQUENCE { + loadDataOctet [0] MMSString, + -- description of the format of Load Data if the octet string form is used + loadDataSyntax [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + -- identifier of the Abstract Syntaxes used + maxUploads [2] IMPLICIT INTEGER + } + + ProgramInvocationManagementParameters ::= SEQUENCE { + executionArgMaxSize [0] IMPLICIT INTEGER, + executionArgParseRules [1] MMSString, + executionArgSyntaxes [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + programLoction [3] MMSString, + -- syntax of the program Location notation + stepMode [4] IMPLICIT BOOLEAN + -- if true, step Mode is supported + } + + VariableAccessParameters ::= SEQUENCE { + uninterruptibleAccess [0] MMSString, + -- conditions under which it is guaranteed + singleMode [1] IMPLICIT BOOLEAN, + unnamedMode [2] IMPLICIT BOOLEAN + } + + DataParameters ::= SEQUENCE { + bit-string [0] IMPLICIT INTEGER OPTIONAL, + integer [1] IMPLICIT INTEGER OPTIONAL, + unsigned [2] IMPLICIT INTEGER OPTIONAL, + floating-point [3] IMPLICIT SEQUENCE { + total [4] IMPLICIT INTEGER, + exponent [5] IMPLICIT INTEGER } OPTIONAL, + octet-string [10] IMPLICIT INTEGER OPTIONAL, + visible-string [11] IMPLICIT INTEGER OPTIONAL, + binary-time [12] IMPLICIT BOOLEAN OPTIONAL, + bcd [13] IMPLICIT INTEGER OPTIONAL, + mmsString [14] IMPLICIT INTEGER OPTIONAL + } + + SemaphoreManagementParameters ::= SEQUENCE { + algorithm [0] IMPLICIT MMSString + -- method of processing the &priority field + } + + OperatorCommunicationParameters ::= SEQUENCE { + input-time-out [0] IMPLICIT INTEGER + } + + ErrorParameters ::= SEQUENCE { + additionalCode [0] MMSString, + additionalDetial [1] IMPLICIT SEQUENCE { + size [2] IMPLICIT INTEGER, + syntax [3] MMSString + } + } + + FileManagementParameters ::= SEQUENCE { + fileName [0] MMSString + } + + END + + ISO-9506-MMS-1A { iso standard 9506 part(2) mms-annex-version1(3) } +DEFINITIONS ::= BEGIN + +EXPORTS + ObtainFile-Request, + ObtainFile-Response, + ObtainFile-Error, + FileOpen-Request, + FileOpen-Response, + FileRead-Request, + FileRead-Response, + FileClose-Request, + FileClose-Response, + FileRename-Request, + FileRename-Response, + FileRename-Error, + FileDelete-Request, + FileDelete-Response, + FileDirectory-Request, + FileDirectory-Response, + ScatteredAccessDescription, + DefineScatteredAccess-Request, + DefineScatteredAccess-Response, + GetScatteredAccessAttributes-Request, + GetScatteredAccessAttributes-Response; + +IMPORTS + FileName, + ObjectName, + AlternateAccess, + VariableSpecification, + Identifier, + Integer32, + Unsigned32 FROM + ISO-9506-MMS-1 { iso standard 9506 part(2) mms-abstract-syntax-version1(1) } + ApplicationReference FROM + MMS-Environment-1 { iso standard 9506 part(2) mms-environment-version1 (4) }; + + ObtainFile-Request ::= SEQUENCE { +IF ( tpy ) + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, +ENDIF + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName + } + + ObtainFile-Response ::= NULL + + ObtainFile-Error ::= INTEGER { + source-file (0), + destination-file (1) + } (0..1) + + FileOpen-Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32 } + + FileOpen-Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes } + + FileRead-Request ::= Integer32 -- FRSM ID + + FileRead-Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + FileClose-Request ::= Integer32 -- FRSM ID + + FileClose-Response ::= NULL + + FileRename-Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName } + + FileRename-Response ::= NULL + + FileRename-Error ::= INTEGER { + source-file (0), + destination-file (1) + } (0..1) + + FileDelete-Request ::= FileName + + FileDelete-Response ::= NULL + + FileDirectory-Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL } + + FileDirectory-Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + DirectoryEntry ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes } + + FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, -- in octets + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL } + + ScatteredAccessDescription ::=SEQUENCE OF SEQUENCE { + componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification +IF ( valt ) +, alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL +ENDIF + } + + DefineScatteredAccess-Request ::= SEQUENCE { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription } + + DefineScatteredAccess-Response ::= NULL + + GetScatteredAccessAttributes-Request ::= ObjectName -- ScatteredAccessName + + GetScatteredAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription +IF ( aco ) +, accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + END diff --git a/asn1/mms/more-asn1-files/mms-sisco.asn b/asn1/mms/more-asn1-files/mms-sisco.asn new file mode 100644 index 0000000..89a50c7 --- /dev/null +++ b/asn1/mms/more-asn1-files/mms-sisco.asn @@ -0,0 +1,2203 @@ +--Quelle: http://www.sisconet.com/downloads/mms_abstract_syntax.txt +--------------------------------------------------------------------- + +Corrections made July 2, 1994 + +--------------------------------------------------------------------- + + +MMS { iso standard 9506 part(2) mms-general-module-version(2) } + +DEFINITIONS ::= + +BEGIN + +EXPORTS MMSpdu; + +IMPORTS + AP-title, + AP-invocation-identifier, + AE-qualifier, + AE-invocation-identifier +FROM ISO-8650-ACSE-1 + + +MMSpdu ::= CHOICE + { + confirmed-RequestPDU [0] IMPLICIT Confirmed-RequestPDU, + confirmed-ResponsePDU [1] IMPLICIT Confirmed-ResponsePDU, + confirmed-ErrorPDU [2] IMPLICIT Confirmed-ErrorPDU, + unconfirmed-PDU [3] IMPLICIT Unconfirmed-PDU, + rejectPDU [4] IMPLICIT RejectPDU, + cancel-RequestPDU [5] IMPLICIT Cancel-RequestPDU, + cancel-ResponsePDU [6] IMPLICIT Cancel-ResponsePDU, + cancel-ErrorPDU [7] IMPLICIT Cancel-ErrorPDU, + initiate-RequestPDU [8] IMPLICIT Initiate-RequestPDU, + initiate-ResponsePDU [9] IMPLICIT Initiate-ResponsePDU, + initiate-ErrorPDU [10] IMPLICIT Initiate-ErrorPDU, + conclude-RequestPDU [11] IMPLICIT Conclude-RequestPDU, + conclude-ResponsePDU [12] IMPLICIT Conclude-ResponsePDU, + conclude-ErrorPDU [13] IMPLICIT Conclude-ErrorPDU + } + + +Confirmed-RequestPDU ::= SEQUENCE + { + invokeID Unsigned32, + listOfModifier SEQUENCE OF Modifier OPTIONAL, + ConfirmedServiceRequest, + [79] CS-Request-Detail OPTIONAL + } + + +Unconfirmed-PDU ::= SEQUENCE + { + UnconfirmedService, + [79] CS-Request-Detail OPTIONAL + } + + +Confirmed-ResponsePDU ::= SEQUENCE + { + invokeID Unsigned32, + ConfirmedServiceResponse, + [79] CS-Request-Detail OPTIONAL + } + + +Confirmed-ErrorPDU ::= SEQUENCE + { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError + } + + +UnconfirmedService ::= CHOICE + { + informationReport [0] IMPLICIT InformationReport, + unsolicitedStatus [1] IMPLICIT UnsolicitedStatus, + eventNotification [2] IMPLICIT EventNotification, + additionalService [3] AdditionalUnconfirmedService + } + + +Modifier ::= CHOICE + { + attach-To-Event-Condition [0] IMPLICIT AttachToEventCondition, + attach-To-Semaphore [1] IMPLICIT AttachToSemaphore + } + + +ConfirmedServiceRequest ::= CHOICE + { + status [0] IMPLICIT Status-Request, + getNameList [1] IMPLICIT GetNameList-Request, + identify [2] IMPLICIT Identify-Request, + rename [3] IMPLICIT Rename-Request, + read [4] IMPLICIT Read-Request, + write [5] IMPLICIT Write-Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes-Request, + defineNamedVariable [7] IMPLICIT DefineNamedVariable-Request, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess-Request, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes-Request, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess-Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Request, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes-Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Request, + defineNamedType [14] IMPLICIT DefineNamedType-Request, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes-Request, + deleteNamedType [16] IMPLICIT DeleteNamedType-Request, + input [17] IMPLICIT Input-Request, + output [18] IMPLICIT Output-Request, + takeControl [19] IMPLICIT TakeControl-Request, + relinquishControl [20] IMPLICIT RelinquishControl-Request, + defineSemaphore [21] IMPLICIT DefineSemaphore-Request, + deleteSemaphore [22] IMPLICIT DeleteSemaphore-Request, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus-Request, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus-Request, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus-Request, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence-Request, + downloadSegment [27] IMPLICIT DownloadSegment-Request, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence-Request, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence-Request, + uploadSegment [30] IMPLICIT UploadSegment-Request, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence-Request, + requestDomainDownload [32] IMPLICIT RequestDomainDownload-Request, + requestDomainUpload [33] IMPLICIT RequestDomainUpload-Request, + loadDomainContent [34] IMPLICIT LoadDomainContent-Request, + storeDomainContent [35] IMPLICIT StoreDomainContent-Request, + deleteDomain [36] IMPLICIT DeleteDomain-Request, + getDomainAttributes [37] IMPLICIT GetDomainAttributes-Request, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation-Request, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation-Request, + start [40] IMPLICIT Start-Request, + stop [41] IMPLICIT Stop-Request, + resume [42] IMPLICIT Resume-Request, + reset [43] IMPLICIT Reset-Request, + kill [44] IMPLICIT Kill-Request, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes-Request, + obtainFile [46] IMPLICIT ObtainFile-Request, + defineEventCondition [47] IMPLICIT DefineEventCondition-Request, + deleteEventCondition [48] DeleteEventCondition-Request, + getEventConditionAttributes [49] GetEventConditionAttributes-Request, + reportEventConditionStatus [50] ReportEventConditionStatus-Request, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring-Request, + triggerEvent [52] IMPLICIT TriggerEvent-Request, + defineEventAction [53] IMPLICIT DefineEventAction-Request, + deleteEventAction [54] DeleteEventAction-Request, + getEventActionAttributes [55] GetEventActionAttributes-Request, + reportEventActionStatus [56] ReportEventActionStatus-Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment-Request, + deleteEventEnrollment [58] DeleteEventEnrollment-Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment-Request, + reportEventEnrollmentStatus [60] ReportEventEnrollmentStatus-Request, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes-Request, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification-Request, + getAlarmSummary [63] IMPLICIT GetAlarmSummary-Request, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary-Request, + readJournal [65] IMPLICIT ReadJournal-Request, + writeJournal [66] IMPLICIT WriteJournal-Request, + initializeJournal [67] IMPLICIT InitializeJournal-Request, + reportJournalStatus [68] IMPLICIT ReportJournalStatus-Request, + createJournal [69] IMPLICIT CreateJournal-Request, + deleteJournal [70] IMPLICIT DeleteJournal-Request, + getCapabilityList [71] IMPLICIT GetCapabilityList-Request, + fileOpen [72] IMPLICIT FileOpen-Request, + fileRead [73] IMPLICIT FileRead-Request, + fileClose [74] IMPLICIT FileClose-Request, + fileRename [75] IMPLICIT FileRename-Request, + fileDelete [76] IMPLICIT FileDelete-Request, + fileDirectory [77] IMPLICIT FileDirectory-Request, + additionalService [78] AdditionalService-Request + } + +CS-Request-Detail ::= CHOICE { + -- see ISO 9506-2 + } + +ConfirmedServiceResponse ::= CHOICE + { + status [0] IMPLICIT Status-Response, + getNameList [1] IMPLICIT GetNameList-Response, + identify [2] IMPLICIT Identify-Response, + rename [3] IMPLICIT Rename-Response, + read [4] IMPLICIT Read-Response, + write [5] IMPLICIT Write-Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes-Response, + defineNamedVariable [7] IMPLICIT DefineNamedVariable-Response, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess-Response, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes-Response, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess-Response, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Response, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes-Response, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Response, + defineNamedType [14] IMPLICIT DefineNamedType-Response, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes-Response, + deleteNamedType [16] IMPLICIT DeleteNamedType-Response, + input [17] IMPLICIT Input-Response, + output [18] IMPLICIT Output-Response, + takeControl [19] TakeControl-Response, + relinquishControl [20] IMPLICIT RelinquishControl-Response, + defineSemaphore [21] IMPLICIT DefineSemaphore-Response, + deleteSemaphore [22] IMPLICIT DeleteSemaphore-Response, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus-Response, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus-Response, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus-Response, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence-Response, + downloadSegment [27] IMPLICIT DownloadSegment-Response, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence-Response, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence-Response, + uploadSegment [30] IMPLICIT UploadSegment-Response, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence-Response, + requestDomainDownLoad [32] IMPLICIT RequestDomainDownload-Response, + requestDomainUpload [33] IMPLICIT RequestDomainUpload-Response, + loadDomainContent [34] IMPLICIT LoadDomainContent-Response, + storeDomainContent [35] IMPLICIT StoreDomainContent-Response, + deleteDomain [36] IMPLICIT DeleteDomain-Response, + getDomainAttributes [37] IMPLICIT GetDomainAttributes-Response, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation-Response, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation-Response, + start [40] IMPLICIT Start-Response, + stop [41] IMPLICIT Stop-Response, + resume [42] IMPLICIT Resume-Response, + reset [43] IMPLICIT Reset-Response, + kill [44] IMPLICIT Kill-Response, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes-Response, + obtainFile [46] IMPLICIT ObtainFile-Response, + fileOpen [72] IMPLICIT FileOpen-Response, + defineEventCondition [47] IMPLICIT DefineEventCondition-Response, + deleteEventCondition [48] IMPLICIT DeleteEventCondition-Response, + getEventConditionAttributes [49] IMPLICIT GetEventConditionAttributes-Response, + reportEventConditionStatus [50] IMPLICIT ReportEventConditionStatus-Response, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring-Response, + triggerEvent [52] IMPLICIT TriggerEvent-Response, + defineEventAction [53] IMPLICIT DefineEventAction-Response, + deleteEventAction [54] IMPLICIT DeleteEventAction-Response, + getEventActionAttributes [55] IMPLICIT GetEventActionAttributes-Response, + reportActionStatus [56] IMPLICIT ReportEventActionStatus-Response, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment-Response, + deleteEventEnrollment [58] IMPLICIT DeleteEventEnrollment-Response, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment-Response, + reportEventEnrollmentStatus [60] IMPLICIT ReportEventEnrollmentStatus-Response, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes-Response, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification-Response, + getAlarmSummary [63] IMPLICIT GetAlarmSummary-Response, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary-Response, + readJournal [65] IMPLICIT ReadJournal-Response, + writeJournal [66] IMPLICIT WriteJournal-Response, + initializeJournal [67] IMPLICIT InitializeJournal-Response, + reportJournalStatus [68] IMPLICIT ReportJournalStatus-Response, + createJournal [69] IMPLICIT CreateJournal-Response, + deleteJournal [70] IMPLICIT DeleteJournal-Response, + getCapabilityList [71] IMPLICIT GetCapabilityList-Response, + fileRead [73] IMPLICIT FileRead-Response, + fileClose [74] IMPLICIT FileClose-Response, + fileRename [75] IMPLICIT FileRename-Response, + fileDelete [76] IMPLICIT FileDelete-Response, + fileDirectory [77] IMPLICIT FileDirectory-Response, + additionalService [78] AdditionalService-Response + } + +--********************************** COMMON MMS TYPES *********************************** + +FileName ::= SEQUENCE OF GraphicString + +TimeOfDay ::= OCTET STRING -- (SIZE (4 | 6)) + +Identifier ::= VisibleString + +Integer8 ::= INTEGER +Integer16 ::= INTEGER +Integer32 ::= INTEGER + + +Unsigned8 ::= INTEGER +Unsigned16 ::= INTEGER +Unsigned32 ::= INTEGER + + +ObjectName ::= CHOICE + { + vmd-specific [0] IMPLICIT Identifier, + domain-specific [1] IMPLICIT SEQUENCE + { + domainId Identifier, + itemId Identifier + }, + aa-specific [2] IMPLICIT Identifier + } + + +ApplicationReference ::= SEQUENCE + { + ap-title [0] ISO-8650-ACSE-1.AP-title OPTIONAL, + ap-invocation-id [1] ISO-8650-ACSE-1.AP-invocation-identifier OPTIONAL, + ae-qualifier [2] ISO-8650-ACSE-1.AE-qualifier OPTIONAL, + ae-invocation-id [3] ISO-8650-ACSE-1.AE-invocation-identifier OPTIONAL + } + + +Priority ::= Unsigned8 + +normalPriority Priority ::= 64 + + + + + +-- ************************************ GENERAL ************************************* + +Initiate-ErrorPDU ::= ServiceError + +Initiate-RequestPDU ::= SEQUENCE + { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitRequestDetail [4] IMPLICIT InitRequestDetail + } + +InitRequestDetail ::= SEQUENCE + { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions + } + +Initiate-ResponsePDU ::= SEQUENCE + { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negociatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negociatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negociatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitResponseDetail [4] IMPLICIT InitResponseDetail + } + +InitResponseDetail ::= SEQUENCE + { + negociatedVersionNumber [0] IMPLICIT Integer16, + negociatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions + } + + +ParameterSupportOptions ::= BIT STRING { + str1 (0), + str2 (1), + vnam (2), + valt (3), + vadr (4), + vsca (5), + tpy (6), + vlis (7), + real (8), + cei (10) + } + + +ServiceSupportOptions ::= BIT STRING + { + status (0), + getNameList (1), + identify (2), + rename (3), + read (4), + write (5), + getVariableAccessAttributes (6), + defineNamedVariable (7), + defineScatteredAccess (8), + getScatteredAccessAttributes (9), + deleteVariableAccess (10), + defineNamedVariableList (11), + getNamedVariableListAttributes (12), + deleteNamedVariableList (13), + defineNamedType (14), + getNamedTypeAttributes (15), + deleteNamedType (16), + input (17), + output (18), + takeControl (19), + relinquishControl (20), + defineSemaphore (21), + deleteSemaphore (22), + reportSemaphoreStatus (23), + reportPoolSemaphoreStatus (24), + reportSemaphoreEntryStatus (25), + initiateDownloadSequence (26), + downloadSegment (27), + terminateDownloadSequence (28), + initiateUploadSequence (29), + uploadSegment (30), + terminateUploadSequence (31), + requestDomainDownload (32), + requestDomainUpload (33), + loadDomainContent (34), + storeDomainContent (35), + deleteDomain (36), + getDomainAttributes (37), + createProgramInvocation (38), + deleteProgramInvocation (39), + start (40), + stop (41), + resume (42), + reset (43), + kill (44), + getProgramInvocationAttributes (45), + obtainFile (46), + defineEventCondition (47), + deleteEventCondition (48), + getEventConditionAttributes (49), + reportEventConditionStatus (50), + alterEventConditionMonitoring (51), + triggerEvent (52), + defineEventAction (53), + deleteEventAction (54), + getEventActionAttributes (55), + reportActionStatus (56), + defineEventEnrollment (57), + deleteEventEnrollment (58), + alterEventEnrollment (59), + reportEventEnrollmentStatus (60), + getEventEnrollmentAttributes (61), + acknowledgeEventNotification (62), + getAlarmSummary (63), + getAlarmEnrollmentSummary (64), + readJournal (65), + writeJournal (66), + initializeJournal (67), + reportJournalStatus (68), + createJournal (69), + deleteJournal (70), + getCapabilityList (71), + fileOpen (72), + fileRead (73), + fileClose (74), + fileRename (75), + fileDelete (76), + fileDirectory (77), + unsolicitedStatus (78), + informationReport (79), + eventNotification (80), + attachToEventCondition (81), + attachToSemaphore (82), + conclude (83), + cancel (84) + } + +---------------------------------- CONCLUDE -------------------------------- + +Conclude-RequestPDU ::= NULL + +Conclude-ResponsePDU ::= NULL + +Conclude-ErrorPDU ::= ServiceError + +---------------------------------- CANCEL -------------------------------- + +Cancel-RequestPDU ::= Unsigned32 -- originalInvokeID + +Cancel-ResponsePDU ::= Unsigned32 -- originalInvokeID + +Cancel-ErrorPDU ::= SEQUENCE + { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError + } + +------------------------------ Service-Error -------------------------------- + +ServiceError ::= SEQUENCE + { + errorClass [0] CHOICE + { + vmd-state [0] IMPLICIT INTEGER + { + other (0), + vmd-state-conflict (1), + vmd-operational-problem (2), + domain-transfer-problem (3), + state-machine-id-invalid (4) + }, + application-reference [1] IMPLICIT INTEGER + { + other (0), + aplication-unreachable (1), + connection-lost (2), + application-reference-invalid (3), + context-unsupported (4) + }, + definition [2] IMPLICIT INTEGER + { + other (0), + object-undefined (1), + invalid-address (2), + type-unsupported (3), + type-inconsistent (4), + object-exists (5), + object-attribute-inconsistent (6) + }, + resource [3] IMPLICIT INTEGER + { + other (0), + memory-unavailable (1), + processor-resource-unavailable (2), + mass-storage-unavailable (3), + capability-unavailable (4), + capability-unknown (5) + }, + service [4] IMPLICIT INTEGER + { + other (0), + primitives-out-of-sequence (1), + object-sate-conflict (2), + pdu-size (3), + continuation-invalid (4), + object-constraint-conflict (5) + }, + service-preempt [5] IMPLICIT INTEGER + { + other (0), + timeout (1), + deadlock (2), + cancel (3) + }, + time-resolution [6] IMPLICIT INTEGER + { + other (0), + unsupportable-time-resolution (1) + }, + access [7] IMPLICIT INTEGER + { + other (0), + object-access-unsupported (1), + object-non-existent (2), + object-access-denied (3), + object-invalidated (4) + }, + initiate [8] IMPLICIT INTEGER + { + other (0), + version-incompatible (1), + max-segment-insufficient (2), + max-services-outstanding-calling-insufficient (3), + max-services-outstanding-called-insufficient (4), + service-CBB-insufficient (5), + parameter-CBB-insufficient (6), + nesting-level-insufficient (7) + }, + conclude [9] IMPLICIT INTEGER + { + other (0), + further-communication-required (1) + }, + cancel [10] IMPLICIT INTEGER + { + other (0), + invoke-id-unknown (1), + cancel-not-possible (2) + }, + file [11] IMPLICIT INTEGER + { + other (0), + filename-ambiguous (1), + file-busy (2), + filename-syntax-error (3), + content-type-invalid (4), + position-invalid (5), + file-acces-denied (6), + file-non-existent (7), + duplicate-filename (8), + insufficient-space-in-filestore (9) + }, + others [12] IMPLICIT INTEGER + }, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInformation [3] CHOICE + { + obtainFile [0] IMPLICIT ObtainFile-Error, + start [1] IMPLICIT Start-Error, + stop [2] IMPLICIT Stop-Error, + resume [3] IMPLICIT Resume-Error, + reset [4] IMPLICIT Reset-Error, + deleteVariableAccess [5] IMPLICIT DeleteVariableAccess-Error, + deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList-Error, + deleteNamedType [7] IMPLICIT DeleteNamedType-Error, + defineEventEnrollment-Error [8] DefineEventEnrollment-Error, + fileRename [9] IMPLICIT FileRename-Error, + additionalService [10] AdditionalServiceError + } OPTIONAL + } + + +---------------------------------- REJECT -------------------------------- + +RejectPDU ::= SEQUENCE + { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE + { + confirmed-requestPDU [1] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + unrecognized-modifier (2), + invalid-invokeID (3), + invalid-argument (4), + invalid-modifier (5), + max-serv-outstanding-exceeded (6), + max-recursion-exceeded (8), + value-out-of-range (9) + }, + + confirmed-responsePDU [2] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-result (3), + max-recursion-exceeded (5), + value-out-of-range (6) + }, + + confirmed-errorPDU [3] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-serviceError (3), + value-out-of-range (4) + } , + + unconfirmedPDU [4] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-argument (2), + max-recursion-exceeded (3), + value-out-of-range (4) + }, + + pdu-error [5] IMPLICIT INTEGER + { + unknown-pdu-type (0), + invalid-pdu (1), + illegal-acse-mapping (2) + }, + + cancel-requestPDU [6] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1) + }, + + cancel-responsePDU [7] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1) + }, + + cancel-errorPDU [8] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1), + invalid-serviceError (2), + value-out-of-range (3) + }, + + conclude-requestPDU [9] IMPLICIT INTEGER + { + other (0), + invalid-argument (1) + }, + + conclude-responsePDU [10] IMPLICIT INTEGER + { + other (0), + invalid-result (1) + }, + + conclude-errorPDU [11] IMPLICIT INTEGER + { + other (0), + invalid-serviceError (1), + value-out-of-range (2) + } + } + } + + +-- *************************************** VMD ******************************************** + + +Status-Request ::= BOOLEAN + +Status-Response ::= SEQUENCE { + vmdLogicalStatus [0] IMPLICIT INTEGER { + state-changes-allowed (0), + no-state-changes-allowed (1), + limited-services-allowed (2), + support-services-allowed (3) + }, + vmdPhysicalStatus [1] IMPLICIT INTEGER { + operational (0), + partially-operational (1), + inoperable (2), + needs-commissioning (3) + }, + localDetail [2] IMPLICIT BIT STRING(SIZE(0..128)) OPTIONAL + + } + +------------------------------- UNSOLICITEDSTATUS -------------------------------- + +UnsolicitedStatus ::= Status-Response + +--------------------------------- GETNAMELIST -------------------------------- + +GetNameList-Request ::= SEQUENCE + { + extendedObjectClass [0] CHOICE + { + objectClass [0] IMPLICIT INTEGER + { + nammedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + }, + objectScope [1] CHOICE + { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL + } + +GetNameList-Response ::= SEQUENCE + { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +---------------------------------- IDENTIFY -------------------------------- + +Identify-Request ::= NULL + +Identify-Response ::= SEQUENCE { + vendorName [0] IMPLICIT VisibleString, + modelName [1] IMPLICIT VisibleString, + revision [2] IMPLICIT VisibleString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL + } + +---------------------------------- RENAME -------------------------------- + +Rename-Request ::= SEQUENCE + { + extendedObjectClass [0] CHOICE { + objectClass [0] IMPLICIT INTEGER + { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + + }, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier + } + +Rename-Response ::= NULL + +---------------------------------- GET CAPABILITY LIST -------------------------------- + +GetCapabilityList-Request ::= SEQUENCE { + continueAfter VisibleString OPTIONAL + } + +GetCapabilityList-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + + + + +-- ************************************* DOMAIN **************************************** + +InitiateDownloadSequence-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString, + sharable [2] IMPLICIT BOOLEAN + } + +InitiateDownloadSequence-Response ::= NULL + +---------------------------------- DOWNLOAD SEGMENT ----------------------------------- + +DownloadSegment-Request ::= Identifier + +DownloadSegment-Response ::= SEQUENCE + { + loadData CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-------------------------------- TERMINATE DOWNLOAD ----------------------------------- + +TerminateDownloadSequence-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL + } + +TerminateDownloadSequence-Response ::= NULL + +-------------------------------- INITIATE UPLOAD ----------------------------------- + +InitiateUploadSequence-Request ::= Identifier -- Domain Name + +InitiateUploadSequence-Response ::= SEQUENCE + { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString + } + +---------------------------------- UPLOAD SEGMENT ----------------------------------- + +UploadSegment-Request ::= Integer32 -- ULSM Identifier + +UploadSegment-Response ::= SEQUENCE + { + loadData CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-------------------------------- TERMINATE UPLOAD ----------------------------------- + +TerminateUploadSequence-Request ::= Integer32 -- ULSM Identifer + +TerminateUploadSequence-Response ::= NULL + +----------------------------- REQUEST DOMAIN DOWNLOAD ----------------------------------- + +RequestDomainDownload-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName + } +RequestDomainDownload-Response ::= NULL + +----------------------------- REQUEST DOMAIN UPLOAD ----------------------------------- + +RequestDomainUpload-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName + } + +RequestDomainUpload-Response ::= NULL + +----------------------------- LOAD DOMAIN CONTENT ----------------------------------- + +LoadDomainContent-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName, + thirdParty [5] IMPLICIT ApplicationReference OPTIONAL + } + +LoadDomainContent-Response ::= NULL + +----------------------------- STORE DOMAIN CONTENT ----------------------------------- + +StoreDomainContent-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + filenName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL + } + +StoreDomainContent-Response ::= NULL + +----------------------------- DELETE DOMAIN ----------------------------------- + +DeleteDomain-Request ::= Identifier -- Domain Name + +DeleteDomain-Response ::= NULL + +----------------------------- GET DOMAIN ATTRIBUTES ----------------------------------- + +GetDomainAttributes-Request ::= Identifier -- Domain Name + +GetDomainAttributes-Response ::= SEQUENCE + { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, -- PI Names + uploadInProgress [5] IMPLICIT Integer8 + } + + +DomainState ::= INTEGER + { + non-existent (0), + loading (1), + ready (2), + in-use (3), + complete (4), + incomplete (5), + d1 (7), + d2 (8), + d3 (9), + d4 (10), + d5 (11), + d6 (12), + d7 (13), + d8 (14), + d9 (15) + } + +-- ********************************* PROGRAM INVOCATION ********************************* + + +----------------------CREATE PROGRAM INVOCATION --------------------- + +CreateProgramInvocation-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainName [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring + -- FALSE indicates CURRENT monitoring + } + +CreateProgramInvocation-Response ::= NULL + +----------------------DELETE PROGRAM INVOCATION --------------------- + +DeleteProgramInvocation-Request ::= Identifier -- Program Invocation Name + +DeleteProgramInvocation-Response ::= NULL + +----------------------------- START ------------------------------------ + +Start-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + +Start-Response ::= NULL + +Start-Error ::= ProgramInvocationState + +----------------------------- STOP ------------------------------------ + +Stop-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Stop-Response ::= NULL + +Stop-Error ::= ProgramInvocationState + +---------------------------- RESUME ------------------------------------ + +Resume-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + +Resume-Response ::= NULL + +Resume-Error ::= ProgramInvocationState + +------------------------------ RESET ------------------------------------ + +Reset-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Reset-Response ::= NULL + +Reset-Error ::= ProgramInvocationState + +------------------------------ KILL ------------------------------------ + +Kill-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Kill-Response ::= NULL + +--------------------------- GET PI ATTRIBUTES ------------------------------------ + +GetProgramInvocationAttributes-Request ::= Identifier -- Program Invocation Name + +GetProgramInvocationAttributes-Response ::= SEQUENCE + { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + startArgument [5] IMPLICIT VisibleString, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + + +ProgramInvocationState ::= INTEGER + { + non-existent (0), + unrunable (1), + idle (2), + running (3), + stopped (4), + starting (5), + stopping (6), + resuming (7), + resetting (8) + } + -- Companion Standard may add additional values + + +-- *********************************** VARIABLES **************************************** + + +TypeSpecification ::= CHOICE + { + typeName [0] ObjectName, + array [1] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification, + }, + structure [2] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + }, + + -- Simple Type -------- Size --------- + boolean [3] IMPLICIT NULL, + bit-string [4] IMPLICIT Integer32, + integer [5] IMPLICIT Unsigned8, + unsigned [6] IMPLICIT Unsigned8, + octet-string [9] IMPLICIT Integer32, + visible-string [10] IMPLICIT Integer32, + generalized-time [11] IMPLICIT NULL, + binary-time [12] IMPLICIT BOOLEAN, + bcd [13] IMPLICIT Unsigned8, + objId [15] IMPLICIT NULL + } + +AlternateAccess ::= SEQUENCE OF CHOICE + { + unnamed AlternateAccessSelection, + named [5] IMPLICIT SEQUENCE + { + componentName [0] IMPLICIT Identifier, + accesst AlternateAccessSelection + } + } + +AlternateAccessSelection ::= CHOICE + { + selectAccess CHOICE + { + component [1] IMPLICIT Identifier, + index [2] IMPLICIT Unsigned32, + indexRange [3] IMPLICIT SEQUENCE + { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [4] IMPLICIT NULL -- all array elements + } + } + + +-------------------------------- READ ------------------------------- + +Read-Request ::= SEQUENCE + { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecificatn [1] VariableAccessSpecification + } + + +Read-Response ::= SEQUENCE + { + variableAccessSpecificatn [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult + } + +-------------------------------- WRITE ------------------------------- + + + +Write-Request ::= SEQUENCE + { + variableAccessSpecificatn VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data + } + +Write-Response ::= SEQUENCE OF CHOICE + { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL + } + +---------------------------- INFORMATION REPORT -------------------------------- + +InformationReport ::= SEQUENCE + { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult + } + +------------------------- GET VARIABLE ACCESS ATTRIBUTES ------------------------ + +GetVariableAccessAttributes-Request ::= CHOICE + { + name [0] ObjectName, + address [1] Address + } + + +GetVariableAccessAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeSpecification [2] TypeSpecification + } +--------------------------- DEFINE NAMED VARIABLE -------------------------------- + +DefineNamedVariable-Request ::= SEQUENCE + { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL + } + +DefineNamedVariable-Response ::= NULL + +-------------------------- DEFINE SCATTERED ACCESS ------------------------------- + +DefineScatteredAccess-Request ::= SEQUENCE + { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription + } + + +DefineScatteredAccess-Response ::= NULL + +------------------------- GET SCATTERED ACCESS ATTRIBUTES ------------------------ + +GetScatteredAccessAttributes-Request ::= ObjectName -- ScatteredAccessName + + +GetScatteredAccessAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription + } + +----------------------------- DELETE VARIABLE ACCESS ------------------------------ + +DeleteVariableAccess-Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + +DeleteVariableAccess-Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + +DeleteVariableAccess-Error ::= Unsigned32 -- numberDeleted + +------------------------- DEFINE NAMED VAR. LIST ------------------------------- + +DefineNamedVariableList-Request ::= SEQUENCE + { + variableListName ObjectName, + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } + } + + +DefineNamedVariableList-Response ::= NULL + +------------------------- GET NAMED VAR. LIST ATTRIBUTES ------------------------ + +GetNamedVariableListAttributes-Request ::= ObjectName -- VariableListName + + +GetNamedVariableListAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } + } + +------------------------- DELETE NAMED VAR. LIST ------------------------------- + +DeleteNamedVariableList-Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + + +DeleteNamedVariableList-Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + +DeleteNamedVariableList-Error ::= Unsigned32 -- number Deleted + +------------------------- DEFINE NAMED TYPE ------------------------------- + +DefineNamedType-Request ::= SEQUENCE + { + typeName ObjectName, + typeSpecification TypeSpecification + } + + +DefineNamedType-Response ::= NULL + + +------------------------- GET NAMED TYPE ATTRIB. ------------------------------- + +GetNamedTypeAttributes-Request ::= ObjectName -- TypeName + +GetNamedTypeAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification + } + +------------------------- DELETE NAMED TYPE ------------------------------- + +DeleteNamedType-Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + +DeleteNamedType-Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + +DeleteNamedType-Error ::= Unsigned32 -- number Deleted + +---------------------------- SUPPORT DEFINITIONS ---------------------------- + +AccessResult ::= CHOICE + { + failure [0] IMPLICIT DataAccessError, + success Data + } + + +DataAccessError ::= INTEGER + { + object-invalidated (0), + hardware-fault (1), + temporarly-unavailable (2), + object-access-denied (3), + object-undefined (4), + invalid-address (5), + type-unsupported (6), + type-inconsistent (7), + object-attribute-inconsistent (8), + object-access-unsupported (9), + object-non-existent (10) + } + + + +Data ::= CHOICE + { + -- context tag 0 is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, + floating-point [7] IMPLICIT FloatingPoint, + real [8] IMPLICIT REAL, + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, + booleanArray [14] IMPLICIT BIT STRING + } + +FloatingPoint ::= OCTET STRING + + +VariableAccessSpecification ::= CHOICE + { + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + }, + variableListName [1] ObjectName + } + + +ScatteredAccessDescription ::= SEQUENCE OF SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification, + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL + } + + +VariableSpecification ::= CHOICE + { + name [0] ObjectName, + address [1] Address, + variableDescription [2] IMPLICIT SEQUENCE + { + address Address, + typeSpecification TypeSpecification + }, + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, + invalidated [4] IMPLICIT NULL + } + +Address ::= CHOICE + { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] IMPLICIT VisibleString, + unconstrainedAddress [2] IMPLICIT OCTET STRING + } + + +-- ********************************* SEMAPHORES ***************************************** + +TakeControl-Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE, + applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL + } + +TakeControl-Response ::= CHOICE + { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier + } + +-------------------------------- RELINQUISH CONTROL ----------------------------- + +RelinquishControl-Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL + } + +RelinquishControl-Response ::= NULL + +------------------------------- DEFINE SEMAPHORE -------------------------------- + +DefineSemaphore-Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + numbersOfTokens [1] IMPLICIT Unsigned16 + } + +DefineSemaphore-Response ::= NULL + +------------------------------- DELETE SEMAPHORE -------------------------------- + +DeleteSemaphore-Request ::= ObjectName -- Semaphore Name + +DeleteSemaphore-Response ::= NULL + +--------------------------- REPORT SEMAPHORE STATUS ----------------------------- + +ReportSemaphoreStatus-Request ::= ObjectName -- SemaphoreName + +ReportSemaphoreStatus-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER + { + token (0), + pool (1) + }, + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16 + } + +--------------------------- REPORT POOL SEMAPHORE STATUS ----------------------------- + +ReportPoolSemaphoreStatus-Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL + } + +ReportPoolSemaphoreStatus-Response ::= SEQUENCE + { + listOfNamedTokens [0] IMPLICIT SEQUENCE OF CHOICE + { + freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +--------------------------- REPORT SEMAPHORE ENTRY STATUS ----------------------------- + +ReportSemaphoreEntryStatus-Request ::=SEQUENCE + { + semaphoreName [0] ObjectName, + state [1] IMPLICIT INTEGER + { + queued (0), + owner (1), + hung (2) + } , + entryIdToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL + } + +ReportSemaphoreEntryStatus-Response ::= SEQUENCE + { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +AttachToSemaphore ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +SemaphoreEntry ::= SEQUENCE + { + entryId [0] IMPLICIT OCTET STRING, + entryClass [1] IMPLICIT INTEGER + { + simple (0), + modifier (1) + }, + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT 64, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE + } + +--******************************** OPERATOR COMMUNICATION ***************************** + + +------------------------------------------ INPUT ------------------------------------ + +Input-Request ::= SEQUENCE + { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, + listOfPromptData [2] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL + } + + +Input-Response ::= VisibleString -- Input String + +--------------------------------------- OUTPUT ------------------------------------- + +Output-Request ::= SEQUENCE + { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF VisibleString + } + + +Output-Response ::= NULL + + +-- ************************************ EVENTS ********************************************* + +DefineEventCondition-Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC-Class, + prio-rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL + } + +DefineEventCondition-Response ::= NULL + + +DeleteEventCondition-Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL + } + +DeleteEventCondition-Response ::= Unsigned32 -- Candidates Not Deleted + + +GetEventConditionAttributes-Request ::= ObjectName -- Event Condition Name + +GetEventConditionAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC-Class, + prio-rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable [6] CHOICE + { + variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL + } OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL + } + + +ReportEventConditionStatus-Request ::= ObjectName -- EventConditionName + +ReportEventConditionStatus-Response ::= SEQUENCE + { + currentState [0] IMPLICIT EC-State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL + } + + +AlterEventConditionMonitoring-Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL, + evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL + } + +AlterEventConditionMonitoring-Response ::= NULL + + +TriggerEvent-Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL + } + +TriggerEvent-Response ::= NULL + + +DefineEventAction-Request ::= SEQUENCE + { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL, + confirmed-Service-Request [2] DefineEventAction-ConfirmedServiceRequest + + } + + +DefineEventAction-Response ::= NULL + +DeleteEventAction-Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL + } + +DeleteEventAction-Response ::= Unsigned32 -- candidates not deleted + +GetEventActionAttributes-Request ::= ObjectName -- Event Action Name + + +GetEventActionAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier, + confirmed-Service-Request [2] DefineEventAction-ConfirmedServiceRequest + } + +ReportEventActionStatus-Request ::= ObjectName -- EventActionName + +ReportEventActionStatus-Response ::= Unsigned32 -- Number of Event Enrollments + + +DefineEventEnrollment-Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransition [2] IMPLICIT Transitions, + alarmAcknowledgementRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL, + clientApplication [5] ApplicationReference OPTIONAL + } + +DefineEventEnrollment-Response ::= NULL + +DefineEventEnrollment-Error ::= ObjectName + + +DeleteEventEnrollment-Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName + } + +DeleteEventEnrollment-Response ::= Unsigned32 -- candidates not deleted + + +GetEventEnrollmentAttributes-Request ::= SEQUENCE + { + scopeOfRequest [0] IMPLICIT INTEGER + { + specific (0), + client (1), + ec (2), + ea (3) + } DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + clientApplication [2] ApplicationReference OPTIONAL, + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL + } + + +EventEnrollment ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE + { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + eventActionName [2] CHOICE + { + eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL + } OPTIONAL, + clientApplication [3] ApplicationReference OPTIONAL, + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE-Class, + duration [6] IMPLICIT EE-Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL + } + + +GetEventEnrollmentAttributes-Response ::= SEQUENCE + { + listOfEventEnrollment [0] IMPLICIT SEQUENCE OF EventEnrollment, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +ReportEventEnrollmentStatus-Request ::= ObjectName -- Event Enrollment Name + +ReportEventEnrollmentStatus-Response ::= SEQUENCE + { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE-Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE-State + } + +AlterEventEnrollment-Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL + } + +AlterEventEnrollment-Response ::= SEQUENCE + { + currentState [0] CHOICE + { + state [0] IMPLICIT EE-State, + undefined [1] IMPLICIT NULL + }, + transitionTime [1] EventTime + } + + +AcknowledgeEventNotification-Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC-State, + timeOfAcknowledgedTransition [3] EventTime + } + +AcknowledgeEventNotification-Response ::= NULL + + +GetAlarmSummary-Request ::= SEQUENCE + { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER + { + not-acked (0), + acked (1), + all (2) + } DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE + { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL + } + +GetAlarmSummary-Response ::= SEQUENCE + { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +AlarmSummary ::= SEQUENCE + { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC-State, + unacknowledgedState [3] IMPLICIT INTEGER + { + none (0), + active (1), + idle (2), + both (3) + }, + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL + } + + +GetAlarmEnrollmentSummary-Request ::= SEQUENCE + { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER + { + not-acked (0), + acked (1), + all (2) + } DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE + { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL + } + +GetAlarmEnrollmentSummary-Response ::= SEQUENCE + { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +AlarmEnrollmentSummary ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + clientApplication [2] ApplicationReference OPTIONAL, + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC-State, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + enrollementState [8] IMPLICIT EE-State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL + } + + +EventNotification ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE + { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + severity [2] IMPLICIT Unsigned8, + currentState [3] IMPLICIT EC-State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult [8] IMPLICIT SEQUENCE + { + eventActioName ObjectName, + eventActionResult CHOICE + { + success [0] ConfirmedServiceResponse, + failure [1] IMPLICIT ServiceError + } + } OPTIONAL + } + + +AttachToEventCondition ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL + } + + +EventTime ::= CHOICE + { + timeOfDayT [0] IMPLICIT TimeOfDay, + timeSequenceIdentifier [1] IMPLICIT Unsigned32 + } + + +EC-Class ::= INTEGER + { + network-triggered (0), + monitored (1) + } + +EC-State ::= INTEGER + { + disabled (0), + idle (1), + active (2) + } + +EE-State ::= INTEGER + { + disabled (0), + idle (1), + active (2), + activeNoAckA (3), + idleNoAckI (4), + idleNoAckA (5), + idleAcked (6), + activeAcked (7) + } + +Transitions ::= BIT STRING + { + idle-to-disabled (0), + active-to-disabled (1), + disabled-to-idle (2), + active-to-idle (3), + disabled-to-active (4), + idle-to-active (5), + any-to-deleted (6) + } + +AlarmAckRule ::= INTEGER + { + none (0), + simple (1), + ack-active (2), + ack-all (3) + } + +EE-Class ::= INTEGER + { + modifier (0), + notification (1) + } + +EE-Duration ::= INTEGER + { + current (0), + permanent (1) + } + + +-- ********************************** JOURNAL ******************************************* + + +---------------------------------- READ JOURNAL ---------------------------------- + +ReadJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName, + rangeStartSpecification [1] CHOICE + { + startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING + } OPTIONAL, + rangeStopSpecification [2] CHOICE + { + endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32 + } OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter [5] IMPLICIT SEQUENCE + { + timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING + } + } + +ReadJournal-Response ::= SEQUENCE + { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +JournalEntry ::= SEQUENCE + { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent + } + +---------------------------------- WRITE JOURNAL ---------------------------------- + +WriteJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent + } + +WriteJournal-Response ::= NULL + +-------------------------------- INITIALIZE JOURNAL ---------------------------------- + +InitializeJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName, + limitSpecification [1] IMPLICIT SEQUENCE + { + limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL + } OPTIONAL + } + +InitializeJournal-Response ::= Unsigned32 -- entries deleted + +---------------------------------- REPORT JOURNAL STATUS ----------------------------- + +ReportJournalStatus-Request ::= ObjectName -- Journal Name + +ReportJournalStatus-Response ::= SEQUENCE + { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN + } + +---------------------------------- CREATE JOURNAL ---------------------------------- + +CreateJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName + } + +CreateJournal-Response ::= NULL + +---------------------------------- DELETE JOURNAL ---------------------------------- + +DeleteJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName + } + +DeleteJournal-Response ::= NULL + + +-------------------------------- SUPPORTING PRODUCTIONS ---------------------------- + +EntryContent ::= SEQUENCE + { + occurenceTime [0] IMPLICIT TimeOfDay, + additionalDetail [1] JOU-Additional-Detail OPTIONAL, + -- additionalDetail shall be omitted + -- from abstract syntax defined in this standard + entryForm CHOICE + { + data [2] IMPLICIT SEQUENCE + { + event [0] IMPLICIT SEQUENCE + { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State + } OPTIONAL, + listOfVariables [1] IMPLICIT SEQUENCE OF SEQUENCE + { + variableTag [0] IMPLICIT VisibleString, + valueSpecification [1] Data + } OPTIONAL + }, + annotation [3] IMPLICIT VisibleString + } + } + + +JOU-Additional-Detail ::= NULL -- Defined by Companion Standard + + + +-- **************************************** FILES ********************************************* + +ObtainFile-Request ::= SEQUENCE { + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName + } + +ObtainFile-Response ::= NULL + +ObtainFile-Error ::= INTEGER { + source-file (0), + destination-file (1) + } + + +FileOpen-Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32 + } + +FileOpen-Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes + } + +FileRead-Request ::= Integer32 + +FileRead-Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +FileClose-Request ::= Integer32 + +FileClose-Response ::= NULL + + +FileRename-Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName + } + +FileRename-Response ::= NULL + +FileRename-Error ::= INTEGER { + source-file (0), + destination-file (1) + } + +FileDelete-Request ::= FileName + +FileDelete-Response ::= NULL + + +FileDirectory-Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL + } + +FileDirectory-Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + +DirectoryEntry ::= SEQUENCE { + filename [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes + } + + +FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL + } + + + +END + diff --git a/asn1/mms/more-asn1-files/mms-stefan.asn b/asn1/mms/more-asn1-files/mms-stefan.asn new file mode 100644 index 0000000..210090a --- /dev/null +++ b/asn1/mms/more-asn1-files/mms-stefan.asn @@ -0,0 +1,318 @@ +MMSDEF DEFINITIONS::= +BEGIN + +MMSpdu ::= CHOICE { +confirmed_RequestPDU [0] IMPLICIT Confirmed_RequestPDU, +confirmed_ResponsePDU [1] IMPLICIT Confirmed_ResponsePDU, +initiate_RequestPDU [8] IMPLICIT Initiate_RequestPDU, +initiate_ResponsePDU [9] IMPLICIT Initiate_ResponsePDU +} + +Initiate_RequestPDU ::= SEQUENCE { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initRequestDetail [4] IMPLICIT SEQUENCE { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions + } +} + +Initiate_ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initResponseDetail [4] IMPLICIT SEQUENCE { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions + } +} + +ParameterSupportOptions ::= BIT STRING { + + str1 (0), + str2 (1), + vnam (2), + valt (3), + vadr (4), + -- bit 5 is reserved + vsca (5), + tpy (6), + vlis (7), + -- bit 8 is reserved + -- bit 9 is reserved + cei (10), + aco (11), + sem (12), + csr (13), + csnc (14), + csplc (15), + cspi (16) +} + +ServiceSupportOptions ::= BIT STRING { + status (0), + getNameList (1), + identify (2), + rename (3), + read (4), + write (5), + getVariableAccessAttributes (6), + defineNamedVariable (7), + -- bit 8 is reserved for use of a service defined in annex E + defineScatteredAccess (8), + -- bit 9 is reserved for use of a service defined in annex E + getScatteredAccessAttributes (9), + deleteVariableAccess (10), + defineNamedVariableList (11), + getNamedVariableListAttributes (12), + deleteNamedVariableList (13), + defineNamedType (14), + getNamedTypeAttributes (15), + deleteNamedType (16), + input (17), + output (18), + takeControl (19), + relinquishControl (20), + defineSemaphore (21), + deleteSemaphore (22), + reportSemaphoreStatus (23), + reportPoolSemaphoreStatus (24), + reportSemaphoreEntryStatus (25), + initiateDownloadSequence (26), + downloadSegment (27), + terminateDownloadSequence (28), + initiateUploadSequence (29), + uploadSegment (30), + terminateUploadSequence (31), + requestDomainDownload (32), + requestDomainUpload (33), + loadDomainContent (34), + storeDomainContent (35), + deleteDomain (36), + getDomainAttributes (37), + createProgramInvocation (38), + deleteProgramInvocation (39), + start (40), + stop (41), + resume (42), + reset (43), + kill (44), + getProgramInvocationAttributes (45), + obtainFile (46), + defineEventCondition (47), + deleteEventCondition (48), + getEventConditionAttributes (49), + reportEventConditionStatus (50), + alterEventConditionMonitoring (51), + triggerEvent (52), + defineEventAction (53), + deleteEventAction (54), + getEventActionAttributes (55), + reportEventActionStatus (56), + defineEventEnrollment (57), + deleteEventEnrollment (58), + alterEventEnrollment (59), + reportEventEnrollmentStatus (60), + getEventEnrollmentAttributes (61), + acknowledgeEventNotification (62), + getAlarmSummary (63), + getAlarmEnrollmentSummary (64), + readJournal (65), + writeJournal (66), + initializeJournal (67), + reportJournalStatus (68), + createJournal (69), + deleteJournal (70), + getCapabilityList (71), + -- bit 72 is reserved for use of a service defined in annex D + fileOpen (72), + -- bit 73 is reserved for use of a service defined in annex D + fileRead (73), + -- bit 74 is reserved for use of a service defined in annex D + fileClose (74), + -- bit 75 is reserved for use of a service defined in annex D + fileRename (75), + -- bit 76 is reserved for use of a service defined in annex D + fileDelete (76), + -- bit 77 is reserved for use of a service defined in annex D + fileDirectory (77), + unsolicitedStatus (78), + informationReport (79), + eventNotification (80), + attachToEventCondition (81), + attachToSemaphore (82), + conclude (83), + cancel (84), + getDataExchangeAttributes (85), + -- Shall not appear in minor version one + exchangeData (86), + -- Shall not appear in minor version one + defineAccessControlList (87), + -- Shall not appear in minor version one or two + getAccessControlListAttributes (88), + -- Shall not appear in minor version one or two + reportAccessControlledObjects (89), + -- Shall not appear in minor version one or two + deleteAccessControlList (90), + -- Shall not appear in minor version one or two + alterAccessControl (91), + -- Shall not appear in minor version one or two + reconfigureProgramInvocation (92) +} + + + +Confirmed_RequestPDU ::= SEQUENCE { +invokeID Unsigned32, +service ConfirmedServiceRequest +} + +Confirmed_ResponsePDU ::= SEQUENCE { +invokeID Unsigned32, +service ConfirmedServiceResponse +} + +GetNameList_Response ::= SEQUENCE { +listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, +moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + + + +Integer8 ::= INTEGER(-128..127) -- range -128 <= i <= 127 +Integer16 ::= INTEGER(-32768..32767) -- range -32,768 <= i <= 32,767 +Integer32 ::= INTEGER(-2147483648..2147483647) -- range -2**31 <= i < 2**31 +Unsigned8 ::= INTEGER + + Unsigned16 ::= INTEGER(0..32767) -- range 0 <= i <= 32767 + +Unsigned32 ::= INTEGER(0..2147483647) -- range 0 <= i <= 2**31 - 1 + +ConfirmedServiceRequest ::= CHOICE { + getNameList [1] IMPLICIT GetNameList_Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes_Request +} + +GetVariableAccessAttributes_Request ::= CHOICE +{ + name [0] ObjectName, + address [1] Address +} + +ObjectName ::= CHOICE + { + vmd_specific [0] IMPLICIT Identifier, + domain_specific [1] IMPLICIT SEQUENCE + { + domainId Identifier, + itemId Identifier + }, + aa_specific [2] IMPLICIT Identifier + } + + Address ::= CHOICE + { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] IMPLICIT VisibleString, + unconstrainedAddress [2] IMPLICIT OCTET STRING + } + + + +ConfirmedServiceResponse ::= CHOICE { + getNameList [1] IMPLICIT GetNameList_Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes_Response +} + +GetVariableAccessAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeSpecification [2] TypeSpecification + } + +TypeSpecification ::= CHOICE + { + typeName [0] ObjectName, + array [1] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification + }, + structure [2] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF StructComponent + }, + + -- Simple Type -------- Size --------- + tboolean [3] IMPLICIT NULL, + bit_string [4] IMPLICIT Integer32, + integer [5] IMPLICIT Unsigned8, + unsigned [6] IMPLICIT Unsigned8, + floating_point [7] IMPLICIT SEQUENCE { + + format_width Unsigned8, -- number of bits of + -- floating point value + -- including sign, exponent, + -- and fraction + exponent_width Unsigned8 -- size of exponent in bits + }, + octet_string [9] IMPLICIT Integer32, + visible_string [10] IMPLICIT Integer32, + generalized_time [11] IMPLICIT NULL, + binary_time [12] IMPLICIT BOOLEAN, + bcd [13] IMPLICIT Unsigned8, + objId [15] IMPLICIT NULL, + mMSString [16] Integer32, + -- added by stefan + timestamp [17] IMPLICIT NULL + } + +StructComponent ::= SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + + +GetNameList_Request ::= SEQUENCE { + objectClass [0] ObjectClass, + objectScope [1] CHOICE { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL +} + + + +Identifier ::= VisibleString + +ObjectClass ::= CHOICE { + +basicObjectClass [0] IMPLICIT INTEGER { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11), + dataExchange (12), -- Shall not appear in minor version 1 + accessControlList (13) -- Shall not appear in minor version 1 or 2 + } +} + +END \ No newline at end of file diff --git a/asn1/mms/more-asn1-files/mms-uniroma.asn b/asn1/mms/more-asn1-files/mms-uniroma.asn new file mode 100644 index 0000000..ef12923 --- /dev/null +++ b/asn1/mms/more-asn1-files/mms-uniroma.asn @@ -0,0 +1,2217 @@ +--Quelle: http://minerva.netgroup.uniroma2.it/svn/discreet/tfcproject/trunk/wireshark/asn1/mms/mms.asn +-- ASN definition from +-- http://www.sisconet.com/techinfo.htm +-- slightly modified +-- +-- +--Corrections made July 2, 1994 +-- +-- +-- Modified to pass asn2wrs + +MMS { iso standard 9506 part(2) mms-general-module-version(2) } + +DEFINITIONS ::= + +BEGIN + +EXPORTS MMSpdu; + +IMPORTS + EXTERNAL, + AP-title, + AP-invocation-identifier, + AE-qualifier, + AE-invocation-identifier +FROM ISO-8650-ACSE-1; + + +MMSpdu ::= CHOICE + { + confirmed_RequestPDU [0] IMPLICIT Confirmed_RequestPDU, + confirmed_ResponsePDU [1] IMPLICIT Confirmed_ResponsePDU, + confirmed_ErrorPDU [2] IMPLICIT Confirmed_ErrorPDU, + unconfirmed_PDU [3] IMPLICIT Unconfirmed_PDU, + rejectPDU [4] IMPLICIT RejectPDU, + cancel_RequestPDU [5] IMPLICIT Cancel_RequestPDU, + cancel_ResponsePDU [6] IMPLICIT Cancel_ResponsePDU, + cancel_ErrorPDU [7] IMPLICIT Cancel_ErrorPDU, + initiate_RequestPDU [8] IMPLICIT Initiate_RequestPDU, + initiate_ResponsePDU [9] IMPLICIT Initiate_ResponsePDU, + initiate_ErrorPDU [10] IMPLICIT Initiate_ErrorPDU, + conclude_RequestPDU [11] IMPLICIT Conclude_RequestPDU, + conclude_ResponsePDU [12] IMPLICIT Conclude_ResponsePDU, + conclude_ErrorPDU [13] IMPLICIT Conclude_ErrorPDU + } + + +Confirmed_RequestPDU ::= SEQUENCE + { + invokeID Unsigned32, + listOfModifier SEQUENCE OF Modifier OPTIONAL, + confirmedServiceRequest ConfirmedServiceRequest, + cs_Request-detail [79] CS_Request-Detail OPTIONAL + } + + +Unconfirmed_PDU ::= SEQUENCE + { + unconfirmedService UnconfirmedService, + cs_Request-detail [79] CS_Request-Detail OPTIONAL + } + + +Confirmed_ResponsePDU ::= SEQUENCE + { + invokeID Unsigned32, + confirmedServiceResponse ConfirmedServiceResponse, + cs_Request-detail [79] CS_Request-Detail OPTIONAL + } + + +Confirmed_ErrorPDU ::= SEQUENCE + { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError + } + + +UnconfirmedService ::= CHOICE + { + informationReport [0] IMPLICIT InformationReport, + unsolicitedStatus [1] IMPLICIT UnsolicitedStatus, + eventNotification [2] IMPLICIT EventNotification +-- XXX this one is neither in this ASN nor in the IMPORTS +-- additionalService [3] AdditionalUnconfirmedService + } + + +Modifier ::= CHOICE + { + attach-To-Event-Condition [0] IMPLICIT AttachToEventCondition, + attach-To-Semaphore [1] IMPLICIT AttachToSemaphore + } + + +ConfirmedServiceRequest ::= CHOICE + { + status [0] IMPLICIT Status_Request, + getNameList [1] IMPLICIT GetNameList_Request, + identify [2] IMPLICIT Identify_Request, + rename [3] IMPLICIT Rename_Request, + read [4] IMPLICIT Read_Request, + write [5] IMPLICIT Write_Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes_Request, + defineNamedVariable [7] IMPLICIT DefineNamedVariable_Request, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess_Request, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes_Request, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess_Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList_Request, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes_Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList_Request, + defineNamedType [14] IMPLICIT DefineNamedType_Request, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes_Request, + deleteNamedType [16] IMPLICIT DeleteNamedType_Request, + input [17] IMPLICIT Input_Request, + output [18] IMPLICIT Output_Request, + takeControl [19] IMPLICIT TakeControl_Request, + relinquishControl [20] IMPLICIT RelinquishControl_Request, + defineSemaphore [21] IMPLICIT DefineSemaphore_Request, + deleteSemaphore [22] IMPLICIT DeleteSemaphore_Request, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus_Request, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus_Request, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus_Request, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence_Request, + downloadSegment [27] IMPLICIT DownloadSegment_Request, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence_Request, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence_Request, + uploadSegment [30] IMPLICIT UploadSegment_Request, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence_Request, + requestDomainDownload [32] IMPLICIT RequestDomainDownload_Request, + requestDomainUpload [33] IMPLICIT RequestDomainUpload_Request, + loadDomainContent [34] IMPLICIT LoadDomainContent_Request, + storeDomainContent [35] IMPLICIT StoreDomainContent_Request, + deleteDomain [36] IMPLICIT DeleteDomain_Request, + getDomainAttributes [37] IMPLICIT GetDomainAttributes_Request, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Request, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation_Request, + start [40] IMPLICIT Start_Request, + stop [41] IMPLICIT Stop_Request, + resume [42] IMPLICIT Resume_Request, + reset [43] IMPLICIT Reset_Request, + kill [44] IMPLICIT Kill_Request, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes_Request, + obtainFile [46] IMPLICIT ObtainFile_Request, + defineEventCondition [47] IMPLICIT DefineEventCondition_Request, + deleteEventCondition [48] DeleteEventCondition_Request, + getEventConditionAttributes [49] GetEventConditionAttributes_Request, + reportEventConditionStatus [50] ReportEventConditionStatus_Request, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Request, + triggerEvent [52] IMPLICIT TriggerEvent_Request, + defineEventAction [53] IMPLICIT DefineEventAction_Request, + deleteEventAction [54] DeleteEventAction_Request, + getEventActionAttributes [55] GetEventActionAttributes_Request, + reportEventActionStatus [56] ReportEventActionStatus_Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Request, + deleteEventEnrollment [58] DeleteEventEnrollment_Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Request, + reportEventEnrollmentStatus [60] ReportEventEnrollmentStatus_Request, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes_Request, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification_Request, + getAlarmSummary [63] IMPLICIT GetAlarmSummary_Request, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary_Request, + readJournal [65] IMPLICIT ReadJournal_Request, + writeJournal [66] IMPLICIT WriteJournal_Request, + initializeJournal [67] IMPLICIT InitializeJournal_Request, + reportJournalStatus [68] IMPLICIT ReportJournalStatus_Request, + createJournal [69] IMPLICIT CreateJournal_Request, + deleteJournal [70] IMPLICIT DeleteJournal_Request, + getCapabilityList [71] IMPLICIT GetCapabilityList_Request, + fileOpen [72] IMPLICIT FileOpen_Request, + fileRead [73] IMPLICIT FileRead_Request, + fileClose [74] IMPLICIT FileClose_Request, + fileRename [75] IMPLICIT FileRename_Request, + fileDelete [76] IMPLICIT FileDelete_Request, + fileDirectory [77] IMPLICIT FileDirectory_Request +-- XXX this one is neither in this ASN nor in the IMPORTS +-- additionalService [78] AdditionalService_Request + } + +CS_Request-Detail ::= CHOICE { +-- see ISO 9506-2 +-- XXX can not handle empty choice +-- XXX fix me later + foo INTEGER + } + +ConfirmedServiceResponse ::= CHOICE + { + status [0] IMPLICIT Status_Response, + getNameList [1] IMPLICIT GetNameList_Response, + identify [2] IMPLICIT Identify_Response, + rename [3] IMPLICIT Rename_Response, + read [4] IMPLICIT Read_Response, + write [5] IMPLICIT Write_Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes_Response, + defineNamedVariable [7] IMPLICIT DefineNamedVariable_Response, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess_Response, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes_Response, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess_Response, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList_Response, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes_Response, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList_Response, + defineNamedType [14] IMPLICIT DefineNamedType_Response, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes_Response, + deleteNamedType [16] IMPLICIT DeleteNamedType_Response, + input [17] IMPLICIT Input_Response, + output [18] IMPLICIT Output_Response, + takeControl [19] TakeControl_Response, + relinquishControl [20] IMPLICIT RelinquishControl_Response, + defineSemaphore [21] IMPLICIT DefineSemaphore_Response, + deleteSemaphore [22] IMPLICIT DeleteSemaphore_Response, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus_Response, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus_Response, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus_Response, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence_Response, + downloadSegment [27] IMPLICIT DownloadSegment_Response, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence_Response, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence_Response, + uploadSegment [30] IMPLICIT UploadSegment_Response, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence_Response, + requestDomainDownLoad [32] IMPLICIT RequestDomainDownload_Response, + requestDomainUpload [33] IMPLICIT RequestDomainUpload_Response, + loadDomainContent [34] IMPLICIT LoadDomainContent_Response, + storeDomainContent [35] IMPLICIT StoreDomainContent_Response, + deleteDomain [36] IMPLICIT DeleteDomain_Response, + getDomainAttributes [37] IMPLICIT GetDomainAttributes_Response, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Response, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation_Response, + start [40] IMPLICIT Start_Response, + stop [41] IMPLICIT Stop_Response, + resume [42] IMPLICIT Resume_Response, + reset [43] IMPLICIT Reset_Response, + kill [44] IMPLICIT Kill_Response, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes_Response, + obtainFile [46] IMPLICIT ObtainFile_Response, + fileOpen [72] IMPLICIT FileOpen_Response, + defineEventCondition [47] IMPLICIT DefineEventCondition_Response, + deleteEventCondition [48] IMPLICIT DeleteEventCondition_Response, + getEventConditionAttributes [49] IMPLICIT GetEventConditionAttributes_Response, + reportEventConditionStatus [50] IMPLICIT ReportEventConditionStatus_Response, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Response, + triggerEvent [52] IMPLICIT TriggerEvent_Response, + defineEventAction [53] IMPLICIT DefineEventAction_Response, + deleteEventAction [54] IMPLICIT DeleteEventAction_Response, + getEventActionAttributes [55] IMPLICIT GetEventActionAttributes_Response, + reportActionStatus [56] IMPLICIT ReportEventActionStatus_Response, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Response, + deleteEventEnrollment [58] IMPLICIT DeleteEventEnrollment_Response, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Response, + reportEventEnrollmentStatus [60] IMPLICIT ReportEventEnrollmentStatus_Response, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes_Response, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification_Response, + getAlarmSummary [63] IMPLICIT GetAlarmSummary_Response, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary_Response, + readJournal [65] IMPLICIT ReadJournal_Response, + writeJournal [66] IMPLICIT WriteJournal_Response, + initializeJournal [67] IMPLICIT InitializeJournal_Response, + reportJournalStatus [68] IMPLICIT ReportJournalStatus_Response, + createJournal [69] IMPLICIT CreateJournal_Response, + deleteJournal [70] IMPLICIT DeleteJournal_Response, + getCapabilityList [71] IMPLICIT GetCapabilityList_Response, + fileRead [73] IMPLICIT FileRead_Response, + fileClose [74] IMPLICIT FileClose_Response, + fileRename [75] IMPLICIT FileRename_Response, + fileDelete [76] IMPLICIT FileDelete_Response, + fileDirectory [77] IMPLICIT FileDirectory_Response +-- XXX this one is neither in this ASN nor in the IMPORTS +-- additionalService [78] AdditionalService_Response + } + +--********************************** COMMON MMS TYPES *********************************** + +FileName ::= SEQUENCE OF GraphicString + +TimeOfDay ::= OCTET STRING -- (SIZE (4 | 6)) + +Identifier ::= VisibleString + +Integer8 ::= INTEGER +Integer16 ::= INTEGER +Integer32 ::= INTEGER + + +Unsigned8 ::= INTEGER +Unsigned16 ::= INTEGER +Unsigned32 ::= INTEGER + + +ObjectName ::= CHOICE + { + vmd-specific [0] IMPLICIT Identifier, + domain-specific [1] IMPLICIT SEQUENCE + { + domainId Identifier, + itemId Identifier + }, + aa-specific [2] IMPLICIT Identifier + } + + +ApplicationReference ::= SEQUENCE + { + ap-title [0] AP-title OPTIONAL, + ap-invocation-id [1] AP-invocation-identifier OPTIONAL, + ae-qualifier [2] AE-qualifier OPTIONAL, + ae-invocation-id [3] AE-invocation-identifier OPTIONAL + } + + +Priority ::= Unsigned8 + +normalPriority Priority ::= 64 + + + + + +-- ************************************ GENERAL ************************************* + +Initiate_ErrorPDU ::= ServiceError + +Initiate_RequestPDU ::= SEQUENCE + { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitRequestDetail [4] IMPLICIT InitRequestDetail + } + +InitRequestDetail ::= SEQUENCE + { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions + } + +Initiate_ResponsePDU ::= SEQUENCE + { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitResponseDetail [4] IMPLICIT InitResponseDetail + } + +InitResponseDetail ::= SEQUENCE + { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions + } + + +ParameterSupportOptions ::= BIT STRING { + str1 (0), + str2 (1), + vnam (2), + valt (3), + vadr (4), + vsca (5), + tpy (6), + vlis (7), + real (8), + cei (10) + } + + +ServiceSupportOptions ::= BIT STRING + { + status (0), + getNameList (1), + identify (2), + rename (3), + read (4), + write (5), + getVariableAccessAttributes (6), + defineNamedVariable (7), + defineScatteredAccess (8), + getScatteredAccessAttributes (9), + deleteVariableAccess (10), + defineNamedVariableList (11), + getNamedVariableListAttributes (12), + deleteNamedVariableList (13), + defineNamedType (14), + getNamedTypeAttributes (15), + deleteNamedType (16), + input (17), + output (18), + takeControl (19), + relinquishControl (20), + defineSemaphore (21), + deleteSemaphore (22), + reportSemaphoreStatus (23), + reportPoolSemaphoreStatus (24), + reportSemaphoreEntryStatus (25), + initiateDownloadSequence (26), + downloadSegment (27), + terminateDownloadSequence (28), + initiateUploadSequence (29), + uploadSegment (30), + terminateUploadSequence (31), + requestDomainDownload (32), + requestDomainUpload (33), + loadDomainContent (34), + storeDomainContent (35), + deleteDomain (36), + getDomainAttributes (37), + createProgramInvocation (38), + deleteProgramInvocation (39), + start (40), + stop (41), + resume (42), + reset (43), + kill (44), + getProgramInvocationAttributes (45), + obtainFile (46), + defineEventCondition (47), + deleteEventCondition (48), + getEventConditionAttributes (49), + reportEventConditionStatus (50), + alterEventConditionMonitoring (51), + triggerEvent (52), + defineEventAction (53), + deleteEventAction (54), + getEventActionAttributes (55), + reportActionStatus (56), + defineEventEnrollment (57), + deleteEventEnrollment (58), + alterEventEnrollment (59), + reportEventEnrollmentStatus (60), + getEventEnrollmentAttributes (61), + acknowledgeEventNotification (62), + getAlarmSummary (63), + getAlarmEnrollmentSummary (64), + readJournal (65), + writeJournal (66), + initializeJournal (67), + reportJournalStatus (68), + createJournal (69), + deleteJournal (70), + getCapabilityList (71), + fileOpen (72), + fileRead (73), + fileClose (74), + fileRename (75), + fileDelete (76), + fileDirectory (77), + unsolicitedStatus (78), + informationReport (79), + eventNotification (80), + attachToEventCondition (81), + attachToSemaphore (82), + conclude (83), + cancel (84) + } + +---------------------------------- CONCLUDE -------------------------------- + +Conclude_RequestPDU ::= NULL + +Conclude_ResponsePDU ::= NULL + +Conclude_ErrorPDU ::= ServiceError + +---------------------------------- CANCEL -------------------------------- + +Cancel_RequestPDU ::= Unsigned32 -- originalInvokeID + +Cancel_ResponsePDU ::= Unsigned32 -- originalInvokeID + +Cancel_ErrorPDU ::= SEQUENCE + { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError + } + +------------------------------ Service_Error -------------------------------- + +ServiceError ::= SEQUENCE + { + errorClass [0] CHOICE + { + vmd-state [0] IMPLICIT INTEGER + { + other (0), + vmd-state-conflict (1), + vmd-operational-problem (2), + domain-transfer-problem (3), + state-machine-id-invalid (4) + }, + application-reference [1] IMPLICIT INTEGER + { + other (0), + aplication-unreachable (1), + connection-lost (2), + application-reference-invalid (3), + context-unsupported (4) + }, + definition [2] IMPLICIT INTEGER + { + other (0), + object-undefined (1), + invalid-address (2), + type-unsupported (3), + type-inconsistent (4), + object-exists (5), + object-attribute-inconsistent (6) + }, + resource [3] IMPLICIT INTEGER + { + other (0), + memory-unavailable (1), + processor-resource-unavailable (2), + mass-storage-unavailable (3), + capability-unavailable (4), + capability-unknown (5) + }, + service [4] IMPLICIT INTEGER + { + other (0), + primitives-out-of-sequence (1), + object-sate-conflict (2), + pdu-size (3), + continuation-invalid (4), + object-constraint-conflict (5) + }, + service-preempt [5] IMPLICIT INTEGER + { + other (0), + timeout (1), + deadlock (2), + cancel (3) + }, + time-resolution [6] IMPLICIT INTEGER + { + other (0), + unsupportable-time-resolution (1) + }, + access [7] IMPLICIT INTEGER + { + other (0), + object-access-unsupported (1), + object-non-existent (2), + object-access-denied (3), + object-invalidated (4) + }, + initiate [8] IMPLICIT INTEGER + { + other (0), + version-incompatible (1), + max-segment-insufficient (2), + max-services-outstanding-calling-insufficient (3), + max-services-outstanding-called-insufficient (4), + service-CBB-insufficient (5), + parameter-CBB-insufficient (6), + nesting-level-insufficient (7) + }, + conclude [9] IMPLICIT INTEGER + { + other (0), + further-communication-required (1) + }, + cancel [10] IMPLICIT INTEGER + { + other (0), + invoke-id-unknown (1), + cancel-not-possible (2) + }, + file [11] IMPLICIT INTEGER + { + other (0), + filename-ambiguous (1), + file-busy (2), + filename-syntax_Error (3), + content-type-invalid (4), + position-invalid (5), + file-acces-denied (6), + file-non-existent (7), + duplicate-filename (8), + insufficient-space-in-filestore (9) + }, + others [12] IMPLICIT INTEGER + }, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInformation [3] CHOICE + { + obtainFile [0] IMPLICIT ObtainFile_Error, + start [1] IMPLICIT Start_Error, + stop [2] IMPLICIT Stop_Error, + resume [3] IMPLICIT Resume_Error, + reset [4] IMPLICIT Reset_Error, + deleteVariableAccess [5] IMPLICIT DeleteVariableAccess_Error, + deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList_Error, + deleteNamedType [7] IMPLICIT DeleteNamedType_Error, + defineEventEnrollment_Error [8] DefineEventEnrollment_Error, + fileRename [9] IMPLICIT FileRename_Error +-- XXX this one is neither in this ASN nor in the IMPORTS +-- additionalService [10] AdditionalServiceError + } OPTIONAL + } + + +---------------------------------- REJECT -------------------------------- + +RejectPDU ::= SEQUENCE + { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE + { + confirmed_RequestPDU [1] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + unrecognized-modifier (2), + invalid-invokeID (3), + invalid-argument (4), + invalid-modifier (5), + max-serv-outstanding-exceeded (6), + max-recursion-exceeded (8), + value-out-of-range (9) + }, + + confirmed_ResponsePDU [2] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-result (3), + max-recursion-exceeded (5), + value-out-of-range (6) + }, + + confirmed_ErrorPDU [3] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-serviceError (3), + value-out-of-range (4) + } , + + unconfirmedPDU [4] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-argument (2), + max-recursion-exceeded (3), + value-out-of-range (4) + }, + + pdu_Error [5] IMPLICIT INTEGER + { + unknown_PDU-type (0), + invalid_PDU (1), + illegal-acse-mapping (2) + }, + + cancel_RequestPDU [6] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1) + }, + + cancel_ResponsePDU [7] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1) + }, + + cancel_ErrorPDU [8] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1), + invalid-serviceError (2), + value-out-of-range (3) + }, + + conclude_RequestPDU [9] IMPLICIT INTEGER + { + other (0), + invalid-argument (1) + }, + + conclude_ResponsePDU [10] IMPLICIT INTEGER + { + other (0), + invalid-result (1) + }, + + conclude_ErrorPDU [11] IMPLICIT INTEGER + { + other (0), + invalid-serviceError (1), + value-out-of-range (2) + } + } + } + + +-- *************************************** VMD ******************************************** + + +Status_Request ::= BOOLEAN + +Status_Response ::= SEQUENCE { + vmdLogicalStatus [0] IMPLICIT INTEGER { + state-changes-allowed (0), + no-state-changes-allowed (1), + limited-services-allowed (2), + support-services-allowed (3) + }, + vmdPhysicalStatus [1] IMPLICIT INTEGER { + operational (0), + partially-operational (1), + inoperable (2), + needs-commissioning (3) + }, + localDetail [2] IMPLICIT BIT STRING(SIZE(0..128)) OPTIONAL + + } + +-- UNSOLICITEDSTATUS + +UnsolicitedStatus ::= Status_Response + +-- GETNAMELIST + +GetNameList_Request ::= SEQUENCE + { + extendedObjectClass [0] CHOICE + { + objectClass [0] IMPLICIT INTEGER + { + nammedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + }, + objectScope [1] CHOICE + { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL + } + +GetNameList_Response ::= SEQUENCE + { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +---------------------------------- IDENTIFY -------------------------------- + +Identify_Request ::= NULL + +Identify_Response ::= SEQUENCE { + vendorName [0] IMPLICIT VisibleString, + modelName [1] IMPLICIT VisibleString, + revision [2] IMPLICIT VisibleString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL + } + +---------------------------------- RENAME -------------------------------- + +Rename_Request ::= SEQUENCE + { + extendedObjectClass [0] CHOICE { + objectClass [0] IMPLICIT INTEGER + { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + + }, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier + } + +Rename_Response ::= NULL + +---------------------------------- GET CAPABILITY LIST -------------------------------- + +GetCapabilityList_Request ::= SEQUENCE { + continueAfter VisibleString OPTIONAL + } + +GetCapabilityList_Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + + + + +-- ************************************* DOMAIN **************************************** + +InitiateDownloadSequence_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString, + sharable [2] IMPLICIT BOOLEAN + } + +InitiateDownloadSequence_Response ::= NULL + +-- DOWNLOAD SEGMENT + +DownloadSegment_Request ::= Identifier + +DownloadSegment_Response ::= SEQUENCE + { + loadData CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-- TERMINATE DOWNLOAD + +TerminateDownloadSequence_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL + } + +TerminateDownloadSequence_Response ::= NULL + +-- INITIATE UPLOAD + +InitiateUploadSequence_Request ::= Identifier -- Domain Name + +InitiateUploadSequence_Response ::= SEQUENCE + { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString + } + +-- UPLOAD SEGMENT + +UploadSegment_Request ::= Integer32 -- ULSM Identifier + +UploadSegment_Response ::= SEQUENCE + { + loadData CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-- TERMINATE UPLOAD + +TerminateUploadSequence_Request ::= Integer32 -- ULSM Identifer + +TerminateUploadSequence_Response ::= NULL + +-- REQUEST DOMAIN DOWNLOAD + +RequestDomainDownload_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName + } +RequestDomainDownload_Response ::= NULL + +-- REQUEST DOMAIN UPLOAD + +RequestDomainUpload_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName + } + +RequestDomainUpload_Response ::= NULL + +-- LOAD DOMAIN CONTENT + +LoadDomainContent_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName, + thirdParty [5] IMPLICIT ApplicationReference OPTIONAL + } + +LoadDomainContent_Response ::= NULL + +-- STORE DOMAIN CONTENT + +StoreDomainContent_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + filenName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL + } + +StoreDomainContent_Response ::= NULL + +-- DELETE DOMAIN + +DeleteDomain_Request ::= Identifier -- Domain Name + +DeleteDomain_Response ::= NULL + +-- GET DOMAIN ATTRIBUTES + +GetDomainAttributes_Request ::= Identifier -- Domain Name + +GetDomainAttributes_Response ::= SEQUENCE + { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, -- PI Names + uploadInProgress [5] IMPLICIT Integer8 + } + + +DomainState ::= INTEGER + { + non-existent (0), + loading (1), + ready (2), + in-use (3), + complete (4), + incomplete (5), + d1 (7), + d2 (8), + d3 (9), + d4 (10), + d5 (11), + d6 (12), + d7 (13), + d8 (14), + d9 (15) + } + +-- ********************************* PROGRAM INVOCATION ********************************* + + +-- CREATE PROGRAM INVOCATION + +CreateProgramInvocation_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainName [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring + -- FALSE indicates CURRENT monitoring + } + +CreateProgramInvocation_Response ::= NULL + +-- DELETE PROGRAM INVOCATION + +DeleteProgramInvocation_Request ::= Identifier -- Program Invocation Name + +DeleteProgramInvocation_Response ::= NULL + +-- START + +Start_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + +Start_Response ::= NULL + +Start_Error ::= ProgramInvocationState + +-- STOP + +Stop_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Stop_Response ::= NULL + +Stop_Error ::= ProgramInvocationState + +-- RESUME + +Resume_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + +Resume_Response ::= NULL + +Resume_Error ::= ProgramInvocationState + +-- RESET + +Reset_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Reset_Response ::= NULL + +Reset_Error ::= ProgramInvocationState + +-- KILL + +Kill_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Kill_Response ::= NULL + +-- GET PI ATTRIBUTES + +GetProgramInvocationAttributes_Request ::= Identifier -- Program Invocation Name + +GetProgramInvocationAttributes_Response ::= SEQUENCE + { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + startArgument [5] IMPLICIT VisibleString, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + + +ProgramInvocationState ::= INTEGER + { + non-existent (0), + unrunable (1), + idle (2), + running (3), + stopped (4), + starting (5), + stopping (6), + resuming (7), + resetting (8) + } + -- Companion Standard may add additional values + + +-- *********************************** VARIABLES **************************************** + + +TypeSpecification ::= CHOICE + { + typeName [0] ObjectName, + array [1] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification + }, + structure [2] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + }, + + -- Simple Type + boolean [3] IMPLICIT NULL, + bit-string [4] IMPLICIT Integer32, + integer [5] IMPLICIT Unsigned8, + unsigned [6] IMPLICIT Unsigned8, + octet-string [9] IMPLICIT Integer32, + visible-string [10] IMPLICIT Integer32, + generalized-time [11] IMPLICIT NULL, + binary-time [12] IMPLICIT BOOLEAN, + bcd [13] IMPLICIT Unsigned8, + objId [15] IMPLICIT NULL + } + +AlternateAccess ::= SEQUENCE OF CHOICE + { + unnamed AlternateAccessSelection, + named [5] IMPLICIT SEQUENCE + { + componentName [0] IMPLICIT Identifier, + accesst AlternateAccessSelection + } + } + +AlternateAccessSelection ::= CHOICE + { + selectAccess CHOICE + { + component [1] IMPLICIT Identifier, + index [2] IMPLICIT Unsigned32, + indexRange [3] IMPLICIT SEQUENCE + { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [4] IMPLICIT NULL -- all array elements + } + } + + +-- READ + +Read_Request ::= SEQUENCE + { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification + } + + +Read_Response ::= SEQUENCE + { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult + } + +-- WRITE + + + +Write_Request ::= SEQUENCE + { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data + } + +Write_Response ::= SEQUENCE OF CHOICE + { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL + } + +-- INFORMATION REPORT + +InformationReport ::= SEQUENCE + { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult + } + +-- GET VARIABLE ACCESS ATTRIBUTES + +GetVariableAccessAttributes_Request ::= CHOICE + { + name [0] ObjectName, + address [1] Address + } + + +GetVariableAccessAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeSpecification [2] TypeSpecification + } +-- DEFINE NAMED VARIABLE + +DefineNamedVariable_Request ::= SEQUENCE + { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL + } + +DefineNamedVariable_Response ::= NULL + +-- DEFINE SCATTERED ACCESS + +DefineScatteredAccess_Request ::= SEQUENCE + { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription + } + + +DefineScatteredAccess_Response ::= NULL + +-- GET SCATTERED ACCESS ATTRIBUTES + +GetScatteredAccessAttributes_Request ::= ObjectName -- ScatteredAccessName + + +GetScatteredAccessAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription + } + +-- DELETE VARIABLE ACCESS + +DeleteVariableAccess_Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + +DeleteVariableAccess_Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + +DeleteVariableAccess_Error ::= Unsigned32 -- numberDeleted + +-- DEFINE NAMED VAR. LIST + +DefineNamedVariableList_Request ::= SEQUENCE + { + variableListName ObjectName, + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } + } + + +DefineNamedVariableList_Response ::= NULL + +-- GET NAMED VAR. LIST ATTRIBUTES + +GetNamedVariableListAttributes_Request ::= ObjectName -- VariableListName + + +GetNamedVariableListAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } + } + +-- DELETE NAMED VAR. LIST + +DeleteNamedVariableList_Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + + +DeleteNamedVariableList_Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + +DeleteNamedVariableList_Error ::= Unsigned32 -- number Deleted + +-- DEFINE NAMED TYPE + +DefineNamedType_Request ::= SEQUENCE + { + typeName ObjectName, + typeSpecification TypeSpecification + } + + +DefineNamedType_Response ::= NULL + + +-- GET NAMED TYPE ATTRIB. + +GetNamedTypeAttributes_Request ::= ObjectName -- TypeName + +GetNamedTypeAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification + } + +-- DELETE NAMED TYPE + +DeleteNamedType_Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + +DeleteNamedType_Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + +DeleteNamedType_Error ::= Unsigned32 -- number Deleted + +-- SUPPORT DEFINITIONS + +AccessResult ::= CHOICE + { + failure [0] IMPLICIT DataAccessError, + success Data + } + + +DataAccessError ::= INTEGER + { + object-invalidated (0), + hardware-fault (1), + temporarily-unavailable (2), + object-access-denied (3), + object-undefined (4), + invalid-address (5), + type-unsupported (6), + type-inconsistent (7), + object-attribute-inconsistent (8), + object-access-unsupported (9), + object-non-existent (10) + } + + + +Data ::= CHOICE + { + -- context tag 0 is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, + floating-point [7] IMPLICIT FloatingPoint, +-- XXX asn2wrs and packet-ber can not handle REAL yet +-- real [8] IMPLICIT REAL, + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, + booleanArray [14] IMPLICIT BIT STRING + } + +FloatingPoint ::= OCTET STRING + + +VariableAccessSpecification ::= CHOICE + { + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + }, + variableListName [1] ObjectName + } + + +ScatteredAccessDescription ::= SEQUENCE OF SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification, + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL + } + + +VariableSpecification ::= CHOICE + { + name [0] ObjectName, + address [1] Address, + variableDescription [2] IMPLICIT SEQUENCE + { + address Address, + typeSpecification TypeSpecification + }, + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, + invalidated [4] IMPLICIT NULL + } + +Address ::= CHOICE + { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] IMPLICIT VisibleString, + unconstrainedAddress [2] IMPLICIT OCTET STRING + } + + +-- ********************************* SEMAPHORES ***************************************** + +TakeControl_Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE, + applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL + } + +TakeControl_Response ::= CHOICE + { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier + } + +-- RELINQUISH CONTROL + +RelinquishControl_Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL + } + +RelinquishControl_Response ::= NULL + +-- DEFINE SEMAPHORE + +DefineSemaphore_Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + numbersOfTokens [1] IMPLICIT Unsigned16 + } + +DefineSemaphore_Response ::= NULL + +-- DELETE SEMAPHORE + +DeleteSemaphore_Request ::= ObjectName -- Semaphore Name + +DeleteSemaphore_Response ::= NULL + +-- REPORT SEMAPHORE STATUS + +ReportSemaphoreStatus_Request ::= ObjectName -- SemaphoreName + +ReportSemaphoreStatus_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER + { + token (0), + pool (1) + }, + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16 + } + +-- REPORT POOL SEMAPHORE STATUS + +ReportPoolSemaphoreStatus_Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL + } + +ReportPoolSemaphoreStatus_Response ::= SEQUENCE + { + listOfNamedTokens [0] IMPLICIT SEQUENCE OF CHOICE + { + freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-- REPORT SEMAPHORE ENTRY STATUS + +ReportSemaphoreEntryStatus_Request ::=SEQUENCE + { + semaphoreName [0] ObjectName, + state [1] IMPLICIT INTEGER + { + queued (0), + owner (1), + hung (2) + } , + entryIdToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL + } + +ReportSemaphoreEntryStatus_Response ::= SEQUENCE + { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +AttachToSemaphore ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +SemaphoreEntry ::= SEQUENCE + { + entryId [0] IMPLICIT OCTET STRING, + entryClass [1] IMPLICIT INTEGER + { + simple (0), + modifier (1) + }, + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT 64, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE + } + +--******************************** OPERATOR COMMUNICATION ***************************** + + +-- INPUT + +Input_Request ::= SEQUENCE + { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, + listOfPromptData [2] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL + } + + +Input_Response ::= VisibleString -- Input String + +-- OUTPUT + +Output_Request ::= SEQUENCE + { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF VisibleString + } + + +Output_Response ::= NULL + + +-- ************************************ EVENTS ********************************************* + +DefineEventCondition_Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC-Class, + prio-rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL + } + +DefineEventCondition_Response ::= NULL + + +DeleteEventCondition_Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL + } + +DeleteEventCondition_Response ::= Unsigned32 -- Candidates Not Deleted + + +GetEventConditionAttributes_Request ::= ObjectName -- Event Condition Name + +GetEventConditionAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC-Class, + prio-rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable [6] CHOICE + { + variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL + } OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL + } + + +ReportEventConditionStatus_Request ::= ObjectName -- EventConditionName + +ReportEventConditionStatus_Response ::= SEQUENCE + { + currentState [0] IMPLICIT EC-State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL + } + + +AlterEventConditionMonitoring_Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL, + evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL + } + +AlterEventConditionMonitoring_Response ::= NULL + + +TriggerEvent_Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL + } + +TriggerEvent_Response ::= NULL + + +DefineEventAction_Request ::= SEQUENCE + { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL +-- XXX this one is neither in this ASN nor in the IMPORTS +-- confirmed-Service_Request [2] DefineEventAction-ConfirmedServiceRequest + + } + + +DefineEventAction_Response ::= NULL + +DeleteEventAction_Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL + } + +DeleteEventAction_Response ::= Unsigned32 -- candidates not deleted + +GetEventActionAttributes_Request ::= ObjectName -- Event Action Name + + +GetEventActionAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier +-- XXX this one is neither in this ASN nor in the IMPORTS +-- confirmed-Service_Request [2] DefineEventAction-ConfirmedServiceRequest + } + +ReportEventActionStatus_Request ::= ObjectName -- EventActionName + +ReportEventActionStatus_Response ::= Unsigned32 -- Number of Event Enrollments + + +DefineEventEnrollment_Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransition [2] IMPLICIT Transitions, + alarmAcknowledgementRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL, + clientApplication [5] ApplicationReference OPTIONAL + } + +DefineEventEnrollment_Response ::= NULL + +DefineEventEnrollment_Error ::= ObjectName + + +DeleteEventEnrollment_Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName + } + +DeleteEventEnrollment_Response ::= Unsigned32 -- candidates not deleted + + +GetEventEnrollmentAttributes_Request ::= SEQUENCE + { + scopeOfRequest [0] IMPLICIT INTEGER + { + specific (0), + client (1), + ec (2), + ea (3) + } DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + clientApplication [2] ApplicationReference OPTIONAL, + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL + } + + +EventEnrollment ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE + { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + eventActionName [2] CHOICE + { + eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL + } OPTIONAL, + clientApplication [3] ApplicationReference OPTIONAL, + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE-Class, + duration [6] IMPLICIT EE-Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL + } + + +GetEventEnrollmentAttributes_Response ::= SEQUENCE + { + listOfEventEnrollment [0] IMPLICIT SEQUENCE OF EventEnrollment, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +ReportEventEnrollmentStatus_Request ::= ObjectName -- Event Enrollment Name + +ReportEventEnrollmentStatus_Response ::= SEQUENCE + { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE-Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE-State + } + +AlterEventEnrollment_Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL + } + +AlterEventEnrollment_Response ::= SEQUENCE + { + currentState [0] CHOICE + { + state [0] IMPLICIT EE-State, + undefined [1] IMPLICIT NULL + }, + transitionTime [1] EventTime + } + + +AcknowledgeEventNotification_Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC-State, + timeOfAcknowledgedTransition [3] EventTime + } + +AcknowledgeEventNotification_Response ::= NULL + + +GetAlarmSummary_Request ::= SEQUENCE + { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER + { + not-acked (0), + acked (1), + all (2) + } DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE + { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } OPTIONAL, + continueAfter [5] ObjectName OPTIONAL + } + +GetAlarmSummary_Response ::= SEQUENCE + { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +AlarmSummary ::= SEQUENCE + { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC-State, + unacknowledgedState [3] IMPLICIT INTEGER + { + none (0), + active (1), + idle (2), + both (3) + }, + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL + } + + +GetAlarmEnrollmentSummary_Request ::= SEQUENCE + { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER + { + not-acked (0), + acked (1), + all (2) + } DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE + { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } OPTIONAL, + continueAfter [5] ObjectName OPTIONAL + } + +GetAlarmEnrollmentSummary_Response ::= SEQUENCE + { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +AlarmEnrollmentSummary ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + clientApplication [2] ApplicationReference OPTIONAL, + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC-State, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + enrollementState [8] IMPLICIT EE-State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL + } + + +EventNotification ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE + { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + severity [2] IMPLICIT Unsigned8, + currentState [3] IMPLICIT EC-State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult [8] IMPLICIT SEQUENCE + { + eventActioName ObjectName, + eventActionResult CHOICE + { + success [0] ConfirmedServiceResponse, + failure [1] IMPLICIT ServiceError + } + } OPTIONAL + } + + +AttachToEventCondition ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL + } + + +EventTime ::= CHOICE + { + timeOfDayT [0] IMPLICIT TimeOfDay, + timeSequenceIdentifier [1] IMPLICIT Unsigned32 + } + + +EC-Class ::= INTEGER + { + network-triggered (0), + monitored (1) + } + +EC-State ::= INTEGER + { + disabled (0), + idle (1), + active (2) + } + +EE-State ::= INTEGER + { + disabled (0), + idle (1), + active (2), + activeNoAckA (3), + idleNoAckI (4), + idleNoAckA (5), + idleAcked (6), + activeAcked (7) + } + +Transitions ::= BIT STRING + { + idle-to-disabled (0), + active-to-disabled (1), + disabled-to-idle (2), + active-to-idle (3), + disabled-to-active (4), + idle-to-active (5), + any-to-deleted (6) + } + +AlarmAckRule ::= INTEGER + { + none (0), + simple (1), + ack-active (2), + ack-all (3) + } + +EE-Class ::= INTEGER + { + modifier (0), + notification (1) + } + +EE-Duration ::= INTEGER + { + current (0), + permanent (1) + } + + +-- ********************************** JOURNAL ******************************************* + + +-- READ JOURNAL + +ReadJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName, + rangeStartSpecification [1] CHOICE + { + startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING + } OPTIONAL, + rangeStopSpecification [2] CHOICE + { + endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32 + } OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter [5] IMPLICIT SEQUENCE + { + timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING + } + } + +ReadJournal_Response ::= SEQUENCE + { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +JournalEntry ::= SEQUENCE + { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent + } + +-- WRITE JOURNAL + +WriteJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent + } + +WriteJournal_Response ::= NULL + +-- INITIALIZE JOURNAL + +InitializeJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName, + limitSpecification [1] IMPLICIT SEQUENCE + { + limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL + } OPTIONAL + } + +InitializeJournal_Response ::= Unsigned32 -- entries deleted + +-- REPORT JOURNAL STATUS + +ReportJournalStatus_Request ::= ObjectName -- Journal Name + +ReportJournalStatus_Response ::= SEQUENCE + { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN + } + +-- CREATE JOURNAL + +CreateJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName + } + +CreateJournal_Response ::= NULL + +-- DELETE JOURNAL + +DeleteJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName + } + +DeleteJournal_Response ::= NULL + + +-- SUPPORTING PRODUCTIONS + +EntryContent ::= SEQUENCE + { + occurenceTime [0] IMPLICIT TimeOfDay, + additionalDetail [1] JOU-Additional-Detail OPTIONAL, + -- additionalDetail shall be omitted + -- from abstract syntax defined in this standard + entryForm CHOICE + { + data [2] IMPLICIT SEQUENCE + { + event [0] IMPLICIT SEQUENCE + { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State + } OPTIONAL, + listOfVariables [1] IMPLICIT SEQUENCE OF SEQUENCE + { + variableTag [0] IMPLICIT VisibleString, + valueSpecification [1] Data + } OPTIONAL + }, + annotation [3] IMPLICIT VisibleString + } + } + + +JOU-Additional-Detail ::= NULL -- Defined by Companion Standard + + + +-- **************************************** FILES ********************************************* + +ObtainFile_Request ::= SEQUENCE { + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName + } + +ObtainFile_Response ::= NULL + +ObtainFile_Error ::= INTEGER { + source-file (0), + destination-file (1) + } + + +FileOpen_Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32 + } + +FileOpen_Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes + } + +FileRead_Request ::= Integer32 + +FileRead_Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +FileClose_Request ::= Integer32 + +FileClose_Response ::= NULL + + +FileRename_Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName + } + +FileRename_Response ::= NULL + +FileRename_Error ::= INTEGER { + source-file (0), + destination-file (1) + } + +FileDelete_Request ::= FileName + +FileDelete_Response ::= NULL + + +FileDirectory_Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL + } + +FileDirectory_Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + +DirectoryEntry ::= SEQUENCE { + filename [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes + } + + +FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL + } + + + +END + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..8465357 --- /dev/null +++ b/build.gradle @@ -0,0 +1,297 @@ +buildscript { + repositories { + maven { + url "https://plugins.gradle.org/m2/" + } + } + dependencies { + classpath "net.saliman:gradle-cobertura-plugin:2.2.8" + classpath group: "org.asciidoctor", name: "asciidoctorj-pdf", version: "1.5.0-alpha.11" + classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:3.0.0" + } +} + +plugins { + id "org.sonarqube" version "1.0" + id "org.asciidoctor.convert" version "1.5.3" +} + +apply plugin: "org.asciidoctor.convert" +apply from: "configuration.gradle" + +asciidoctor { + backends = ["pdf", "html5"] + attributes "stylesheet": "openmuc-asciidoc.css", + "toc2": "left", + "sampleSrc": file("src/sample/java"), + "source-highlighter" : "coderay", + "pdf-stylesdir": "./", + "pdf-style": "pdf" + + resources { + from("$sourceDir") { + include "images/**" + } + } +} + +configure(allprojects) { + version = cfgVersion +} + +configure(javaProjects) { + + apply plugin: "java" + apply plugin: "eclipse" + apply plugin: "osgi" + apply plugin: "maven" + apply plugin: "signing" + apply plugin: "net.saliman.cobertura" + apply plugin: "biz.aQute.bnd.builder" + + uploadArchives.enabled = false + + group = cfgGroup + + if (!project.properties.containsKey("cfgJavaVersion")) { + project.ext { + cfgJavaVersion = "1.7" + } + } + + sourceCompatibility = cfgJavaVersion + targetCompatibility = cfgJavaVersion + + repositories { + mavenCentral() + mavenLocal() + } + + sourceSets { + sample + itest { + compileClasspath += sourceSets.main.runtimeClasspath + } + } + + dependencies { + testCompile group: "junit", name: "junit", version: "4.12" + itestCompile group: "junit", name: "junit", version: "4.12" + } + + jar { + manifest { + version = project.version.replace("-","."); + } + } + + cobertura { + + dependencies { + testCompile "org.slf4j:slf4j-simple:1.6.1" + } + coverageFormats = ["html", "xml"] + coverageIgnoreTrivial = true + coverageIgnores = ["org.slf4j.Logger.*"] + coverageReportDir = new File("$buildDir/reports/cobertura") + coverageTestTasks { + project.tasks.withType(Test).matching {it.name == "test"} + } + + } + + sonarqube { + properties { + property "sonar.exclusions", "src/main/java-gen/**/*,**/app/**/*" + property "sonar.java.coveragePlugin", "cobertura" + property "sonar.cobertura.reportPath", "build/reports/cobertura/coverage.xml" + } + } + + task jarAll(type: Copy) { + dependsOn(configurations.default.getAllArtifacts().getBuildDependencies()) + + //only the jar file created: + from configurations.default.getAllArtifacts().getFiles() + + if (cfgCopyDependencies) { + if (cfgCopyToRoot) { + into rootDir.getPath() + "/build/libs-all" + } + else { + into "build/libs-all" + } + //includes all the dependencies: + from configurations.default + } + else { + if (cfgCopyToRoot) { + into rootDir.getPath() + "/build/libs-all" + } + else { + into "build/libs-all" + } + } + } + + build.dependsOn {asciidoctor} + build.dependsOn {jarAll} + + eclipse.pathVariables([GRADLE_USER_HOME:file(gradle.gradleUserHomeDir)]) + tasks.eclipse.dependsOn(cleanEclipse) + + + task sourcesJar(type: Jar, dependsOn: classes) { + classifier = "sources" + from sourceSets.main.allSource + } + + task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = "javadoc" + from javadoc.destinationDir + } + + artifacts { + archives sourcesJar + archives javadocJar + } + + javadoc { + exclude "**/internal/**" + exclude "**/java-gen/**" + exclude "**/app/**" + } + +} + + +configure(repositoryProjects) { + + uploadArchives.enabled = true + + if (cfgSignPom) { + signing { + if ( project.hasProperty("signing.keyId") ) { + sign configurations.archives + } + } + } + + uploadArchives { + repositories { + mavenDeployer { + + if (cfgSignPom) { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + } + + repository(url: cfgRepository) { + authentication(userName: cfgRepositoryUser, password: cfgRepositoryPass) + if (cfgRepository != null && System.getProperty("https.proxyHost") != null && ((System.getProperty("https.nonProxyHosts") == null) || !cfgRepository.contains(System.getProperty("https.nonProxyHosts")))) { + proxy(host: System.getProperty("https.proxyHost"), port: Integer.parseInt(System.getProperty("https.proxyPort")), type: "https") + } + } + snapshotRepository(url: cfgSnapshotRepository) { + authentication(userName: cfgRepositoryUser, password: cfgRepositoryPass) + if (cfgSnapshotRepository != null && System.getProperty("https.proxyHost") != null && ((System.getProperty("https.nonProxyHosts") == null) || !cfgSnapshotRepository.contains(System.getProperty("https.nonProxyHosts")))) { + proxy(host: System.getProperty("https.proxyHost"), port: Integer.parseInt(System.getProperty("https.proxyPort")), type: "https") + } + } + + pom.project { + + //additional pom information can be found in subproject build.gradle files + + packaging "jar" + url "http://www.openmuc.org/" + + scm { + url "none" + connection "none" + } + + developers { + developer { + id "openmuc" + name "OpenMUC Team" + } + } + } + } + } + } +} + +task javadocAll(type: Javadoc) { + + source docProjects.collect { + project -> project.sourceSets.main.allJava + } + + exclude "**/internal/**" + exclude "**/java-gen/**" + exclude "**/app/**" + + destinationDir = new File(buildDir, "docs/javadoc-all") + + classpath = files(distributionProjects.collect { project -> + project.sourceSets.main.compileClasspath }) + + classpath += files(distributionProjects.collect { project -> + project.sourceSets.main.output }) +} + + +task writeSettings { + doLast { + Writer out = new OutputStreamWriter(new FileOutputStream("build/settings.gradle")); + out.write("include "); + boolean first = true; + for (Project myproject: distributionProjects) { + if (!myproject.getProjectDir().equals(getProjectDir())) { + if (first == true) { + first = false; + } + else { + out.write ", "; + } + out.write '"' + myproject.name + '"' + } + } + out .write "\n\n"; + + for (Project myproject: distributionProjects) { + if (!myproject.getProjectDir().equals(getProjectDir())) { + println myproject.name + out.write 'project(":' + myproject.name + '").projectDir = file("' + myproject.getProjectDir().toString().substring((int)(getProjectDir().toString().size() + 1)) + '")\n'; + } + } + + out.close(); + } +} + +task buildDistProjects { + dependsOn(distributionProjects.build) +} + +tasks.withType(Tar) { + + dependsOn(writeSettings) + dependsOn(distributionProjects.build) + dependsOn(javadocAll) + dependsOn(asciidoctor) + + compression = Compression.GZIP + + destinationDir = file("build/distributions/") +} + +task (tar, type: Tar) { + archiveName = project.name + "-" + project.version + ".tgz" +} + +task (tarFull, type: Tar) { + dependsOn(tar) + archiveName = project.name + "-" + project.version + "_full.tgz" +} diff --git a/configuration.gradle b/configuration.gradle new file mode 100644 index 0000000..fc7477e --- /dev/null +++ b/configuration.gradle @@ -0,0 +1,125 @@ + +project.ext { + + cfgVersion = "1.4.1-SNAPSHOT" + + cfgGroup = "org.openmuc" + + cfgCopyDependencies = true + + cfgCopyToRoot = false + + cfgSignPom = true + + cfgRepository = project.properties.sonatypeRepository + + cfgSnapshotRepository = project.properties.sonatypeSnapshotRepository + + cfgRepositoryUser = project.properties.sonatypeUser + + cfgRepositoryPass = project.properties.sonatypePass + + javaProjects = allprojects + + distributionProjects = javaProjects + + docProjects = javaProjects + + repositoryProjects = javaProjects +} + +tasks.withType(Tar) { + + into(project.name) { + from("./") { + include "build.gradle" + include "configuration.gradle" + include "license/**" + include "doc/CHANGELOG.txt" + include "run-scripts/**" + include "gradle/wrapper/**" + include "gradlew" + include "gradlew.bat" + include "build/libs-all/**" + include "src/**" + + include "asn1/**" + } + + if (name.equals("tar") ){ + exclude "**/dependencies/**/src" + } + + } + + into(project.name + "/doc/user-guide/") { + from("./build/asciidoc/html5/") { + include "**" + } + from("./build/asciidoc/pdf/") { + include "*.pdf" + } + } + + into(project.name + "/doc/") { + from("./build/docs/") { + include "javadoc/**" + } + } + +} + + + +//------------------project specific configurations-------------------- + +apply plugin: "java" +apply plugin: "eclipse" +apply plugin: "osgi" +apply plugin: "maven" +apply plugin: "signing" + +def projectName = 'OpenIEC61850' + +dependencies { + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' + compile group: 'org.openmuc', name: 'jasn1', version: '1.8.0' + compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' + compile group: 'com.toedter', name: 'jcalendar', version: '1.4' +} + +jar { + manifest { + name = projectName + instruction 'Export-Package', '!*.internal.*,*' + instruction 'Import-Package', 'org.openmuc.jasn1.*,javax.net,*;resolution:=optional' + } +} + +sourceSets { + main { + java.srcDirs = ['src/main/java', 'src/main/java-gen'] + } +} + +uploadArchives { + repositories { + mavenDeployer { + pom.project { + name projectName + packaging 'jar' + description 'OpenIEC61850 is a library implementing the IEC 61850 MMS communication standard (client and server).' + url 'http://www.openmuc.org/' + + licenses { + license { + name 'Apache License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0' + distribution 'repo' + } + } + + } + } + } +} diff --git a/doc/CHANGELOG.txt b/doc/CHANGELOG.txt new file mode 100644 index 0000000..4f3a7ba --- /dev/null +++ b/doc/CHANGELOG.txt @@ -0,0 +1,242 @@ +v1.4.0 30-May-2017 +------------------ + +- extended toString() method of all model node classes to print its + complete submodel tree. + +- merged all projects openiec61850, jositransport, josistack, + openiec61850-clientgui, and openiec61850-sample into a single + project "openiec61850". + +- removed all slf4j logging for client part. Thus if library is only + used on client side slf4j is no longer needed. + +- replaced sample client and server by console applications + +- fixed setting functional constraint correctly for all BRCB + elements. Thanks to Stefan Goldmann. + +- fixed client side processing of reports when inclusion bit string is + not padded with zeros, thanks to Thomas Schönle from Bachmann + +- fixed ServerSAP.stop() to close timer threads correctly + +- made several imports in OSGi MANIFEST file optional because they are + not necessarily required + +- library now depends on jASN1 1.8.0 + + +v1.3.3 09-Mar-2017 +------------------ + +- fixes bug introduced in 1.3.2: report control block instance names + should start at 01 instead of 00 + +- library now depends on jASN1 1.7.1 + +v1.3.2 01-Mar-2017 +------------------ + +- fixes object reference of child attributes of array elements: old: + LD/LN.DO.Array(1)child, new LD/LN.DO.Array(1).child + +- fixes setting of RptEna DA in server to true when reports are enabled. + +- fixes reading report control blocks with "max" attribute greater 1 + from SCL file + +- added check whether received BitString has correct size before setting it + in model + +v1.3.1 24-Feb-2017 +------------------ + +- fixed TapCommand data attribute default value + +- types based on BdaBitString now check in setValue(byte[] value) + whether passed byte array has correct length + + +v1.3.0 17-Jan-2017 +------------------ + +- fixed bug that urcb reservation was not canceled after connection + was closed + +- fixed support for reserving buffered report control blocks on the + client side thanks to Bo Orsted Andresen + +- fixed support for receiving buffered and unbuffered reports when the + data set reference is not part of the report thanks to Bo Orsted + Andresen + +- fixed bug in parsing scl file, in some cases predefined values were + not set, thanks to Wu Yongming + +- added support for parsing ObjRef in SCL file + +- added support for multiple report control block instances by + specifying RptEnabled max attribute in SCL file + +v1.2.0 20-Mar-2016 +------------------ +- changed license from LGPL to Apache 2.0 +- added methods to ServerModel class to retrieve BRCBs on the client + side, thanks to Thomas Saabye from EURISCO +- added support for parsing "Val" elements inside "DA" elements of SCL + file +- several minor bug fixes + +v1.1.1 11-Dec-2014 +------------------ +- set default max TPDU size to 1024 +- fix: server stops sending reports when client closed association +- fix in sample model to enable general interrogation + +v1.1.0 17-Oct-2014 +------------------ +- fixed ServerSap.stop() +- added possibility change more settings in ClientSap +- setDataSetValues will now only call a single call back function of a + server application. The syntax of the call back function had to be + changed for that. +- fixed doclint errors and warnings. doclint is used by Java8 + +v1.0 31-Jul-2014 +---------------- +- added support for reporting on server side. +- minor bug fixes +- improvements to logging messages +- added maxtpdu size to all Transport Layer Connection Requests + (thanks to Michael Volz) +- client can now receive reports via callback method +- improved documentation +- fixed build file for newest gradle +- improved documentation + +v0.17.1 27-Jan-2014 +------------------- +- extracted jOSIStack lib from openiec61850 lib so it can be used + separately (e.g. for the TASE.2 protocol) +- fixed bugs in client Report functionality +- readded ClientReportingSample application +- fixed copying of arrays +- support for decoding authentication value, though the authentication + value is NOT being checked at the moment +- added full server side support for nonpersistent DataSets +- fixed bug in runSampleServer.bat script +- jars are now uploaded to the central maven repository + +v0.16.0 03-Sep-2013 +------------------- +- renamed many functions and classes +- added Client GUI project to easily browse the device model of an IEC + 61850 IED. +- openiec61850-client, -server, -common and jmms where combined into a + single openiec61850 library. The split was of no real use and caused + split package problems in OSGi environments. +- client ACSI functions now throw two types of exceptions: IOException + (fatal exception, client needs to reconnect to server) and + ServiceError for Errors that did not affect the active + assocition/connection. +- The way the server library works was completely changed: DataSources + no longer exist and there is no need for property files anymore. The + readValue() callback method in the DataSource is no longer needed + because GetDataValues requests are handled by the server library + without consulting the server application. Instead the server + application now has to fill the internal model of the server library + with up to date values. This change was necessary in order to be + able to efficiently implement reporting and controling services in + the future. +- Basic control services are now part of the library and no longer + have to be handled by the server application. +- Several bug fixes in the SCL-parser +- fix so that FunctionalConstraints such as GS that are not supported + by openIEC61850 yet do not cause a null pointer exception when they + are part of a DataSet + +v0.14.4 30-Oct-2012 +------------------- +- fixed another bug when decoding Float64 +- getDataDefinition of all kinds of DataObjects and DataAttributes now + possible +- modified toString() function of most DataAttributes to print more + valuable information + +v0.14.3 18-Sep-2012 +------------------- +- fixed decoding of Float32 and Float64 +- fixed getChildren(fc) Function in LogicalNode + +v0.14.2 23-Aug-2012 +------------------- +- major refactoring to make code more efficient and easier to + maintain. Many classes have been renamed and/or relocated. +- the ability to use different SCSM was completely removed because + only one mapping existed so far: the MMS mapping. No other Mapping + seems to have a chance against MMS simply because MMS is already in + use and works. +- note that the syntax of the properties file for the StandaloneServer + changed a little, see the sampeServer for details + +v0.12.0 31-Jul-2012 +------------------- +- changed from LGPLv3 to LGPLv2.1 +- replaced OCTET_STRING64, OCTET_STRING8 and so on with a general + OCTET_STRING class +- the same was done for UNICODE_STRING and VISIBLE_STRING +- client no longer hangs when receiving ApplError Reports + +v0.11.0 02-Jul-2012 +------------------- +- new jASN1 version that can decode empty Object Identifiers +- added mms authentication capability +- fixed multi thread issues in TSAPConnection of MMS mapping +- added FLOAT64 from IEC61400-2 +- added SampleReportClient to demonstrate how to use reporting with the client +- some improvements to client receiver thread +- some other small bug fixes + +v0.10.0 14-Mai-2012 +------------------- +- restructuring: code moved to src folder +- new jASN1 version which fixes bug in decoding empty bitstrings +- receving "Check" data does not cause errors anymore +- ASN.1 buffers are automatically resized in the client + +v0.9.9 29-Mar-2012 +------------------ +- added DataSet Services for client and server +- added getReport methods and processReport for the client -> they + will get a report from the queue and return a report object with the + updated data +- fixed getDataValues for array structures +- disabled sending SpecificationWithResult in read request because + some clients cannot cope with it +- fixed bug in RFC 1006 part +- added receiver thread in client so that reports can be received at any time +- added VisibleString65 to be compatible with some version1.0 servers +- avoid srcRef == 0 because some servers cannot cope with it + +v0.9.8 22-Feb-2012 +------------------ +- fixed path in runSampleServer.sh and runSampleClient.sh + +0.9.7 21-Feb-2012 +----------------- +- small bug fix in T-Sel encoding/decoding in TConnection.java - + thanks to Johannes Schmidt from University of Leipzig + +v0.9.6 20-Feb-2012 +------------------ +- when importing Eclipse projects: GRADLE_HOME was replaced by GRADLE_USER_HOME +- removed duplicate entries from tar distribution file +- Remote TSAPs can now be addressed using a T-Selector. The client can + set the T-Selector like this: + MmsScsmClientSAP clientSAP = new MmsScsmClientSAP(); + clientSAP.acseSAP.tSAP.tSelRemote = new byte[] { 0, 1 }; + +v0.9.5 06-Feb-2012 +------------------ +- first version diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..0fd97755906869d5d08fbf9677d0e3c5338b296a GIT binary patch literal 54783 zcmafaW0WS*vSoGIwr!)!wr%4p+g6utqszAKsxI5MZBNhK_h#nax$n)7$jp^1Vx1G2 zC(qu2RFDP%MFj$agaiTt68tMbK*0a&2m}Q6_be-_B1k7GC&mB*r0`FQu26lR{C^cx z{>oqT|Dz}?C?_cuFbIhy@Hlls4PVE#kL z%+b)q8t~t$qWrU}o1>w6dSEU{WQ11MaYRHV`^W006GEHNkKbo3<`>slS- z^Iau?J5(A*RcG;?9caykA`<#qy1~O zV;;PYMn6SI$q}ds#zKhlt{2DkLyA|tPj@5nHw|TfoB{R9AOtjRH|~!gjc7>@`h6hQ zNQ|Ch4lR}rT_GI4eQoy|sMheUuhTnv@_rRPV^^6SNCY zJt~}LH52Y+RK{G^aZh@qG*^+5XM={Yu0CS=<}foB$I}fd5f&atxdLYMbAT-oGoKoE zEX@l(|ILgqD&rTwS4@T(du@BzN3(}du%3WCtJ*e1WJ5HWPNihA7O65R=Zp&IHPQn{ zTJ{$GYURp`Lr$UQ$ZDoj)1f(fN-I+C0)PVej&x_8WZUodh~2t5 z^<=jtVQnpoH>x5ncT0H=^`9-~oCmK=MD#4qnx+7-E-_n^0{2wjL2YV;WK(U;%aCN} zTPh334F$MTbxR7|7mEtX3alSAz|G)I+eFvQnY}XldO7I7$ z2-ZeSVckL<)N1tQ)M6@8uW;`pybJ4+Zf4&;=27ShUds^TB8DN4y^x=7xslL*1%HX_ zT(iSMx?g}!7jTEjX@&lI{{ifXnD}tWA8x4A3#o?GX9GMQHc-%WBBl|UlS|HYNH}JU z?I48Qizg+VWgSZ#zW<;tMruWI@~tW~X_GT(Me0(X0+ag8b-P6vA(1q165LJLl%zIl z?Ef?_&y7e?U@PK^nTSGu!90^0wjPY}`1@cng< z8p@n!$bcZvs3dwYo!t+cpq=9n`6Gi|V&v32g3zJV>ELG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EU9R_K^E ze981u2JR=5iSKVP{gx=)OU{>KUOzd}0)B(@pQOEBQoU3K`ANkd@f%eCpb_$t>81L@ zPbSU}zrplJcM$lc7Q;)bms#&Wsc2$v`O}#D?~&$@+w$vd!IxAo)3bh3VQ2gX z)&Fd(mw7rr@$IsH1OK11c3%FNmuU?@$*ObzH`%WzSufY0e`0FX{|)nB&GGlu=$G|; z8TZI?*Z|aFu>me0sTLv Cq4>K1 literal 0 HcmV?d00001 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..8167ed1 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Apr 25 13:05:33 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..4453cce --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save ( ) { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/license/NOTICE b/license/NOTICE new file mode 100644 index 0000000..488429e --- /dev/null +++ b/license/NOTICE @@ -0,0 +1,16 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ diff --git a/license/apache-license-2.0.txt b/license/apache-license-2.0.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/license/apache-license-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/run-scripts/console-client/openiec61850-console-client b/run-scripts/console-client/openiec61850-console-client new file mode 100755 index 0000000..9780588 --- /dev/null +++ b/run-scripts/console-client/openiec61850-console-client @@ -0,0 +1,20 @@ +#!/bin/bash + +JARS_LOCATION="../../build/libs-all" +MAIN_CLASS="org.openmuc.openiec61850.app.ConsoleClient" +SYSPROPS="" +PARAMS="" + +SCRIPT_HOME=`dirname $0` + +CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") + +for i in $@; do + if [[ $i == -D* ]]; then + SYSPROPS="$SYSPROPS $i"; + else + PARAMS="$PARAMS $i"; + fi +done + +java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS diff --git a/run-scripts/console-client/openiec61850-console-client.bat b/run-scripts/console-client/openiec61850-console-client.bat new file mode 100644 index 0000000..938643c --- /dev/null +++ b/run-scripts/console-client/openiec61850-console-client.bat @@ -0,0 +1,6 @@ +::BATCH file for windows + +set BATDIR=%~dp0 +set LIBDIR=%BATDIR%..\..\build\libs-all + +java -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.app.ConsoleClient %* diff --git a/run-scripts/console-server/logback.xml b/run-scripts/console-server/logback.xml new file mode 100644 index 0000000..fcd468f --- /dev/null +++ b/run-scripts/console-server/logback.xml @@ -0,0 +1,16 @@ + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + diff --git a/run-scripts/console-server/openiec61850-console-server b/run-scripts/console-server/openiec61850-console-server new file mode 100755 index 0000000..33d11ff --- /dev/null +++ b/run-scripts/console-server/openiec61850-console-server @@ -0,0 +1,37 @@ +#!/bin/bash + +JARS_LOCATION="../../build/libs-all" +MAIN_CLASS="org.openmuc.openiec61850.app.ConsoleServer" +SYSPROPS="-Dlogback.configurationFile=logback.xml" + +# from gradle start script: +# Attempt to set SCRIPT_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +SCRIPT_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + + +CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") + +for i in $@; do + if [[ $i == -D* ]]; then + SYSPROPS="$SYSPROPS $i"; + else + PARAMS="$PARAMS $i"; + fi +done + +java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS diff --git a/run-scripts/console-server/openiec61850-console-server.bat b/run-scripts/console-server/openiec61850-console-server.bat new file mode 100644 index 0000000..fdb9766 --- /dev/null +++ b/run-scripts/console-server/openiec61850-console-server.bat @@ -0,0 +1,6 @@ +::BATCH file to windows + +set BATDIR=%~dp0 +set LIBDIR=%BATDIR%..\..\build\libs-all + +java -Dlogback.configurationFile=logback.xml -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.app.ConsoleServer %* diff --git a/run-scripts/console-server/sample-model.icd b/run-scripts/console-server/sample-model.icd new file mode 100644 index 0000000..68d7863 --- /dev/null +++ b/run-scripts/console-server/sample-model.icd @@ -0,0 +1,293 @@ + + + +

+ + + Station bus + 10 + +
+

10.0.0.3

+

255.255.255.0

+

10.0.0.101

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + direct-with-normal-security + + + + + 1000 + + + sbo-with-normal-security + + + + + direct-with-enhanced-security + + + + + sbo-with-enhanced-security + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + diff --git a/run-scripts/gui-client/openiec61850-gui-client b/run-scripts/gui-client/openiec61850-gui-client new file mode 100755 index 0000000..96f038a --- /dev/null +++ b/run-scripts/gui-client/openiec61850-gui-client @@ -0,0 +1,39 @@ +#!/bin/bash + +JARS_LOCATION="../../build/libs-all" +MAIN_CLASS="org.openmuc.openiec61850.clientgui.ClientGui" +SYSPROPS="" +PARAMS="" + +# from gradle start script: +# Attempt to set SCRIPT_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +SCRIPT_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + + +CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") + +for i in $@; do + if [[ $i == -D* ]]; then + SYSPROPS="$SYSPROPS $i"; + else + PARAMS="$PARAMS $i"; + fi +done + +java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS + diff --git a/run-scripts/gui-client/openiec61850-gui-client.bat b/run-scripts/gui-client/openiec61850-gui-client.bat new file mode 100644 index 0000000..5cb44fb --- /dev/null +++ b/run-scripts/gui-client/openiec61850-gui-client.bat @@ -0,0 +1,6 @@ +::BATCH file to windows + +set BATDIR=%~dp0 +set LIBDIR=%BATDIR%..\..\build\libs-all + +java -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.clientgui.ClientGui %* diff --git a/src/asn1/iso-acse-layer/compile.sh b/src/asn1/iso-acse-layer/compile.sh new file mode 100755 index 0000000..54fc975 --- /dev/null +++ b/src/asn1/iso-acse-layer/compile.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +rm ../../src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/* + +jasn1-compiler -o "../../src/main/java-gen/" -p "org.openmuc.josistack.internal.acse" -f iso-acse-layer.asn diff --git a/src/asn1/iso-acse-layer/iso-acse-layer.asn b/src/asn1/iso-acse-layer/iso-acse-layer.asn new file mode 100644 index 0000000..68cbfee --- /dev/null +++ b/src/asn1/iso-acse-layer/iso-acse-layer.asn @@ -0,0 +1,272 @@ +-- Module ACSE_1 (X.227:04/1995) +ASN1 {joint_iso_itu_t association_control(2) modules(0) apdus(0) version1(1)} +-- ACSE_1 refers to ACSE version 1 +DEFINITIONS ::= +BEGIN + +EXPORTS + acse_as_id, ACSE_apdu, aCSE_id, Application_context_name, AP_title, + AE_qualifier, AE_title, AP_invocation_identifier, AE_invocation_identifier, + Mechanism_name, Authentication_value, ACSE_requirements, ObjectSet; + + +-- The data types Name and RelativeDistinguishedName are imported from ISO/IEC 9594_2. +-- object identifier assignments +acse_as_id OBJECT IDENTIFIER ::= + {joint-iso-itu-t association-control(2) abstract-syntax(1) apdus(0) + version1(1)} + +-- may be used to reference the abstract syntax of the ACSE APDUs +aCSE_id OBJECT IDENTIFIER ::= + {joint-iso-itu-t association-control(2) ase-id(3) acse-ase(1) version(1)} + +-- may be used to identify the Association Control ASE. +-- top level CHOICE + ACSE_apdu ::= CHOICE { + aarq AARQ_apdu, + aare AARE_apdu, + rlrq RLRQ_apdu, + rlre RLRE_apdu +} + +AARQ_apdu ::= [APPLICATION 0] IMPLICIT SEQUENCE { + protocol_version [0] IMPLICIT BIT STRING OPTIONAL, + application_context_name [1] EXPLICIT OBJECT IDENTIFIER, + called_AP_title [2] AP_title OPTIONAL, + called_AE_qualifier [3] AE_qualifier OPTIONAL, + called_AP_invocation_identifier [4] EXPLICIT AP_invocation_identifier OPTIONAL, + called_AE_invocation_identifier [5] EXPLICIT AE_invocation_identifier OPTIONAL, + calling_AP_title [6] AP_title OPTIONAL, + calling_AE_qualifier [7] AE_qualifier OPTIONAL, + calling_AP_invocation_identifier [8] AP_invocation_identifier OPTIONAL, + calling_AE_invocation_identifier [9] AE_invocation_identifier OPTIONAL, + -- The following field shall not be present if only the Kernel is used. + sender_acse_requirements [10] IMPLICIT ACSE_requirements OPTIONAL, + -- The following field shall only be present if the Authentication functional unit is selected. + mechanism_name [11] IMPLICIT Mechanism_name OPTIONAL, + -- The following field shall only be present if the Authentication functional unit is selected. + calling_authentication_value [12] EXPLICIT Authentication_value OPTIONAL, + application_context_name_list + [13] IMPLICIT Application_context_name_list OPTIONAL, + -- The above field shall only be present if the Application Context Negotiation functional unit is selected + implementation_information [29] IMPLICIT Implementation_data OPTIONAL, + user_information [30] IMPLICIT Association_information OPTIONAL +} + + +AARE_apdu ::= [APPLICATION 1] IMPLICIT SEQUENCE { +--changed by Stefan Feuerhahn + protocol_version [0] IMPLICIT BIT STRING OPTIONAL, + application_context_name [1] EXPLICIT OBJECT IDENTIFIER, + result [2] EXPLICIT Associate_result, + result_source_diagnostic [3] EXPLICIT Associate_source_diagnostic, + responding_AP_title [4] EXPLICIT AP_title OPTIONAL, + responding_AE_qualifier [5] EXPLICIT AE_qualifier OPTIONAL, + responding_AP_invocation_identifier [6] EXPLICIT AP_invocation_identifier OPTIONAL, + responding_AE_invocation_identifier [7] EXPLICIT AE_invocation_identifier OPTIONAL, + -- The following field shall not be present if only the Kernel is used. + responder_acse_requirements [8] IMPLICIT ACSE_requirements OPTIONAL, + -- The following field shall only be present if the Authentication functional unit is selected. + mechanism_name [9] IMPLICIT Mechanism_name OPTIONAL, + -- This following field shall only be present if the Authentication functional unit is selected. + responding_authentication_value [10] EXPLICIT Authentication_value OPTIONAL, + application_context_name_list + [11] IMPLICIT Application_context_name_list OPTIONAL, + -- The above field shall only be present if the Application Context Negotiation functional unit is selected + implementation_information + [29] IMPLICIT Implementation_data OPTIONAL, + user_information [30] IMPLICIT Association_information OPTIONAL +} + +RLRQ_apdu ::= [APPLICATION 2] IMPLICIT SEQUENCE { + reason [0] IMPLICIT Release_request_reason OPTIONAL, + user_information [30] IMPLICIT Association_information OPTIONAL +} + +RLRE_apdu ::= [APPLICATION 3] IMPLICIT SEQUENCE { + reason [0] IMPLICIT Release_response_reason OPTIONAL, + user_information [30] IMPLICIT Association_information OPTIONAL +} + +-- ABRT_apdu ::= [APPLICATION 4] IMPLICIT SEQUENCE { +-- abort_source [0] IMPLICIT ABRT_source, +-- abort_diagnostic [1] IMPLICIT ABRT_diagnostic OPTIONAL, + -- This field shall not be present if only the Kernel is used. +-- user_information [30] IMPLICIT Association_information OPTIONAL +--} + +-- ABRT_diagnostic ::= ENUMERATED { +-- no_reason_given(1), protocol_error(2), +-- authentication_mechanism_name_not_recognized(3), +-- authentication_mechanism_name_required(4), authentication_failure(5), +-- authentication_required(6) +-- } + +-- ABRT_source ::= INTEGER {acse_service_user(0), acse_service_provider(1)} + + +ACSE_requirements ::= BIT STRING { + authentication(0), application_context_negotiation(1) +} + +Application_context_name_list ::= SEQUENCE OF Application_context_name + +-- Application_context_name ::= CHOICE { +-- application_context_name OBJECT IDENTIFIER +-- } + +Application_context_name ::= OBJECT IDENTIFIER + +-- Application_entity title productions follow (not in alphabetical order) +AP_title ::= CHOICE { +-- ap_title_form1 AP_title_form1, + ap_title_form2 AP_title_form2 +} + +AE_qualifier ::= CHOICE { +-- ae_qualifier_form1 AE_qualifier_form1, + ae_qualifier_form2 AE_qualifier_form2 +} + +-- When both AP_title and AE_qualifier data values are present in an AARQ or AARE APDU, both must +-- have the same form to allow the construction of an AE_title as discussed in CCITT Rec. X.665 | +-- ISO/IEC 9834_6. +-- AP_title_form1 ::= +-- Name + +-- The value assigned to AP_title_form1 is The Directory Name of an application_process title. +-- AE_qualifier_form1 ::= +-- RelativeDistinguishedName + +-- The value assigned to AE_qualifier_form1 is the relative distinguished name of a particular +-- application_entity of the application_process identified by AP_title_form1. +AP_title_form2 ::= OBJECT IDENTIFIER + +AE_qualifier_form2 ::= INTEGER + +AE_title ::= CHOICE { +-- ae_title_form1 AE_title_form1, + ae_title_form2 AE_title_form2 +} + +-- As defined in CCITT Rec. X.650 | ISO 7498_3, an application_entity title is composed of an application- +-- process title and an application_entity qualifier. The ACSE protocol provides for the transfer of an +-- application_entity title value by the transfer of its component values. However, the following data type +-- is provided for International Standards that reference a single syntactic structure for AE titles. +-- AE_title_form1 ::= +-- Name + +-- For access to The Directory (ITU_T Rec. X.500_Series | ISO/IEC 9594), an AE title has AE_title_form1. +-- This value can be constructed from AP_title_form1 and AE_qualifier_form1 values contained in an +-- AARQ or AARE APDU. A discussion of forming an AE_title_form1 from AP_title_form1 and AE_qualifier- +-- form1 may be found in CCITT Rec. X.665 | ISO/IEC 9834_6. +AE_title_form2 ::= OBJECT IDENTIFIER + +-- A discussion of forming an AE_title_form2 from AP_title_form2 and AE_qualifier_form2 may be +-- found in CCITT Rec. X.665 | ISO/IEC 9834_6. +AE_invocation_identifier ::= INTEGER + +AP_invocation_identifier ::= INTEGER + +-- End of Application_entity title productions +Associate_result ::= INTEGER { + accepted(0), rejected_permanent(1), rejected_transient(2)} + +Associate_source_diagnostic ::= CHOICE { + acse_service_user + [1] EXPLICIT INTEGER {null(0), no_reason_given(1), + application_context_name_not_supported(2), + calling_AP_title_not_recognized(3), + calling_AP_invocation_identifier_not_recognized(4), + calling_AE_qualifier_not_recognized(5), + calling_AE_invocation_identifier_not_recognized(6), + called_AP_title_not_recognized(7), + called_AP_invocation_identifier_not_recognized(8), + called_AE_qualifier_not_recognized(9), + called_AE_invocation_identifier_not_recognized(10), + authentication_mechanism_name_not_recognized(11), + authentication_mechanism_name_required(12), + authentication_failure(13), authentication_required(14)}, + acse_service_provider + [2] EXPLICIT INTEGER {null(0), no_reason_given(1), no_common_acse_version(2)} +} + +-- Association_information ::= SEQUENCE OF Association_information_item +Association_information ::= SEQUENCE OF Myexternal + +Myexternal ::= [UNIVERSAL 8] IMPLICIT SEQUENCE +{ + direct_reference OBJECT IDENTIFIER OPTIONAL, + indirect_reference INTEGER OPTIONAL, + encoding CHOICE + { single_ASN1_type [0] EXPLICIT ANY, + octet_aligned [1] IMPLICIT OCTET STRING, + arbitrary [2] IMPLICIT BIT STRING } +} + +Myexternal2 ::= [UNIVERSAL 8] IMPLICIT SEQUENCE +{ + direct_reference OBJECT IDENTIFIER OPTIONAL, + indirect_reference INTEGER OPTIONAL, + encoding CHOICE + { single_ASN1_type [0] EXPLICIT ANY, + octet_aligned [1] IMPLICIT OCTET STRING, + arbitrary [2] IMPLICIT BIT STRING } +} + + +--Association_information_item ::= [UNIVERSAL 8] IMPLICIT SEQUENCE { +-- direct_reference OBJECT IDENTIFIER OPTIONAL, +-- indirect_reference INTEGER OPTIONAL, +-- encoding CHOICE +-- { +-- single_ASN1_type [0] CHOICE { +-- single_ASN1_type ANY +-- }, +-- octet_aligned [1] IMPLICIT OCTET STRING, +-- arbitrary [2] IMPLICIT BIT STRING +-- } +-- } + +--is optional: +Authentication_value ::= CHOICE { + charstring [0] IMPLICIT GraphicString, + bitstring [1] IMPLICIT BIT STRING, + external [2] IMPLICIT Myexternal2 +-- other +-- [3] IMPLICIT SEQUENCE {other_mechanism_name +-- MECHANISM_NAME.&id({ObjectSet}), +-- other_mechanism_value +-- MECHANISM_NAME.&Type +-- ({ObjectSet}{@.other_mechanism_name})} +} + +-- The abstract syntax of (calling/responding) authentication_value is determined by the authentication +-- mechanism used during association establishment. The authentication mechanism is either explicitly +-- denoted by the &id field (of type OBJECT IDENTIFIER) for a mechanism belonging to the class +-- MECHANISM_NAME, or it is known implicitly by +-- prior agreement between the communicating partners. If the "other" component is chosen, then +-- the "mechanism_name" component must be present in accordance with +-- ITU_T Rec. X.680 | ISO/IEC 8824. If the value "mechanism_name" occurs in the AARQ_apdu or the +-- AARE_apdu, then that value must be the same as the value for "other_mechanism_name" +Implementation_data ::= GraphicString + +Mechanism_name ::= OBJECT IDENTIFIER + +Release_request_reason ::= INTEGER { + normal (0), + urgent (1), + user_defined (30) +} + +Release_response_reason ::= INTEGER { + normal (0), + not_finished (1), + user_defined (30) +} + + + +END + +-- Generated by Asnp, the ASN.1 pretty_printer of France Telecom R&D diff --git a/src/asn1/iso-presentation-layer/compile.sh b/src/asn1/iso-presentation-layer/compile.sh new file mode 100755 index 0000000..d552396 --- /dev/null +++ b/src/asn1/iso-presentation-layer/compile.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +rm ../../src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/*.java + +jasn1-compiler -o ../../src/main/java-gen/ -p org.openmuc.josistack.internal.presentation -f iso-presentation-layer.asn diff --git a/src/asn1/iso-presentation-layer/iso-presentation-layer.asn b/src/asn1/iso-presentation-layer/iso-presentation-layer.asn new file mode 100644 index 0000000..fcd17a0 --- /dev/null +++ b/src/asn1/iso-presentation-layer/iso-presentation-layer.asn @@ -0,0 +1,143 @@ +ASN1 DEFINITIONS ::= +BEGIN + + +CP_type ::= SET { + mode_selector [0] IMPLICIT Mode_selector, + --x410_mode_parameters [1] IMPLICIT SET { + -- COMPONENTS OF Reliable_Transfer_APDUs.RTORQapdu + --} OPTIONAL, + --- Shall be used for X.410 mode only. Shall be bitwise + --- compatible with CCITT Recommendation X.410_1984. + --- This shall be the User data parameter of the CP PPDU1) + normal_mode_parameters [2] IMPLICIT SEQUENCE { + protocol_version [0] IMPLICIT Protocol_version DEFAULT {version_1}, + calling_presentation_selector [1] IMPLICIT Calling_presentation_selector OPTIONAL, + called_presentation_selector [2] IMPLICIT Called_presentation_selector OPTIONAL, + presentation_context_definition_list [4] IMPLICIT Presentation_context_definition_list OPTIONAL, + default_context_name [6] IMPLICIT Default_context_name OPTIONAL, + presentation_requirements [8] IMPLICIT Presentation_requirements OPTIONAL, + user_session_requirements [9] IMPLICIT User_session_requirements OPTIONAL + -- shall not be present if equal to the Revised session + -- requirements parameter -- , + user_data User_data OPTIONAL + } OPTIONAL + -- Shall be used for normal mode only. + -- Shall be the parameters of the CP PPDU. +} + +CPA_PPDU ::= SET { + mode_selector [0] IMPLICIT Mode_selector, + --x410_mode_parameters [1] IMPLICIT SET { + -- COMPONENTS OF Reliable_Transfer_APDUs.RTOACapdu + --} OPTIONAL, + --- Shall be used for X.410 mode only. Shall be bitwise + --- compatible with CCITT Recommendation X.410_1984. + --- This shall be the User data parameter of the CPA PPDU1) + normal_mode_parameters [2] IMPLICIT SEQUENCE { + protocol_version [0] IMPLICIT Protocol_version DEFAULT {version_1}, + responding_presentation_selector [3] IMPLICIT Responding_presentation_selector OPTIONAL, + presentation_context_definition_result_list [5] IMPLICIT Presentation_context_definition_result_list OPTIONAL, + presentation_requirements [8] IMPLICIT Presentation_requirements OPTIONAL, + user_session_requirements [9] IMPLICIT User_session_requirements OPTIONAL, + -- shall not be present if equal to the Revised session + -- requirements parameter -- + user_data User_data OPTIONAL + } OPTIONAL + -- Shall be used for normal mode only. +} + +Responding_presentation_selector ::= Presentation_selector +Presentation_context_definition_result_list ::= Result_list + +Result_list ::= SEQUENCE OF SEQUENCE { + result [0] IMPLICIT Result, + transfer_syntax_name [1] IMPLICIT Transfer_syntax_name OPTIONAL, + provider_reason [2] IMPLICIT INTEGER { + reason_not_specified (0), + abstract_syntax_not_supported (1), + proposed_transfer_syntaxes_not_supported (2), + local_limit_on_DCS_exceeded (3) + } OPTIONAL +} + +Result ::= INTEGER { + acceptance (0), + user_rejection (1), + provider_rejection (2) +} + +Mode_selector ::= SET { + mode_value [0] IMPLICIT INTEGER { x410_1984_mode (0), normal_mode (1) } +} + + +User_data ::= CHOICE { + simply_encoded_data [APPLICATION 0] IMPLICIT Simply_encoded_data, + fully_encoded_data [APPLICATION 1] IMPLICIT Fully_encoded_data +} +-- Subclause 8.4 defines when each of the two alternatives shall be used. + +Simply_encoded_data ::= OCTET STRING +-- See 8.4.1. + +Fully_encoded_data ::= SEQUENCE OF PDV_list +-- contains one or more PDV_list values. +-- See 8.4.2. + +PDV_list ::= SEQUENCE { + transfer_syntax_name Transfer_syntax_name OPTIONAL, + presentation_context_identifier Presentation_context_identifier, + presentation_data_values CHOICE { + single_ASN1_type [0] ANY, + -- Type corresponding to presentation context identifier + octet_aligned [1] IMPLICIT OCTET STRING, + arbitrary [2] IMPLICIT BIT STRING + } + -- Contains one or more presentation data values from the same + -- presentation context. + -- See 8.4.2. +} + + +Presentation_context_definition_list ::= Context_list + +Context_list ::= SEQUENCE OF SEQUENCE { + presentation_context_identifier Presentation_context_identifier, + abstract_syntax_name Abstract_syntax_name, + transfer_syntax_name_list SEQUENCE OF Transfer_syntax_name +} + +Presentation_context_identifier ::= INTEGER +Abstract_syntax_name ::= OBJECT IDENTIFIER +Transfer_syntax_name ::= OBJECT IDENTIFIER +Protocol_version ::= BIT STRING { version_1 (0) } +Calling_presentation_selector ::= Presentation_selector +Called_presentation_selector ::= Presentation_selector +Presentation_selector ::= OCTET STRING + + +Default_context_name ::= SEQUENCE { + abstract_syntax_name [0] IMPLICIT Abstract_syntax_name, + transfer_syntax_name [1] IMPLICIT Transfer_syntax_name +} + +Presentation_requirements ::= BIT STRING { context_management (0), restoration (1) } + +User_session_requirements ::= BIT STRING { + half_duplex (0), + duplex (1), + expedited_data (2), + minor_synchronize (3), + major_synchronize (4), + resynchronize (5), + activity_management (6), + negotiated_release (7), + capability_data (8), + exceptions (9), + typed_data (10), + symmetric_synchronize (11), + data_separation (12) +} + +END diff --git a/src/asn1/mms/compile.sh b/src/asn1/mms/compile.sh new file mode 100755 index 0000000..38098a0 --- /dev/null +++ b/src/asn1/mms/compile.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +rm -r ../../src/main/java-gen/* + +jasn1-compiler -o "../../src/main/java-gen" -p "org.openmuc.openiec61850.internal.mms" -f mms.asn diff --git a/src/asn1/mms/mms.asn b/src/asn1/mms/mms.asn new file mode 100644 index 0000000..6838ae9 --- /dev/null +++ b/src/asn1/mms/mms.asn @@ -0,0 +1,723 @@ +-- +-- Part of the ASN.1-Specification for MMS +-- tries to include only those parts relevant for IEC 61850 +-- source: http://www.nettedautomation.com/standardization/iso/tc184/sc5/wg2/mms_syntax/Version1999/mms_syntax.html + +ASN1 { iso standard 9506 part(2) mms-general-module-version(2) } DEFINITIONS ::= BEGIN + +MMSpdu ::= CHOICE { + confirmed-RequestPDU [0] IMPLICIT Confirmed-RequestPDU, + confirmed-ResponsePDU [1] IMPLICIT Confirmed-ResponsePDU, + confirmed-ErrorPDU [2] IMPLICIT Confirmed-ErrorPDU, + unconfirmed-PDU [3] IMPLICIT Unconfirmed-PDU, + rejectPDU [4] IMPLICIT RejectPDU, + initiate-RequestPDU [8] IMPLICIT Initiate-RequestPDU, + initiate-ResponsePDU [9] IMPLICIT Initiate-ResponsePDU, + initiate-ErrorPDU [10] IMPLICIT Initiate-ErrorPDU, + conclude-RequestPDU [11] IMPLICIT Conclude-RequestPDU +} + +Confirmed-RequestPDU ::= SEQUENCE { + invokeID Unsigned32, + service ConfirmedServiceRequest +} + +ConfirmedServiceRequest ::= CHOICE { + getNameList [1] IMPLICIT GetNameList-Request, + read [4] IMPLICIT Read-Request, + write [5] IMPLICIT Write-Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes-Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Request, + getNamedVariableListAttributes [12] GetNamedVariableListAttributes-Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Request +} + +Unconfirmed-PDU ::= SEQUENCE { + service UnconfirmedService +} + +UnconfirmedService ::= CHOICE { + informationReport [0] IMPLICIT InformationReport +} + +Confirmed-ResponsePDU ::= SEQUENCE { + invokeID Unsigned32, + service ConfirmedServiceResponse +} + +ConfirmedServiceResponse ::= CHOICE { + getNameList [1] IMPLICIT GetNameList-Response, + read [4] IMPLICIT Read-Response, + write [5] IMPLICIT Write-Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes-Response, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Response, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes-Response, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Response +} + + +Confirmed-ErrorPDU ::= SEQUENCE { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError +} + + +ServiceError ::= SEQUENCE { + errorClass [0] CHOICE { + vmd_state [0] IMPLICIT INTEGER, +-- { +-- other (0), +-- vmd-state-conflict (1), +-- vmd-operational-problem (2), +-- domain-transfer-problem (3), +-- state-machine-id-invalid (4) +-- }, + application_reference [1] IMPLICIT INTEGER, +-- { +-- other (0), +-- aplication-unreachable (1), +-- connection-lost (2), +-- application-reference-invalid (3), +-- context-unsupported (4) +-- }, + definition [2] IMPLICIT INTEGER, +-- { +-- other (0), +-- object-undefined (1), +-- invalid-address (2), +-- type-unsupported (3), +-- type-inconsistent (4), +-- object-exists (5), +-- object-attribute-inconsistent (6) +-- }, + resource [3] IMPLICIT INTEGER, +-- { +-- other (0), +-- memory-unavailable (1), +-- processor-resource-unavailable (2), +-- mass-storage-unavailable (3), +-- capability-unavailable (4), +-- capability-unknown (5) +-- }, + service [4] IMPLICIT INTEGER, +-- { +-- other (0), +-- primitives-out-of-sequence (1), +-- object-state-conflict (2), +-- pdu-size (3), +-- continuation-invalid (4), +-- object-constraint-conflict (5) +-- }, + service_preempt [5] IMPLICIT INTEGER, +-- { +-- other (0), +-- timeout (1), +-- deadlock (2), +-- cancel (3) +-- }, + time_resolution [6] IMPLICIT INTEGER, +-- { +-- other (0), +-- unsupportable-time-resolution (1) +-- }, + access [7] IMPLICIT INTEGER, +-- { +-- other (0), +-- object-access-unsupported (1), +-- object-non-existent (2), +-- object-access-denied (3), +-- object-invalidated (4) +-- }, + initiate [8] IMPLICIT INTEGER, +-- { +-- other (0), +-- version-incompatible (1), +-- max-segment-insufficient (2), +-- max-services-outstanding-calling-insufficient (3), +-- max-services-outstanding-called-insufficient (4), +-- service-CBB-insufficient (5), +-- parameter-CBB-insufficient (6), +-- nesting-level-insufficient (7) +-- }, + conclude [9] IMPLICIT INTEGER, +-- { +-- other (0), +-- further-communication-required (1) +-- }, + cancel [10] IMPLICIT INTEGER, +-- { +-- other (0), +-- invoke-id-unknown (1), +-- cancel-not-possible (2) +-- }, + file [11] IMPLICIT INTEGER, +-- { +-- other (0), +-- filename-ambiguous (1), +-- file-busy (2), +-- filename-syntax_Error (3), +-- content-type-invalid (4), +-- position-invalid (5), +-- file-acces-denied (6), +-- file-non-existent (7), +-- duplicate-filename (8), +-- insufficient-space-in-filestore (9) +-- }, + others [12] IMPLICIT INTEGER + }, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL +-- serviceSpecificInformation [3] CHOICE +-- { +-- obtainFile [0] IMPLICIT ObtainFile_Error, +-- start [1] IMPLICIT Start_Error, +-- stop [2] IMPLICIT Stop_Error, +-- resume [3] IMPLICIT Resume_Error, +-- reset [4] IMPLICIT Reset_Error, +-- deleteVariableAccess [5] IMPLICIT DeleteVariableAccess_Error, +-- deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList_Error, +-- deleteNamedType [7] IMPLICIT DeleteNamedType_Error, +-- defineEventEnrollment_Error [8] DefineEventEnrollment_Error, +-- fileRename [9] IMPLICIT FileRename_Error +-- this one is neither in this ASN nor in the IMPORTS +-- additionalService [10] AdditionalServiceError +-- } OPTIONAL + } + + +TimeOfDay ::= OCTET STRING (SIZE(4|6)) + +BasicIdentifier ::= VisibleString ( FROM +("A"|"a"|"B"|"b"|"C"|"c"|"D"|"d"|"E"|"e"|"F"|"f"| +"G"|"g"|"H"|"h"|"I"|"i"|"J"|"j"|"K"|"k"|"L"|"l"| +"M"|"m"|"N"|"n"|"O"|"o"|"P"|"p"|"Q"|"q"|"R"|"r"| +"S"|"s"|"T"|"t"|"U"|"u"|"V"|"v"|"W"|"w"|"X"|"x"| +"Y"|"y"|"Z"|"z"|"$"|"_"|"0"|"1"|"2"|"3"|"4"|"5"| +"6"|"7"|"8"|"9") ) (SIZE(1..32)) + + +Identifier ::= VisibleString + +Integer8 ::= INTEGER(-128..127) +Integer16 ::= INTEGER(-32768..32767) +Integer32 ::= INTEGER(-2147483648..2147483647) + +Unsigned8 ::= INTEGER(0..255) +Unsigned16 ::= INTEGER(0..65535) +Unsigned32 ::= INTEGER(0..4294967295) + +ObjectName ::= CHOICE { + vmd-specific [0] IMPLICIT Identifier, + domain-specific [1] IMPLICIT SEQUENCE { + domainID Identifier, + itemID Identifier + }, + aa-specific [2] IMPLICIT Identifier +} + + +ObjectClass ::= CHOICE { + basicObjectClass [0] IMPLICIT INTEGER +-- { +-- namedVariable (0), +-- scatteredAccess (1), +-- namedVariableList (2), +-- namedType (3), +-- semaphore (4), +-- eventCondition (5), +-- eventAction (6), +-- eventEnrollment (7), +-- journal (8), +-- domain (9), +-- programInvocation (10), +-- operatorStation (11), +-- dataExchange (12), ---- Shall not appear in minor version 1 +-- accessControlList (13) ---- Shall not appear in minor version 1 or 2 +-- } +} + +MMSString ::= VisibleString + + +Initiate-RequestPDU ::= SEQUENCE { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initRequestDetail [4] IMPLICIT SEQUENCE { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions + } +} + +Initiate-ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initResponseDetail [4] IMPLICIT SEQUENCE { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions + } +} + +Initiate-ErrorPDU ::= ServiceError + +Conclude-RequestPDU ::= NULL + + +RejectPDU ::= SEQUENCE +{ + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE + { + confirmed-requestPDU [1] IMPLICIT INTEGER, +-- { +-- other (0), +-- unrecognized-service (1), +-- unrecognized-modifier (2), +-- invalid-invokeID (3), +-- invalid-argument (4), +-- invalid-modifier (5), +-- max-serv-outstanding-exceeded (6), +-- max-recursion-exceeded (8), +-- value-out-of-range (9) +-- }, + + confirmed-responsePDU [2] IMPLICIT INTEGER, +-- { +-- other (0), +-- unrecognized-service (1), +-- invalid-invokeID (2), +-- invalid-result (3), +-- max-recursion-exceeded (5), +-- value-out-of-range (6) +-- }, + + confirmed-errorPDU [3] IMPLICIT INTEGER, +-- { +-- other (0), +-- unrecognized-service (1), +-- invalid-invokeID (2), +-- invalid-serviceError (3), +-- value-out-of-range (4) +-- } , + + unconfirmedPDU [4] IMPLICIT INTEGER, +-- { +-- other (0), +-- unrecognized-service (1), +-- invalid-argument (2), +-- max-recursion-exceeded (3), +-- value-out-of-range (4) +-- }, + + pdu-error [5] IMPLICIT INTEGER, +-- { +-- unknown-pdu-type (0), +-- invalid-pdu (1), +-- illegal-acse-mapping (2) +-- }, + + cancel-requestPDU [6] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-invokeID (1) +-- }, + + cancel-responsePDU [7] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-invokeID (1) +-- }, + + cancel-errorPDU [8] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-invokeID (1), +-- invalid-serviceError (2), +-- value-out-of-range (3) +-- }, + + conclude-requestPDU [9] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-argument (1) +-- }, + + conclude-responsePDU [10] IMPLICIT INTEGER, +-- { +-- other (0), +-- invalid-result (1) +-- }, + + conclude-errorPDU [11] IMPLICIT INTEGER +-- { +-- other (0), +-- invalid-serviceError (1), +-- value-out-of-range (2) +-- } + } +} + + +GetNameList-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + objectScope [1] CHOICE { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL +} + + +GetNameList-Response ::= SEQUENCE { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + + +TypeSpecification ::= CHOICE { +-- typeName [0] ObjectName, + typeDescription TypeDescription +} + +AlternateAccess ::= SEQUENCE OF CHOICE { + unnamed AlternateAccessSelection +-- named [5] IMPLICIT SEQUENCE { +-- componentName [0] CHOICE { +-- basic BasicIdentifier, +-- extended ExtendedIdentifier +-- }, +-- access AlternateAccessSelection +-- } +} + +AlternateAccessSelection ::= CHOICE { + + selectAlternateAccess [0] IMPLICIT SEQUENCE { + accessSelection CHOICE { + component [0] CHOICE { + basic BasicIdentifier --, + --extended ExtendedIdentifier + }, -- component + index [1] IMPLICIT Unsigned32, -- 1 array element + indexRange [2] IMPLICIT SEQUENCE { -- array elements + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [3] IMPLICIT NULL -- all array elements + }, + alternateAccess AlternateAccess + }, + selectAccess CHOICE { + component [1] CHOICE { + basic BasicIdentifier --, + --extended ExtendedIdentifier + }, -- component + index [2] IMPLICIT Unsigned32, -- 1 array element + indexRange [3] IMPLICIT SEQUENCE { -- array elements + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [4] IMPLICIT NULL -- all array elements + } +} + +AccessResult ::= CHOICE { + failure [0] IMPLICIT DataAccessError, + success Data +} + + +Data ::= CHOICE { + -- context tag 0 is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + --boolean [3] IMPLICIT BOOLEAN, + bool [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, -- shall not be negative + floating-point [7] IMPLICIT FloatingPoint, + -- [8] is reserved + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + --generalized-time [11] IMPLICIT GeneralizedTime, + binary-time [12] IMPLICIT TimeOfDay, + --bcd [13] IMPLICIT INTEGER, ---- shall not be negative + --booleanArray [14] IMPLICIT BIT STRING, + --objId [15] IMPLICIT OBJECT IDENTIFIER, + --..., + mMSString [16] IMPLICIT MMSString, + utc-time [17] IMPLICIT UtcTime -- added by IEC61850 8.1 G3 +} + + +FloatingPoint ::= OCTET STRING + +DataAccessError ::= INTEGER +--{ +-- object-invalidated (0), +-- hardware-fault (1), +-- temporarily-unavailable (2), +-- object-access-denied (3), +-- object-undefined (4), +-- invalid-address (5), +-- type-unsupported (6), +-- type-inconsistent (7), +-- object-attribute-inconsistent (8), +-- object-access-unsupported (9), +-- object-non-existent (10), +-- object-value-invalid (11) +--} + + +VariableAccessSpecification ::= CHOICE { + listOfVariable [0] IMPLICIT VariableDefs, + variableListName [1] ObjectName +} + +VariableDefs ::= SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL +} + +VariableSpecification ::= CHOICE { + name [0] ObjectName +-- address [1] Address, +-- variableDescription [2] IMPLICIT SEQUENCE { +-- address Address, +-- typeSpecificationTypeSpecification +-- }, + +-- the following element is present only to support the services +-- defined in annex E +-- scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, +-- invalidated [4] IMPLICIT NULL +} + +Read-Request ::= SEQUENCE { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification +} + +Read-Response ::= SEQUENCE { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult +} + +Write-Request ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data +} + +Write-Response ::= SEQUENCE OF CHOICE { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL +} + +InformationReport ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult +} + +GetVariableAccessAttributes-Request ::= CHOICE { + name [0] ObjectName +-- address [1] Address +} + +GetVariableAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, +-- address [1] Address OPTIONAL, + typeDescription [2] TypeDescription +-- accessControlList [3] CHOICE { +-- basic BasicIdentifier, +-- extended ExtendedIdentifier +-- } OPTIONAL, +-- meaning [4] ObjectName OPTIONAL +} + +DefineNamedVariableList-Request ::= SEQUENCE { + variableListName ObjectName, + listOfVariable [0] IMPLICIT VariableDefs +} + +DefineNamedVariableList-Response ::= NULL + +GetNamedVariableListAttributes-Request ::= ObjectName -- VariableListName + +GetNamedVariableListAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT VariableDefs +-- accessControlList [2] CHOICE { +-- basic BasicIdentifier, +-- extended ExtendedIdentifier +-- } OPTIONAL +} + + +DeleteNamedVariableList-Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER DEFAULT 0, +-- { +-- specific (0), +-- aa-specific (1), +-- domain (2), +-- vmd (3) +-- } DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] CHOICE { + basic BasicIdentifier --, + --extended ExtendedIdentifier + } OPTIONAL +} + +DeleteNamedVariableList-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 +} + +TypeDescription ::= CHOICE { + array [1] IMPLICIT SEQUENCE { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification + }, + structure [2] IMPLICIT SEQUENCE { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF SEQUENCE { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + }, + + -- Simple Size Class + --boolean [3] IMPLICIT NULL, + bool [3] IMPLICIT NULL, + bit-string [4] IMPLICIT Integer32, -- BIT-STRING + integer [5] IMPLICIT Unsigned8, -- INTEGER + unsigned [6] IMPLICIT Unsigned8, -- UNSIGNED + floating-point [7] IMPLICIT SEQUENCE { + format-width Unsigned8, -- number of bits of + -- floating point value + -- including sign, exponent, + -- and fraction + exponent-width Unsigned8 -- size of exponent in bits + }, + + -- [8] is reserved + octet-string [9] IMPLICIT Integer32, -- OCTET-STRING + visible-string [10] IMPLICIT Integer32, -- VISIBLE-STRING + -- generalized-time [11] IMPLICIT NULL, ---- GENERALIZED-TIME + binary-time [12] IMPLICIT BOOLEAN, -- BINARY-TIME + -- bcd [13] IMPLICIT Unsigned8, ---- BCD + -- objId [15] IMPLICIT NULL, + --..., + mMSString [16] IMPLICIT Integer32, -- MMS String + utc-time [17] IMPLICIT NULL -- from IEC61850 8.1 G.2 + } + +UtcTime ::= OCTET STRING (SIZE (8)) + + +ParameterSupportOptions ::= BIT STRING +--{ +-- str1 (0), str2 (1), vnam (2), valt (3), vadr (4), vsca (5), tpy (6), vlis (7), real (8), cei (10) +--} + +ServiceSupportOptions ::= BIT STRING +-- { +-- status (0), +-- getNameList (1), +-- identify (2), +-- rename (3), +-- read (4), +-- write (5), +-- getVariableAccessAttributes (6), +-- defineNamedVariable (7), +-- defineScatteredAccess (8), +-- getScatteredAccessAttributes (9), +-- deleteVariableAccess (10), +-- defineNamedVariableList (11), +-- getNamedVariableListAttributes (12), +-- deleteNamedVariableList (13), +-- defineNamedType (14), +-- getNamedTypeAttributes (15), +-- deleteNamedType (16), +-- input (17), +-- output (18), +-- takeControl (19), +-- relinquishControl (20), +-- defineSemaphore (21), +-- deleteSemaphore (22), +-- reportSemaphoreStatus (23), +-- reportPoolSemaphoreStatus (24), +-- reportSemaphoreEntryStatus (25), +-- initiateDownloadSequence (26), +-- downloadSegment (27), +-- terminateDownloadSequence (28), +-- initiateUploadSequence (29), +-- uploadSegment (30), +-- terminateUploadSequence (31), +-- requestDomainDownload (32), +-- requestDomainUpload (33), +-- loadDomainContent (34), +-- storeDomainContent (35), +-- deleteDomain (36), +-- getDomainAttributes (37), +-- createProgramInvocation (38), +-- deleteProgramInvocation (39), +-- start (40), +-- stop (41), +-- resume (42), +-- reset (43), +-- kill (44), +-- getProgramInvocationAttributes (45), +-- obtainFile (46), +-- defineEventCondition (47), +-- deleteEventCondition (48), +-- getEventConditionAttributes (49), +-- reportEventConditionStatus (50), +-- alterEventConditionMonitoring (51), +-- triggerEvent (52), +-- defineEventAction (53), +-- deleteEventAction (54), +-- getEventActionAttributes (55), +-- reportEventActionStatus (56), +-- defineEventEnrollment (57), +-- deleteEventEnrollment (58), +-- alterEventEnrollment (59), +-- reportEventEnrollmentStatus (60), +-- getEventEnrollmentAttributes (61), +-- acknowledgeEventNotification (62), +-- getAlarmSummary (63), +-- getAlarmEnrollmentSummary (64), +-- readJournal (65), +-- writeJournal (66), +-- initializeJournal (67), +-- reportJournalStatus (68), +-- createJournal (69), +-- deleteJournal (70), +-- getCapabilityList (71), +-- fileOpen (72), +-- fileRead (73), +-- fileClose (74), +-- fileRename (75), +-- fileDelete (76), +-- fileDirectory (77), +-- unsolicitedStatus (78), +-- informationReport (79), +-- eventNotification (80), +-- attachToEventCondition (81), +-- attachToSemaphore (82), +-- conclude (83), +-- cancel (84) +-- } + + + +END diff --git a/src/asn1/mms/more-asn1-files/mms-epfl.asn b/src/asn1/mms/more-asn1-files/mms-epfl.asn new file mode 100644 index 0000000..99826b2 --- /dev/null +++ b/src/asn1/mms/more-asn1-files/mms-epfl.asn @@ -0,0 +1,3468 @@ +--Quelle: http://lamspeople.epfl.ch/kirrmann/mms/Documentation/mms_abstract_syntax.htm +-- Pretty-printed by Asnp, the pretty-printer of France Telecom R&D +-- MMS & GOOSE +-- This file contains all ASN.1 encodings for MMS 9506-2003, plus the additions for IEC 61850 8.1 +-- (Annex G) and GOOSE (Annex A) +-- As a modification (that does not affect decoding), type utc-time has +-- been moved to the 9506 encodings according to Annex G +-- This file has been checked with the OSS parser +-- ABB Switzerland Corporate Research , Hubert Kirrmann 2005-07-21 +-- This file starts with the IEC61850 definitions. + +IEC61850 DEFINITIONS ::= +BEGIN + +IMPORTS + Data, UtcTime + FROM ISO-9506-MMS-1 {iso standard 9506 part(2) + mms-abstract-syntax-version1(1)}; + +IEC61850-8-1SpecificProtocol ::= CHOICE { + gseMngtPdu [APPLICATION 0] IMPLICIT GSEMngtPdu, + goosePdu [APPLICATION 1] IMPLICIT IECGoosePdu} + +GSEMngtPdu ::= SEQUENCE { + stateID [0] IMPLICIT INTEGER, + security [3] OCTET STRING OPTIONAL, -- reserved for future definition + req-or-resp + CHOICE {requests [1] GSEMngtRequests, + responses [2] GSEMngtResponses}} + +GSEMngtRequests ::= CHOICE { + getGoReference [1] IMPLICIT GetReferenceRequestPdu, + getGOOSEElementNumber [2] IMPLICIT GetElementRequestPdu, + getGsReference [3] IMPLICIT GetReferenceRequestPdu, + getGSSEDataOffset [4] IMPLICIT GetElementRequestPdu} + +GSEMngtResponses ::= CHOICE { + gseMngtNotSupported [0] IMPLICIT NULL, + getGoReference [1] IMPLICIT GSEMngtResponsePdu, + getGOOSEElementNumber [2] IMPLICIT GSEMngtResponsePdu, + getGsReference [3] IMPLICIT GSEMngtResponsePdu, + getGSSEDataOffset [4] IMPLICIT GSEMngtResponsePdu} + +GetReferenceRequestPdu ::= SEQUENCE { + ident [0] IMPLICIT VisibleString, -- size shall support up to 65 octets + offset [1] IMPLICIT SEQUENCE OF INTEGER} + +GetElementRequestPdu ::= SEQUENCE { + ident [0] IMPLICIT VisibleString, -- size shall support up to 65 octets + references [1] IMPLICIT SEQUENCE OF VisibleString} + +GSEMngtResponsePdu ::= SEQUENCE { + ident [0] IMPLICIT VisibleString, -- echos the value of the request + confRev [1] IMPLICIT INTEGER OPTIONAL, + response + CHOICE {responsePositive + [2] IMPLICIT SEQUENCE {datSet + [0] IMPLICIT VisibleString OPTIONAL, + result + [1] IMPLICIT SEQUENCE OF RequestResults}, + responseNegative [3] IMPLICIT GlbErrors}} + +RequestResults ::= CHOICE { + offset [0] IMPLICIT INTEGER, + reference [1] IMPLICIT IA5String, + error [2] IMPLICIT ErrorReason} + +GlbErrors ::= INTEGER { + other(0), unknownControlBlock(1), responseTooLarge(2), + controlBlockConfigurationError(3)} + +ErrorReason ::= INTEGER {other(0), notFound(1)} + +IECGoosePdu ::= SEQUENCE { + gocbRef [0] IMPLICIT VisibleString, + timeAllowedtoLive [1] IMPLICIT INTEGER, + datSet [2] IMPLICIT VisibleString, + goID [3] IMPLICIT VisibleString OPTIONAL, + t [4] IMPLICIT UtcTime, + stNum [5] IMPLICIT INTEGER, + sqNum [6] IMPLICIT INTEGER, + test [7] IMPLICIT BOOLEAN DEFAULT FALSE, + confRev [8] IMPLICIT INTEGER, + ndsCom [9] IMPLICIT BOOLEAN DEFAULT FALSE, + numDatSetEntries [10] IMPLICIT INTEGER, + allData [11] IMPLICIT SEQUENCE OF Data, + security [12] OCTET STRING OPTIONAL + -- reserved for digital signature--} + +-- UtcTime ::= OCTET STRING format and size defined in 8.1.3.6. moved to 9506 +END + + + +-- ==================================================================== +MMS-Object-Module-1 {iso standard 9506 part(1) mms-object-model-version1(2)} +DEFINITIONS ::= +BEGIN + +-- This ASN.1 specification for IEC 9506-2003 has been checked for conformance with the +-- ASN.1 standard by the OSS ASN.1 Tools. +-- It has been modified (2005-07-19) to include the IEC 61850 type utc-time and +-- extend the identifier size according to 61850 8.1 G.2 - G.3, and introduce two +-- additional encodings for the Data type. + +EXPORTS + AccessCondition, AdditionalCBBOptions, AdditionalSupportOptions, Address, + AlarmAckRule, Control-State, DomainState, EC-State, EC-Class, EE-Duration, + EE-Class, EventTime, Journal-Variable, LogicalStatus, Modifier, + normalPriority, normalSeverity, ParameterSupportOptions, PhysicalStatus, + Priority, ProgramInvocationState, Running-Mode, ServiceSupportOptions, + Severity, Transitions, TypeDescription, ULState, VMDState; + +IMPORTS + ApplicationReference, Authentication-value + FROM MMS-Environment-1 {iso standard 9506 part(2) + mms-environment-version1(4)} + AlternateAccess, ConfirmedServiceRequest, AttachToSemaphore, + AttachToEventCondition, Data, EE-State, Identifier, Integer8, Integer32, + MMSString, MMS255String, ObjectName, TimeOfDay, TypeSpecification, + Unsigned32, Unsigned8 + FROM ISO-9506-MMS-1 {iso standard 9506 part(2) + mms-abstract-syntax-version1(1)}; + +-- Part 1 - Object Model Definitions +-- +-- Note - ASN.1 rules for interpreting the object formalism. +-- +-- Each field has a field identifier possibly followed by a name. +-- The field identifier begins with an '&' and is followed by a reference name, +-- beginning with either a lower case or an upper case letter. +-- +-- If the field identifier begins with '&' Upper case letter: +-- +-- If there is no following name, +-- the field identifies a type. +-- If the following name is mixed case +-- and begins with an upper case letter, +-- or if the following name is upper case +-- and the name of a Universal type, +-- the field identifies a value set. +-- If the following name is upper case +-- and the name of an Object Class, +-- the field identifies an Object Set. +-- +-- If the field identifier begins with '&' lower case letter: +-- +-- If the following name is upper case +-- and the name of an Object Class, +-- the field identifies an Object (instance). +-- If the following name is mixed case +-- and begins with an upper case letter, +-- or if the following name is upper case +-- and is the name of a Universal type, +-- the field identifies a value. +-- +VMD ::= CLASS { + &executiveFunction ApplicationReference, + &vendorName MMSString, + &modelName MMSString, + &revision MMSString, + &AbstractSyntaxes ABSTRACT-SYNTAX OPTIONAL, + &EATransactions TRANSACTION OPTIONAL, + &Associations APPLICATION-ASSOCIATION, + &accessControl Identifier, + &logicalStatus LogicalStatus, + &Capabilities MMSString, + &physicalStatus PhysicalStatus, + &local-detail BIT STRING(SIZE (1..128)), + &AccessControlLists ACCESS-CONTROL-LIST OPTIONAL, + &Domains DOMAIN OPTIONAL, + &ProgramInvocations PROGRAM-INVOCATION OPTIONAL, + &UnitControls UNIT-CONTROL OPTIONAL, + &UnnamedVariables UNNAMED-VARIABLE OPTIONAL, + &NamedVariables NAMED-VARIABLE OPTIONAL, + &NamedVariableLists NAMED-VARIABLE-LIST OPTIONAL, + &NamedTypes NAMED-TYPE OPTIONAL, + &DataExchanges DATA-EXCHANGE OPTIONAL, + &Semaphores SEMAPHORE OPTIONAL, + &OperatorStations OPERATOR-STATION OPTIONAL, + &EventConditions EVENT-CONDITION OPTIONAL, + &EventActions EVENT-ACTION OPTIONAL, + &EventEnrollments EVENT-ENROLLMENT OPTIONAL, + &EventConditionLists EVENT-CONDITION-LIST OPTIONAL, + &Journals JOURNAL OPTIONAL, + &operationState VMDState, + &safety-Interlocks-Violated BOOLEAN, + &any-Resource-Power-On BOOLEAN, + &all-Resources-Calibrated BOOLEAN, + &local-Control BOOLEAN, + &selected-Program-Invocation Identifier} + +LogicalStatus ::= [0] IMPLICIT INTEGER { + state-changes-allowed(0), no-state-changes-allowed(1), + limited-services-permitted(2), support-services-allowed(3)}(0..3) + +PhysicalStatus ::= [1] IMPLICIT INTEGER { + operational(0), partially-operational(1), inoperable(2), + needs-commissioning(3)}(0..3) + +VMDState ::= INTEGER { + idle(0), loaded(1), ready(2), executing(3), motion-paused(4), + manualInterventionRequired(5)}(0..5) + +TRANSACTION ::= CLASS { + &invokeID INTEGER UNIQUE, + &Pre-excutionModifiers ModifierStep OPTIONAL, + ¤tModifier CHOICE {modifier ModifierStep, + none NULL}, + &confirmedService-Request ConfirmedServiceRequest, + &Post-executionModifiers ModifierStep OPTIONAL, + &cancelable BOOLEAN} + +ModifierStep ::= SEQUENCE {modifierID INTEGER, + modifier Modifier} + +Modifier ::= CHOICE { + eventModifier [0] IMPLICIT AttachToEventCondition, + semaphoreModifier [1] IMPLICIT AttachToSemaphore} + +APPLICATION-ASSOCIATION ::= CLASS { + &aaIdentifier INTEGER UNIQUE, + &client ApplicationReference, + &abstractSyntax ABSTRACT-SYNTAX, + &authenticationValue Authentication-value OPTIONAL, + -- This field represents a 'user password' + &Transactions TRANSACTION OPTIONAL, + &NamedVariables NAMED-VARIABLE OPTIONAL, + &NamedVariableLists NAMED-VARIABLE-LIST OPTIONAL, + &NamedTypes NAMED-TYPE OPTIONAL, + &EventConditions EVENT-CONDITION OPTIONAL, + &EventActions EVENT-ACTION OPTIONAL, + &EventEnrollments EVENT-ENROLLMENT OPTIONAL, + &EventConditionLists EVENT-CONDITION-LIST OPTIONAL, + &Journals JOURNAL OPTIONAL, + &services ServiceSupportOptions, + ¶meters ParameterSupportOptions, + &nest INTEGER, + &Ulsms ULSM OPTIONAL, + &extendedServices AdditionalSupportOptions, + &extendedParameters AdditionalCBBOptions} + +ServiceSupportOptions ::= BIT STRING { + status(0), getNameList(1), identify(2), rename(3), read(4), write(5), + getVariableAccessAttributes(6), + defineNamedVariable(7), + -- bit 8 is reserved for use of a service defined in annex E + defineScatteredAccess(8), + -- bit 9 is reserved for use of a service defined in annex E + getScatteredAccessAttributes(9), deleteVariableAccess(10), + defineNamedVariableList(11), getNamedVariableListAttributes(12), + deleteNamedVariableList(13), defineNamedType(14), getNamedTypeAttributes(15), + deleteNamedType(16), input(17), output(18), takeControl(19), + relinquishControl(20), defineSemaphore(21), deleteSemaphore(22), + reportSemaphoreStatus(23), reportPoolSemaphoreStatus(24), + reportSemaphoreEntryStatus(25), initiateDownloadSequence(26), + downloadSegment(27), terminateDownloadSequence(28), + initiateUploadSequence(29), uploadSegment(30), terminateUploadSequence(31), + requestDomainDownload(32), requestDomainUpload(33), loadDomainContent(34), + storeDomainContent(35), deleteDomain(36), getDomainAttributes(37), + createProgramInvocation(38), deleteProgramInvocation(39), start(40), + stop(41), resume(42), reset(43), kill(44), + getProgramInvocationAttributes(45), obtainFile(46), defineEventCondition(47), + deleteEventCondition(48), getEventConditionAttributes(49), + reportEventConditionStatus(50), alterEventConditionMonitoring(51), + triggerEvent(52), defineEventAction(53), deleteEventAction(54), + getEventActionAttributes(55), reportEventActionStatus(56), + defineEventEnrollment(57), deleteEventEnrollment(58), + alterEventEnrollment(59), reportEventEnrollmentStatus(60), + getEventEnrollmentAttributes(61), acknowledgeEventNotification(62), + getAlarmSummary(63), getAlarmEnrollmentSummary(64), readJournal(65), + writeJournal(66), initializeJournal(67), reportJournalStatus(68), + createJournal(69), deleteJournal(70), + getCapabilityList(71), + -- bit 72 is reserved for use of a service defined in annex D + fileOpen(72), + -- bit 73 is reserved for use of a service defined in annex D + fileRead(73), + -- bit 74 is reserved for use of a service defined in annex D + fileClose(74), + -- bit 75 is reserved for use of a service defined in annex D + fileRename(75), + -- bit 76 is reserved for use of a service defined in annex D + fileDelete(76), + -- bit 77 is reserved for use of a service defined in annex D + fileDirectory(77), unsolicitedStatus(78), informationReport(79), + eventNotification(80), attachToEventCondition(81), attachToSemaphore(82), + conclude(83), cancel(84), + getDataExchangeAttributes(85), + -- Shall not appear in minor version one + exchangeData(86), + -- Shall not appear in minor version one + defineAccessControlList(87), + -- Shall not appear in minor version one or two + getAccessControlListAttributes(88), + -- Shall not appear in minor version one or two + reportAccessControlledObjects(89), + -- Shall not appear in minor version one or two + deleteAccessControlList(90), + -- Shall not appear in minor version one or two + alterAccessControl(91), + -- Shall not appear in minor version one or two + reconfigureProgramInvocation(92)}(SIZE (93)) + +ParameterSupportOptions ::= BIT STRING { + str1(0), str2(1), vnam(2), valt(3), + vadr(4), + -- bit 5 is reserved for the services defined in Annex E. + vsca(5), tpy(6), vlis(7), + -- bit 8 is reserved + -- bit 9 is reserved + cei(10), aco(11), sem(12), csr(13), csnc(14), csplc(15), cspi(16), + char(17)}(SIZE (18)) + +AdditionalSupportOptions ::= BIT STRING { + vMDStop(0), vMDReset(1), select(2), alterProgramInvocationAttributes(3), + initiateUnitControlLoad(4), unitControlLoadSegment(5), unitControlUpload(6), + startUnitControl(7), stopUnitControl(8), createUnitControl(9), + addToUnitControl(10), removeFromUnitControl(11), + getUnitControlAttributes(12), loadUnitControlFromFile(13), + storeUnitControlToFile(14), deleteUnitControl(15), + defineEventConditionList(16), deleteEventConditionList(17), + addEventConditionListReference(18), removeEventConditionListReference(19), + getEventConditionListAttributes(20), reportEventConditionListStatus(21), + alterEventConditionListMonitoring(22)}(SIZE (23)) + +AdditionalCBBOptions ::= BIT STRING {des(0), dei(1), recl(2)}(SIZE (3)) + +ACCESS-CONTROL-LIST ::= CLASS { + &name Identifier, + &accessControl Identifier, + &readAccessCondition [0] AccessCondition OPTIONAL, + &storeAccessCondition [1] AccessCondition OPTIONAL, + &writeAccessCondition [2] AccessCondition OPTIONAL, + &loadAccessCondition [3] AccessCondition OPTIONAL, + &executeAccessCondition [4] AccessCondition OPTIONAL, + &deleteAccessCondition [5] AccessCondition OPTIONAL, + &editAccessCondition [6] AccessCondition OPTIONAL, + -- + -- The following fields are used to record lists of objects placed + -- under the control of this ACCESS-CONTROL-LIST object. + -- They will be referred to collectively as the Controlled Object Lists + -- + &AccessControlLists Identifier OPTIONAL, + &Domains Identifier OPTIONAL, + &ProgramInvocations Identifier OPTIONAL, + &UnitControls Identifier OPTIONAL, + &UnnamedVariables Address OPTIONAL, + &NamedVariables ObjectName OPTIONAL, + &NamedVariableLists ObjectName OPTIONAL, + &NamedTypes ObjectName OPTIONAL, + &DataExchanges ObjectName OPTIONAL, + &Semaphores Identifier OPTIONAL, + &OperatorStations Identifier OPTIONAL, + &EventConditions ObjectName OPTIONAL, + &EventActions ObjectName OPTIONAL, + &EventEnrollments ObjectName OPTIONAL, + &Journals ObjectName OPTIONAL, + &EventConditionLists ObjectName OPTIONAL} + +AccessCondition ::= CHOICE { + never [0] IMPLICIT NULL, + semaphore [1] Identifier, + user [2] CHOICE {association ApplicationReference, + none NULL}, + password [3] Authentication-value, + joint [4] IMPLICIT SEQUENCE OF AccessCondition, + alternate [5] IMPLICIT SEQUENCE OF AccessCondition} + +DOMAIN ::= CLASS { + &name Identifier, + -- shall be unique among the names of all Domains within the VMD + &Capabilities MMSString, + &state DomainState, + &aAssociation INTEGER OPTIONAL, + -- This field shall be present if and only if + -- the &state field has a value of + -- loading, complete, incomplete, d1, d2, d3 or d9 + &accessControl Identifier, + &sharable BOOLEAN, + &ProgramInvocations Identifier OPTIONAL, + &uploadsInProgress INTEGER, + -- The following items reflect the Domain content + -- All the items listed have Domain-specific names. + &NamedVariables NAMED-VARIABLE OPTIONAL, + &NamedVariableLists NAMED-VARIABLE-LIST OPTIONAL, + &NamedTypes NAMED-TYPE OPTIONAL, + &EventConditions EVENT-CONDITION OPTIONAL, + &EventActions EVENT-ACTION OPTIONAL, + &EventEnrollments EVENT-ENROLLMENT OPTIONAL, + &EventConditionLists EVENT-CONDITION-LIST OPTIONAL, + &Journals JOURNAL OPTIONAL} + +DomainState ::= INTEGER { + non-existent(0), loading(1), ready(2), in-use(3), complete(4), incomplete(5), + d1(7), d2(8), d3(9), d4(10), d5(11), d6(12), d7(13), d8(14), d9(15) +}(0..15) + +ULSM ::= CLASS { + &ulsmID INTEGER UNIQUE, + -- shall be unique among all ULSM's within this application association + &domain Identifier, + &ulsmState ULState} + +ULState ::= INTEGER { + non-existent(0), uploading(1), uploaded(2), u1(3), u2(4), u3(5), u4(6) +}(0..6) + +PROGRAM-INVOCATION ::= CLASS { + &name Identifier, -- shall be unique among all Program Invocations + &programInvocationState ProgramInvocationState, + &Domains Identifier, + &accessControl Identifier, + &reusable BOOLEAN, + &monitor BOOLEAN, + -- The following three fields shall all be present if the value of + -- monitor is true. + -- If present, the &name field of each object instance + -- shall have a value equal to the + -- &name field of this instance of the PROGRAM-INVOCATION. + &eventCondition Identifier OPTIONAL, + &eventAction Identifier OPTIONAL, + &eventEnrollment Identifier OPTIONAL, + &executionArgument MMSString, + &errorCode INTEGER, + &control Control-State, + -- The following field shall be present + -- if and only if the value of the &control field is controlled. + &controlling-Program-Invocation Identifier, + -- The following two fields shall be present + -- if and only if the value of the &control field is controlling. + &Controlled-Program-Invocations Identifier, + &program-Location MMSString OPTIONAL, + &running-Mode Running-Mode, + -- The following field shall be present + -- if and only if the value of the &running-Mode field is cycle-limited + &remaining-Cycle-Count INTEGER OPTIONAL, + -- The following field shall be present + -- if and only if the value of the &running-Mode field is step-limited + &remaining-Step-Count INTEGER OPTIONAL} + +ProgramInvocationState ::= INTEGER { + non-existent(0), unrunnable(1), idle(2), running(3), stopped(4), starting(5), + stopping(6), resuming(7), resetting(8)}(0..8) + +Control-State ::= INTEGER {normal(0), controlling(1), controlled(2)}(0..2) + +Running-Mode ::= INTEGER {free-run(0), cycle-limited(1), step-limited(2)}(0..2) + +UNIT-CONTROL ::= CLASS { + &name Identifier, + -- Shall be unique within the VMD + &accessControl Identifier, + &Domains Identifier, + &ProgramInvocations Identifier} + +UNNAMED-VARIABLE ::= CLASS { + &address Address, + &accessControl Identifier, + &typeDescription TypeDescription, + &value Data, + &accessMethod ENUMERATED {public} + -- The field '&accessMethod' shall have a value equal to public.--} + +Address ::= CHOICE { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] MMSString, + unconstrainedAddress [2] IMPLICIT OCTET STRING} + +NAMED-VARIABLE ::= CLASS { + &name ObjectName, -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &typeDescription TypeDescription, + &value Data, + &accessMethod ENUMERATED {public, anythingElse, ... + }, + &address Address OPTIONAL, + -- The presence of this field shall correspond to the + -- field &access Method having a value equal to public. + -- The absence of this field shall correspond to the + -- field &accessMethod having a value equal to anything except public. + -- The following field shall occur if and only if the sem CBB has been negotiated. + &meaning ObjectName OPTIONAL} + +NAMED-VARIABLE-LIST ::= CLASS { + &name ObjectName, -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &listOfVariables VARIABLE-LIST-ITEM} + +VARIABLE-LIST-ITEM ::= + CLASS { -- one and only one of the following two lines shall appear + &unnamedItem Address OPTIONAL, + &namedItem ObjectName OPTIONAL, + -- the following specification may be included + &alternateAccess AlternateAccess OPTIONAL} + +NAMED-TYPE ::= CLASS { + &name ObjectName, + -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &typeDescription TypeDescription, + -- The following field shall occur if and only if the sem CBB has been negotiated: + &meaning ObjectName OPTIONAL} + +-- type definition modified HK +TypeDescription ::= CHOICE { + array + [1] IMPLICIT SEQUENCE {packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification}, + structure + [2] IMPLICIT SEQUENCE {packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components + [1] IMPLICIT SEQUENCE OF + SEQUENCE {componentName + [0] IMPLICIT Identifier + OPTIONAL, + componentType + [1] TypeSpecification}}, + -- Simple Size Class + boolean [3] IMPLICIT NULL, -- BOOLEAN + bit-string [4] IMPLICIT Integer32, -- BIT-STRING + integer [5] IMPLICIT Unsigned8, -- INTEGER + unsigned [6] IMPLICIT Unsigned8, -- UNSIGNED + floating-point + [7] IMPLICIT SEQUENCE {format-width Unsigned8, -- number of bits of-- + -- floating point value + -- including sign, exponent, + -- and fraction + exponent-width Unsigned8 -- size of exponent in bits--}, + -- [8] is reserved + octet-string [9] IMPLICIT Integer32, -- OCTET-STRING + visible-string [10] IMPLICIT Integer32, -- VISIBLE-STRING + generalized-time [11] IMPLICIT NULL, -- GENERALIZED-TIME + binary-time [12] IMPLICIT BOOLEAN, -- BINARY-TIME + bcd [13] IMPLICIT Unsigned8, -- BCD + objId [15] IMPLICIT NULL, + ..., + mMSString [16] Integer32, -- MMS String + utc-time [17] IMPLICIT NULL -- from IEC61850 8.1 G.2 --} + +DATA-EXCHANGE ::= CLASS { + &name Identifier, -- shall be unique among all Data Exchange objects within the VMD + &inUse BOOLEAN, + &accessControl Identifier, + &request SEQUENCE OF TypeDescription, + &response SEQUENCE OF TypeDescription, + &linked BOOLEAN, + -- The following attribute shall appear if an only if + -- the value of &linked is true. + &programInvocation Identifier} + +SEMAPHORE ::= CLASS { + &name ObjectName, -- shall be unique among all semaphores within the VMD + &accessControl Identifier, + &class ENUMERATED {token, pool}, + -- If the value of &class is token, the following two fields shall appear + &numberOfTokens INTEGER OPTIONAL, + &numberOfOwnedTokens INTEGER OPTIONAL, + -- If the value of &class is pool, the following field shall appear + &NamedTokens NAMED-TOKEN OPTIONAL, + &Owners SEMAPHORE-ENTRY OPTIONAL, + &Requesters SEMAPHORE-ENTRY OPTIONAL, + &eventCondition ObjectName} + +NAMED-TOKEN ::= CLASS { + &name Identifier, + &state ENUMERATED {free, owned}} + +SEMAPHORE-ENTRY ::= CLASS { + &entryID OCTET STRING, -- this value shall be unique to the semaphore object + + -- that is the parent of this object + &class ENUMERATED {simple, modifier}, + &semaphore Identifier, + &requester ApplicationReference, + &aaIdentifier INTEGER, + &invokeID INTEGER, + -- The following field shall appear only if the semaphore is a pool semaphore + &named-token Identifier OPTIONAL, + &priority Priority, + &entryState ENUMERATED {queued, owner, hung}, + -- The following field shall appear only if the entryState has the value queued. + &remainingAcqDelay CHOICE {time Unsigned32, + forever NULL} OPTIONAL, + -- The following field shall appear + -- only if the entryState has the value owner or hung. + &remainingTimeOut CHOICE {time Unsigned32, + forever NULL} OPTIONAL, + &abortOnTimeOut BOOLEAN, + &relinquishIfLost BOOLEAN} + +Priority ::= INTEGER(0..127) + +normalPriority Priority ::= 64 + +OPERATOR-STATION ::= CLASS { + &name Identifier, + -- shall be unique within its range of specification (VMD) + &accessControl Identifier, + &stationType ENUMERATED {entry, display, entry-display}, + -- The following field shall appear if stationType is entry or entry-display + &inputBuffer MMSString OPTIONAL, + -- The following field shall appear if stationType is display or entry-display + &outputBuffers SEQUENCE OF MMSString OPTIONAL, + &state ENUMERATED {idle, display-prompt-data, waiting-for-input, + input-buffer-filled, output-buffers-filled}} + +EVENT-CONDITION ::= CLASS { + &name ObjectName, + -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &ecClass EC-Class, + &ecState EC-State, + &priority Priority, + &severity Severity, + &EventEnrollments ObjectName OPTIONAL, + -- The following fields shall be present + -- if and only if the value of &ecClass is monitored. + &enabled BOOLEAN OPTIONAL, + &alarmSummaryReports BOOLEAN OPTIONAL, + &monitoredVariable CHOICE {named [0] ObjectName, + unnamed [1] Address, + unspecified NULL} OPTIONAL, + &evaluationInterval INTEGER OPTIONAL, + &timeToActive EventTime OPTIONAL, + &timeToIdle EventTime OPTIONAL, + &displayEnhancement CHOICE {text MMSString, + number INTEGER, + none NULL} OPTIONAL, + &group-Priority-Override CHOICE {priority Priority, + undefined NULL} OPTIONAL, + &ReferencingEventConditionLists Identifier OPTIONAL + -- EVENT-CONDITION-LIST.&name --} + +EC-Class ::= INTEGER {network-triggered(0), monitored(1)}(0..1) + +EC-State ::= INTEGER {disabled(0), idle(1), active(2)}(0..2) + +Severity ::= INTEGER(0..127) + +normalSeverity Severity ::= 64 + +EventTime ::= CHOICE { + timeOfDay [0] IMPLICIT TimeOfDay, + timeSequenceIdentifier [1] IMPLICIT Unsigned32, + undefined [2] IMPLICIT NULL} + +EVENT-ACTION ::= CLASS { + &name ObjectName, + -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &confirmedServiceRequest ConfirmedServiceRequest, + &Modifiers Modifier OPTIONAL, + &EventEnrollments Identifier OPTIONAL} + +EVENT-ENROLLMENT ::= CLASS { + &name ObjectName, -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &eeClass EE-Class, + &eventCondition Identifier, + &ecTransitions Transitions, + &aAssociation INTEGER, + -- The following two fields are present if and only if the + -- value of &eeClass is modifier. + &invokeID INTEGER OPTIONAL, + &remainingDelay CHOICE {time INTEGER, + forever NULL} OPTIONAL, + -- All the following fields are present if and only if the + -- value of &eeClass is notification. + ¬ificationLost BOOLEAN OPTIONAL, + &eventAction ObjectName OPTIONAL, + &duration EE-Duration OPTIONAL, + &clientApplication ApplicationReference OPTIONAL, + -- The following four fields are present if and only if the + -- value of &eeClass is notification and the value of &ecState + -- of the Event Condition object is monitored + &aaRule AlarmAckRule OPTIONAL, + &timeActiveAck EventTime OPTIONAL, + &timeIdleAck EventTime OPTIONAL, + &ackState ENUMERATED {acked, noAckA, noAckI} OPTIONAL, + &lastState EC-State OPTIONAL, + &displayEnhancement CHOICE {text MMSString, + number INTEGER, + none NULL} OPTIONAL} + +EE-Class ::= INTEGER {modifier(0), notification(1)}(0..1) + +Transitions ::= BIT STRING { + idle-to-disabled(0), active-to-disabled(1), disabled-to-idle(2), + active-to-idle(3), disabled-to-active(4), idle-to-active(5), + any-to-deleted(6)}(SIZE (7)) + +EE-Duration ::= INTEGER {current(0), permanent(1)}(0..1) + +AlarmAckRule ::= INTEGER {none(0), simple(1), ack-active(2), ack-all(3)}(0..3) + +EVENT-CONDITION-LIST ::= CLASS { + &name ObjectName, + -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &EventConditions ObjectName, + &EventConditionLists ObjectName OPTIONAL, + &ReferencingEventConditionLists ObjectName OPTIONAL} + +JOURNAL ::= CLASS { + &name ObjectName, -- shall be unique within its range of specification (VMD, Domain, AA) + &accessControl Identifier, + &Entries JOURNAL-ENTRY OPTIONAL} + +JOURNAL-ENTRY ::= CLASS { + &journal ObjectName, + &entry OCTET STRING, + &clientApplication ApplicationReference, + &timeStamp TimeOfDay, + &orderOfReceipt INTEGER UNIQUE, + &informationType ENUMERATED {annotation, event-data, data}, + -- The following attribute shall appear if and only if the + -- value of &informationType is annotation. + &textComment MMS255String OPTIONAL, + --The following attribute shall appear if and only if the + -- value of &informationType is event-data. + &eventTransitionRecord SEQUENCE {name [0] ObjectName, + currentState [1] IMPLICIT EC-State} OPTIONAL, + -- The following attribute shall appear if and only if the + -- value of &informationType is data or event-data. + &journalVariables SEQUENCE OF Journal-Variable OPTIONAL} + +Journal-Variable ::= SEQUENCE { + variableTag MMS255String, + valueSpecification Data} + +mMSNamedVariable OBJECT IDENTIFIER ::= + {iso standard 9506 part(1) symbols-version1(5) named-variable(1)} + +mMSAccessControlList OBJECT IDENTIFIER ::= + {iso standard 9506 part(1) symbols-version1(5) access-control-list(2)} + +mMSEventCondition OBJECT IDENTIFIER ::= + {iso standard 9506 part(1) symbols-version1(5) event-condition(3)} + +m-powerProblem NAMED-VARIABLE ::= + {&name vmd-specific:"M_powerProblem", + &accessControl "M_ReadOnly", + &typeDescription boolean:NULL, + &accessMethod anythingElse, + &value boolean:FALSE} + +m-ELT NAMED-VARIABLE ::= + {&name vmd-specific:"M_ELT", + &accessControl "M_ReadOnly", + &typeDescription integer:32, + &accessMethod anythingElse, + &value integer:0} + +m-DAYTIME NAMED-VARIABLE ::= + {&name vmd-specific:"M_DAYTIME", + &accessControl "M_NonDeletable", + &typeDescription generalized-time:NULL, + &accessMethod anythingElse, + &value generalized-time:"299107311200"} + +m-Deletable ACCESS-CONTROL-LIST ::= + {&name "M_Deletable", + &accessControl "M_Never"} + +m-NonDeletable ACCESS-CONTROL-LIST ::= + {&name "M_NonDeletable", + &accessControl "M_Never", + &deleteAccessCondition never:NULL, + &NamedVariables {vmd-specific:"M_DAYTIME"}} + +m-ReadOnly ACCESS-CONTROL-LIST ::= + {&name "M_ReadOnly", + &accessControl "M_Never", + &writeAccessCondition never:NULL, + &deleteAccessCondition never:NULL, + &editAccessCondition never:NULL, + &NamedVariables + {vmd-specific:"M_ELT" | vmd-specific:"M_DAYTIME"}} + +m-Never ACCESS-CONTROL-LIST ::= + {&name "M_Never", + &accessControl "M_Never", + &deleteAccessCondition never:NULL, + &editAccessCondition never:NULL, + &AccessControlLists + {"M_Deletable" | "M_NonDeletable" | "M_Never" | "M_ReadOnly"}, + &EventConditions {vmd-specific:"M_Violation"}} + +m-Violation EVENT-CONDITION ::= + {&name vmd-specific:"M_Violation", + &accessControl "M_Never", + &ecClass network-triggered, + &ecState active, + &priority normalPriority, + &severity normalSeverity} + +END + + + +ISO-9506-MMS-1 {iso standard 9506 part(2) mms-abstract-syntax-version1(1)} +DEFINITIONS ::= +BEGIN + +EXPORTS + AlternateAccess, AttachToEventCondition, AttachToSemaphore, + ConfirmedServiceRequest, Data, EE-State, FileName, Identifier, Integer8, + Integer32, MMSString, MMS255String, UtcTime, ObjectName, TimeOfDay, + TypeSpecification, Unsigned32, Unsigned8, VariableSpecification; + +IMPORTS + ApplicationReference, Authentication-value + FROM MMS-Environment-1 {iso standard 9506 part(2) + mms-environment-version1(4)} + ObtainFile-Request, ObtainFile-Response, ObtainFile-Error, FileOpen-Request, + FileOpen-Response, FileRead-Request, FileRead-Response, FileClose-Request, + FileClose-Response, FileRename-Request, FileRename-Response, + FileRename-Error, FileDelete-Request, FileDelete-Response, + FileDirectory-Request, FileDirectory-Response, + DefineScatteredAccess-Request, DefineScatteredAccess-Response, + ScatteredAccessDescription, GetScatteredAccessAttributes-Request, + GetScatteredAccessAttributes-Response + FROM ISO-9506-MMS-1A {iso standard 9506 part(2) mms-annex-version1(3)} + AccessCondition, AdditionalCBBOptions, AdditionalSupportOptions, Address, + AlarmAckRule, Control-State, DomainState, EC-State, EC-Class, EE-Duration, + EE-Class, EventTime, Journal-Variable, LogicalStatus, Modifier, + normalPriority, normalSeverity, ParameterSupportOptions, PhysicalStatus, + Priority, ProgramInvocationState, Running-Mode, ServiceSupportOptions, + Severity, Transitions, TypeDescription, ULState, VMDState + FROM MMS-Object-Module-1 {iso standard 9506 part(1) + mms-object-model-version1(2)}; + +MMSpdu ::= CHOICE { + confirmed-RequestPDU [0] IMPLICIT Confirmed-RequestPDU, + confirmed-ResponsePDU [1] IMPLICIT Confirmed-ResponsePDU, + confirmed-ErrorPDU [2] IMPLICIT Confirmed-ErrorPDU, + unconfirmed-PDU [3] IMPLICIT Unconfirmed-PDU, + rejectPDU [4] IMPLICIT RejectPDU, + cancel-RequestPDU [5] IMPLICIT Cancel-RequestPDU, + cancel-ResponsePDU [6] IMPLICIT Cancel-ResponsePDU, + cancel-ErrorPDU [7] IMPLICIT Cancel-ErrorPDU, + initiate-RequestPDU [8] IMPLICIT Initiate-RequestPDU, + initiate-ResponsePDU [9] IMPLICIT Initiate-ResponsePDU, + initiate-ErrorPDU [10] IMPLICIT Initiate-ErrorPDU, + conclude-RequestPDU [11] IMPLICIT Conclude-RequestPDU, + conclude-ResponsePDU [12] IMPLICIT Conclude-ResponsePDU, + conclude-ErrorPDU [13] IMPLICIT Conclude-ErrorPDU} + +Confirmed-RequestPDU ::= SEQUENCE { + invokeID Unsigned32, + listOfModifiers SEQUENCE OF Modifier OPTIONAL, + service ConfirmedServiceRequest, + ..., + service-ext [79] Request-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL--} + +ConfirmedServiceRequest ::= CHOICE { + status [0] IMPLICIT Status-Request, + getNameList [1] IMPLICIT GetNameList-Request, + identify [2] IMPLICIT Identify-Request, + rename [3] IMPLICIT Rename-Request, + read [4] IMPLICIT Read-Request, + write [5] IMPLICIT Write-Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes-Request, + defineNamedVariable [7] IMPLICIT DefineNamedVariable-Request, + -- [8] is reserved for a service defined in Annex E + defineScatteredAcce [8] IMPLICIT DefineScatteredAccess-Request, + -- [9] is reserved for a service defined in Annex E + getScatteredAccessAttributes [9] GetScatteredAccessAttributes-Request, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess-Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Request, + getNamedVariableListAttributes [12] GetNamedVariableListAttributes-Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Request, + defineNamedType [14] IMPLICIT DefineNamedType-Request, + getNamedTypeAttributes [15] GetNamedTypeAttributes-Request, + deleteNamedType [16] IMPLICIT DeleteNamedType-Request, + input [17] IMPLICIT Input-Request, + output [18] IMPLICIT Output-Request, + takeControl [19] IMPLICIT TakeControl-Request, + relinquishControl [20] IMPLICIT RelinquishControl-Request, + defineSemaphore [21] IMPLICIT DefineSemaphore-Request, + deleteSemaphore [22] DeleteSemaphore-Request, + reportSemaphoreStatus [23] ReportSemaphoreStatus-Request, + reportPoolSemaphoreStatus + [24] IMPLICIT ReportPoolSemaphoreStatus-Request, + reportSemaphoreEntryStatus + [25] IMPLICIT ReportSemaphoreEntryStatus-Request, + initiateDownloadSequence + [26] IMPLICIT InitiateDownloadSequence-Request, + downloadSegment [27] IMPLICIT DownloadSegment-Request, + terminateDownloadSequence + [28] IMPLICIT TerminateDownloadSequence-Request, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence-Request, + uploadSegment [30] IMPLICIT UploadSegment-Request, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence-Request, + requestDomainDownload [32] IMPLICIT RequestDomainDownload-Request, + requestDomainUpload [33] IMPLICIT RequestDomainUpload-Request, + loadDomainContent [34] IMPLICIT LoadDomainContent-Request, + storeDomainContent [35] IMPLICIT StoreDomainContent-Request, + deleteDomain [36] IMPLICIT DeleteDomain-Request, + getDomainAttributes [37] IMPLICIT GetDomainAttributes-Request, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation-Request, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation-Request, + start [40] IMPLICIT Start-Request, + stop [41] IMPLICIT Stop-Request, + resume [42] IMPLICIT Resume-Request, + reset [43] IMPLICIT Reset-Request, + kill [44] IMPLICIT Kill-Request, + getProgramInvocationAttributes + [45] IMPLICIT GetProgramInvocationAttributes-Request, + obtainFile [46] IMPLICIT ObtainFile-Request, + defineEventCondition [47] IMPLICIT DefineEventCondition-Request, + deleteEventCondition [48] DeleteEventCondition-Request, + getEventConditionAttributes [49] GetEventConditionAttributes-Request, + reportEventConditionStatus [50] ReportEventConditionStatus-Request, + alterEventConditionMonitoring + [51] IMPLICIT AlterEventConditionMonitoring-Request, + triggerEvent [52] IMPLICIT TriggerEvent-Request, + defineEventAction [53] IMPLICIT DefineEventAction-Request, + deleteEventAction [54] DeleteEventAction-Request, + getEventActionAttributes [55] GetEventActionAttributes-Request, + reportEventActionStatus [56] ReportEventActionStatus-Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment-Request, + deleteEventEnrollment [58] DeleteEventEnrollment-Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment-Request, + reportEventEnrollmentStatus [60] ReportEventEnrollmentStatus-Request, + getEventEnrollmentAttributes + [61] IMPLICIT GetEventEnrollmentAttributes-Request, + acknowledgeEventNotification + [62] IMPLICIT AcknowledgeEventNotification-Request, + getAlarmSummary [63] IMPLICIT GetAlarmSummary-Request, + getAlarmEnrollmentSummary + [64] IMPLICIT GetAlarmEnrollmentSummary-Request, + readJournal [65] IMPLICIT ReadJournal-Request, + writeJournal [66] IMPLICIT WriteJournal-Request, + initializeJournal [67] IMPLICIT InitializeJournal-Request, + reportJournalStatus [68] ReportJournalStatus-Request, + createJournal [69] IMPLICIT CreateJournal-Request, + deleteJournal [70] IMPLICIT DeleteJournal-Request, + getCapabilityList [71] IMPLICIT GetCapabilityList-Request, + -- choices [72] through [77] are reserved for use by services + -- defined in annex D + fileOpen [72] IMPLICIT FileOpen-Request, + fileRead [73] IMPLICIT FileRead-Request, + fileClose [74] IMPLICIT FileClose-Request, + fileRename [75] IMPLICIT FileRename-Request, + fileDelete [76] IMPLICIT FileDelete-Request, + fileDirectory [77] IMPLICIT FileDirectory-Request, + ..., + additionalService [78] AdditionalService-Request, + -- choice [79] is reserved + getDataExchangeAttributes [80] GetDataExchangeAttributes-Request, + -- Shall not appear in minor version 1 + exchangeData [81] IMPLICIT ExchangeData-Request, + -- Shall not appear in minor version 1 + defineAccessControlList [82] IMPLICIT DefineAccessControlList-Request, + -- Shall not appear in minor version 1 or 2 + getAccessControlListAttributes [83] GetAccessControlListAttributes-Request, + -- Shall not appear in minor version 1 or 2 + reportAccessControlledObjects + [84] IMPLICIT ReportAccessControlledObjects-Request, + -- Shall not appear in minor version 1 or 2 + deleteAccessControlList [85] IMPLICIT DeleteAccessControlList-Request, + -- Shall not appear in minor version 1 or 2 + changeAccessControl [86] IMPLICIT ChangeAccessControl-Request, + -- Shall not appear in minor version 1 or 2 + ...} + +AdditionalService-Request ::= CHOICE { + vMDStop [0] IMPLICIT VMDStop-Request, + vMDReset [1] IMPLICIT VMDReset-Request, + select [2] IMPLICIT Select-Request, + alterPI [3] IMPLICIT AlterProgramInvocationAttributes-Request, + initiateUCLoad [4] IMPLICIT InitiateUnitControlLoad-Request, + uCLoad [5] IMPLICIT UnitControlLoadSegment-Request, + uCUpload [6] IMPLICIT UnitControlUpload-Request, + startUC [7] IMPLICIT StartUnitControl-Request, + stopUC [8] IMPLICIT StopUnitControl-Request, + createUC [9] IMPLICIT CreateUnitControl-Request, + addToUC [10] IMPLICIT AddToUnitControl-Request, + removeFromUC [11] IMPLICIT RemoveFromUnitControl-Request, + getUCAttributes [12] IMPLICIT GetUnitControlAttributes-Request, + loadUCFromFile [13] IMPLICIT LoadUnitControlFromFile-Request, + storeUCToFile [14] IMPLICIT StoreUnitControlToFile-Request, + deleteUC [15] IMPLICIT DeleteUnitControl-Request, + defineECL [16] DefineEventConditionList-Request, + deleteECL [17] DeleteEventConditionList-Request, + addECLReference [18] IMPLICIT AddEventConditionListReference-Request, + removeECLReference [19] IMPLICIT RemoveEventConditionListReference-Request, + getECLAttributes [20] GetEventConditionListAttributes-Request, + reportECLStatus [21] IMPLICIT ReportEventConditionListStatus-Request, + alterECLMonitoring [22] IMPLICIT AlterEventConditionListMonitoring-Request} + +Request-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceRequest does not match any of the tags below + otherRequests NULL, + createProgramInvocation + [38] IMPLICIT CS-CreateProgramInvocation-Request, + start [40] IMPLICIT CS-Start-Request, + resume [42] IMPLICIT CS-Resume-Request, + defineEventCondition [47] IMPLICIT CS-DefineEventCondition-Request, + alterEventConditionMonitoring + [51] IMPLICIT CS-AlterEventConditionMonitoring-Request, + defineEventEnrollment [57] IMPLICIT CS-DefineEventEnrollment-Request, + alterEventEnrollment [59] IMPLICIT CS-AlterEventEnrollment-Request} + +Unconfirmed-PDU ::= SEQUENCE { + service UnconfirmedService, + ..., + service-ext [79] Unconfirmed-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL--} + +UnconfirmedService ::= CHOICE { + informationReport [0] IMPLICIT InformationReport, + unsolicitedStatus [1] IMPLICIT UnsolicitedStatus, + eventNotification [2] IMPLICIT EventNotification} + +Unconfirmed-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- UnconfirmedService does not match any of the tags below + otherRequests NULL, + eventNotification [2] IMPLICIT CS-EventNotification} + +Confirmed-ResponsePDU ::= SEQUENCE { + invokeID Unsigned32, + service ConfirmedServiceResponse, + ..., + service-ext [79] Response-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL--} + +ConfirmedServiceResponse ::= CHOICE { + status [0] IMPLICIT Status-Response, + getNameList [1] IMPLICIT GetNameList-Response, + identify [2] IMPLICIT Identify-Response, + rename [3] IMPLICIT Rename-Response, + read [4] IMPLICIT Read-Response, + getVariableAccessAttributes + [6] IMPLICIT GetVariableAccessAttributes-Response, + defineNamedVariable [7] IMPLICIT DefineNamedVariable-Response, + -- choice [8] is reserved for a service defined in Annex E + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess-Response, + -- choice [9] is reserved for a service defined in Annex E + getScatteredAccessAttributes + [9] IMPLICIT GetScatteredAccessAttributes-Response, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess-Response, + defineNamedVariableList + [11] IMPLICIT DefineNamedVariableList-Response, + getNamedVariableListAttributes + [12] IMPLICIT GetNamedVariableListAttributes-Response, + deleteNamedVariableList + [13] IMPLICIT DeleteNamedVariableList-Response, + defineNamedType [14] IMPLICIT DefineNamedType-Response, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes-Response, + deleteNamedType [16] IMPLICIT DeleteNamedType-Response, + input [17] IMPLICIT Input-Response, + output [18] IMPLICIT Output-Response, + takeControl [19] TakeControl-Response, + relinquishControl [20] IMPLICIT RelinquishControl-Response, + defineSemaphore [21] IMPLICIT DefineSemaphore-Response, + deleteSemaphore [22] IMPLICIT DeleteSemaphore-Response, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus-Response, + reportPoolSemaphoreStatus + [24] IMPLICIT ReportPoolSemaphoreStatus-Response, + reportSemaphoreEntryStatus + [25] IMPLICIT ReportSemaphoreEntryStatus-Response, + initiateDownloadSequence + [26] IMPLICIT InitiateDownloadSequence-Response, + downloadSegment [27] IMPLICIT DownloadSegment-Response, + terminateDownloadSequence + [28] IMPLICIT TerminateDownloadSequence-Response, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence-Response, + uploadSegment [30] IMPLICIT UploadSegment-Response, + terminateUploadSequence + [31] IMPLICIT TerminateUploadSequence-Response, + requestDomainDownload [32] IMPLICIT RequestDomainDownload-Response, + requestDomainUpload [33] IMPLICIT RequestDomainUpload-Response, + loadDomainContent [34] IMPLICIT LoadDomainContent-Response, + storeDomainContent [35] IMPLICIT StoreDomainContent-Response, + deleteDomain [36] IMPLICIT DeleteDomain-Response, + getDomainAttributes [37] IMPLICIT GetDomainAttributes-Response, + createProgramInvocation + [38] IMPLICIT CreateProgramInvocation-Response, + deleteProgramInvocation + [39] IMPLICIT DeleteProgramInvocation-Response, + start [40] IMPLICIT Start-Response, + stop [41] IMPLICIT Stop-Response, + resume [42] IMPLICIT Resume-Response, + reset [43] IMPLICIT Reset-Response, + kill [44] IMPLICIT Kill-Response, + getProgramInvocationAttributes + [45] IMPLICIT GetProgramInvocationAttributes-Response, + obtainFile [46] IMPLICIT ObtainFile-Response, + defineEventCondition [47] IMPLICIT DefineEventCondition-Response, + deleteEventCondition [48] IMPLICIT DeleteEventCondition-Response, + getEventConditionAttributes + [49] IMPLICIT GetEventConditionAttributes-Response, + reportEventConditionStatus + [50] IMPLICIT ReportEventConditionStatus-Response, + alterEventConditionMonitoring + [51] IMPLICIT AlterEventConditionMonitoring-Response, + triggerEvent [52] IMPLICIT TriggerEvent-Response, + defineEventAction [53] IMPLICIT DefineEventAction-Response, + deleteEventAction [54] IMPLICIT DeleteEventAction-Response, + getEventActionAttributes + [55] IMPLICIT GetEventActionAttributes-Response, + reportEventActionStatus + [56] IMPLICIT ReportEventActionStatus-Response, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment-Response, + deleteEventEnrollment [58] IMPLICIT DeleteEventEnrollment-Response, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment-Response, + reportEventEnrollmentStatus + [60] IMPLICIT ReportEventEnrollmentStatus-Response, + getEventEnrollmentAttributes + [61] IMPLICIT GetEventEnrollmentAttributes-Response, + acknowledgeEventNotification + [62] IMPLICIT AcknowledgeEventNotification-Response, + getAlarmSummary [63] IMPLICIT GetAlarmSummary-Response, + getAlarmEnrollmentSummary + [64] IMPLICIT GetAlarmEnrollmentSummary-Response, + readJournal [65] IMPLICIT ReadJournal-Response, + writeJournal [66] IMPLICIT WriteJournal-Response, + initializeJournal [67] IMPLICIT InitializeJournal-Response, + reportJournalStatus [68] IMPLICIT ReportJournalStatus-Response, + createJournal [69] IMPLICIT CreateJournal-Response, + deleteJournal [70] IMPLICIT DeleteJournal-Response, + getCapabilityList [71] IMPLICIT GetCapabilityList-Response, + -- choices [72] through [77] are reserved for use by services + -- defined in annex D + fileOpen [72] IMPLICIT FileOpen-Response, + fileRead [73] IMPLICIT FileRead-Response, + fileClose [74] IMPLICIT FileClose-Response, + fileRename [75] IMPLICIT FileRename-Response, + fileDelete [76] IMPLICIT FileDelete-Response, + fileDirectory [77] IMPLICIT FileDirectory-Response, + ..., + additionalService [78] AdditionalService-Response, + -- choice [79] is reserved, + getDataExchangeAttributes [80] GetDataExchangeAttributes-Response, + -- Shall not appear in minor version 1, + exchangeData [81] IMPLICIT ExchangeData-Response, + -- Shall not appear in minor version 1, + defineAccessControlList + [82] IMPLICIT DefineAccessControlList-Response, + -- Shall not appear in minor version 1 or 2, + getAccessControlListAttributes + [83] IMPLICIT GetAccessControlListAttributes-Response, + -- Shall not appear in minor version 1 or 2, + reportAccessControlledObjects + [84] IMPLICIT ReportAccessControlledObjects-Response, + -- Shall not appear in minor version 1 or 2, + deleteAccessControlList + [85] IMPLICIT DeleteAccessControlList-Response, + -- Shall not appear in minor version 1 or 2, + changeAccessControl [86] IMPLICIT ChangeAccessControl-Response-- Shall not appear in minor version 1 or 2 + , + ...} + +AdditionalService-Response ::= CHOICE { + vMDStop [0] IMPLICIT VMDStop-Response, + vMDReset [1] IMPLICIT VMDReset-Response, + select [2] IMPLICIT Select-Response, + alterPI [3] IMPLICIT AlterProgramInvocationAttributes-Response, + initiateUCLoad [4] IMPLICIT InitiateUnitControlLoad-Response, + uCLoad [5] IMPLICIT UnitControlLoadSegment-Response, + uCUpload [6] IMPLICIT UnitControlUpload-Response, + startUC [7] IMPLICIT StartUnitControl-Response, + stopUC [8] IMPLICIT StopUnitControl-Response, + createUC [9] IMPLICIT CreateUnitControl-Response, + addToUC [10] IMPLICIT AddToUnitControl-Response, + removeFromUC [11] IMPLICIT RemoveFromUnitControl-Response, + getUCAttributes [12] IMPLICIT GetUnitControlAttributes-Response, + loadUCFromFile [13] IMPLICIT LoadUnitControlFromFile-Response, + storeUCToFile [14] IMPLICIT StoreUnitControlToFile-Response, + deleteUC [15] IMPLICIT DeleteUnitControl-Response, + defineECL [16] IMPLICIT DefineEventConditionList-Response, + deleteECL [17] IMPLICIT DeleteEventConditionList-Response, + addECLReference [18] IMPLICIT AddEventConditionListReference-Response, + removeECLReference [19] IMPLICIT RemoveEventConditionListReference-Response, + getECLAttributes [20] IMPLICIT GetEventConditionListAttributes-Response, + reportECLStatus [21] IMPLICIT ReportEventConditionListStatus-Response, + alterECLMonitoring [22] IMPLICIT AlterEventConditionListMonitoring-Response} + +Response-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceResponse does not match any of the tags below + otherRequests NULL, + status [0] CS-Status-Response, + getProgramInvocationAttributes + [45] IMPLICIT CS-GetProgramInvocationAttributes-Response, + getEventConditionAttributes + [49] IMPLICIT CS-GetEventConditionAttributes-Response} + +Confirmed-ErrorPDU ::= SEQUENCE { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError} + +ServiceError ::= SEQUENCE { + errorClass + [0] CHOICE {vmd-state + [0] IMPLICIT INTEGER {other(0), vmd-state-conflict(1), + vmd-operational-problem(2), + domain-transfer-problem(3), + state-machine-id-invalid(4)}(0..4), + application-reference + [1] IMPLICIT INTEGER {other(0), application-unreachable(1), + connection-lost(2), + application-reference-invalid(3), + context-unsupported(4)}(0..4), + definition + [2] IMPLICIT INTEGER {other(0), object-undefined(1), + invalid-address(2), + type-unsupported(3), + type-inconsistent(4), + object-exists(5), + object-attribute-inconsistent(6)} + (0..6), + resource + [3] IMPLICIT INTEGER {other(0), memory-unavailable(1), + processor-resource-unavailable(2), + mass-storage-unavailable(3), + capability-unavailable(4), + capability-unknown(5)}(0..5), + service + [4] IMPLICIT INTEGER {other(0), + primitives-out-of-sequence(1), + object-state-conflict(2), + -- Value 3 reserved for further definition + continuation-invalid(4), + object-constraint-conflict(5)}(0..5), + service-preempt + [5] IMPLICIT INTEGER {other(0), timeout(1), deadlock(2), + cancel(3)}(0..3), + time-resolution + [6] IMPLICIT INTEGER {other(0), + unsupportable-time-resolution(1)} + (0..1), + access + [7] IMPLICIT INTEGER {other(0), + object-access-unsupported(1), + object-non-existent(2), + object-access-denied(3), + object-invalidated(4)}(0..4), + initiate + [8] IMPLICIT INTEGER {other(0), + -- Values 1 and 2 are reserved for further definition + max-services-outstanding-calling-insufficient(3), + max-services-outstanding-called-insufficient(4), + service-CBB-insufficient(5), + parameter-CBB-insufficient(6), + nesting-level-insufficient(7)}(0..7), + conclude + [9] IMPLICIT INTEGER {other(0), + further-communication-required(1)} + (0..1), + cancel + [10] IMPLICIT INTEGER {other(0), invoke-id-unknown(1), + cancel-not-possible(2)}(0..2), + file + [11] IMPLICIT INTEGER {other(0), filename-ambiguous(1), + file-busy(2), + filename-syntax-error(3), + content-type-invalid(4), + position-invalid(5), + file-access-denied(6), + file-non-existent(7), + duplicate-filename(8), + insufficient-space-in-filestore(9)} + (0..9), + others [12] IMPLICIT INTEGER}, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInfo + [3] CHOICE {obtainFile [0] IMPLICIT ObtainFile-Error, + start [1] IMPLICIT Start-Error, + stop [2] IMPLICIT Stop-Error, + resume [3] IMPLICIT Resume-Error, + reset [4] IMPLICIT Reset-Error, + deleteVariableAccess + [5] IMPLICIT DeleteVariableAccess-Error, + deleteNamedVariableList + [6] IMPLICIT DeleteNamedVariableList-Error, + deleteNamedType + [7] IMPLICIT DeleteNamedType-Error, + defineEventEnrollment-Error [8] DefineEventEnrollment-Error, + -- [9] Reserved for use by annex D + fileRename [9] IMPLICIT FileRename-Error, + additionalService [10] AdditionalService-Error, + changeAccessControl + [11] IMPLICIT ChangeAccessControl-Error} OPTIONAL} + +AdditionalService-Error ::= CHOICE { + defineEcl [0] DefineEventConditionList-Error, + addECLReference [1] AddEventConditionListReference-Error, + removeECLReference [2] RemoveEventConditionListReference-Error, + initiateUC [3] InitiateUnitControl-Error, + startUC [4] IMPLICIT StartUnitControl-Error, + stopUC [5] IMPLICIT StopUnitControl-Error, + deleteUC [6] DeleteUnitControl-Error, + loadUCFromFile [7] LoadUnitControlFromFile-Error} + +TimeOfDay ::= OCTET STRING(SIZE (4 | 6)) + +-- maxIdentifier INTEGER ::= 32 +maxIdentifier INTEGER ::= + 64 -- modified by IEC61850 8.1 G3 + +Identifier ::= UTF8String(SIZE (1..maxIdentifier)) + +Integer8 ::= INTEGER(-128..127) -- range -128 <= i <= 127 + + +Integer16 ::= INTEGER(-32768..32767) -- range -32,768 <= i <= 32,767 + + +Integer32 ::= + INTEGER(-2147483648..2147483647) -- range -2**31 <= i <= 2**31 - 1 + + +Unsigned8 ::= INTEGER(0..127) -- range 0 <= i <= 127 + + +Unsigned16 ::= INTEGER(0..32767) -- range 0 <= i <= 32767 + + +Unsigned32 ::= INTEGER(0..2147483647) -- range 0 <= i <= 2**31 - 1 + + +ObjectName ::= CHOICE { + vmd-specific [0] IMPLICIT Identifier, + domain-specific + [1] IMPLICIT SEQUENCE {domainID Identifier, + itemID Identifier}, + aa-specific [2] IMPLICIT Identifier} + +ObjectClass ::= CHOICE { + basicObjectClass + [0] IMPLICIT INTEGER {namedVariable(0), + -- value 1 is reserved for definition in Annex E + scatteredAccess(1), namedVariableList(2), + namedType(3), semaphore(4), eventCondition(5), + eventAction(6), eventEnrollment(7), journal(8), + domain(9), programInvocation(10), + operatorStation(11), + dataExchange(12), + -- Shall not appear in minor version 1 + accessControlList(13) + -- Shall not appear in minor version 1 or 2--}(0..13), + ..., + csObjectClass + [1] IMPLICIT INTEGER {eventConditionList(0), unitControl(1)}(0..1)} + +MMSString ::= UTF8String + +MMS255String ::= UTF8String(SIZE (1..255)) + +UtcTime ::= OCTET STRING(SIZE (8)) + +FileName ::= SEQUENCE OF GraphicString + +Initiate-RequestPDU ::= SEQUENCE { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initRequestDetail + [4] IMPLICIT SEQUENCE {proposedVersionNumber + [0] IMPLICIT Integer16, + proposedParameterCBB + [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling + [2] IMPLICIT ServiceSupportOptions, + ..., + additionalSupportedCalling + [3] IMPLICIT AdditionalSupportOptions, + additionalCbbSupportedCalling + [4] IMPLICIT AdditionalCBBOptions, + privilegeClassIdentityCalling + [5] IMPLICIT VisibleString}} + +Initiate-ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initResponseDetail + [4] IMPLICIT SEQUENCE {negotiatedVersionNumber + [0] IMPLICIT Integer16, + negotiatedParameterCBB + [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled + [2] IMPLICIT ServiceSupportOptions, + ..., + additionalSupportedCalled + [3] IMPLICIT AdditionalSupportOptions, + additionalCbbSupportedCalled + [4] IMPLICIT AdditionalCBBOptions, + privilegeClassIdentityCalled + [5] IMPLICIT VisibleString}} + +Initiate-ErrorPDU ::= ServiceError + +Conclude-RequestPDU ::= NULL + +Conclude-ResponsePDU ::= NULL + +Conclude-ErrorPDU ::= ServiceError + +Cancel-RequestPDU ::= Unsigned32 -- originalInvokeID + +Cancel-ResponsePDU ::= Unsigned32 -- originalInvokeID + +Cancel-ErrorPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError} + +RejectPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason + CHOICE {confirmed-requestPDU + [1] IMPLICIT INTEGER {other(0), unrecognized-service(1), + unrecognized-modifier(2), + invalid-invokeID(3), invalid-argument(4), + invalid-modifier(5), + max-serv-outstanding-exceeded(6), + -- Value 7 reserved for further definition + max-recursion-exceeded(8), + value-out-of-range(9)}(0..9), + confirmed-responsePDU + [2] IMPLICIT INTEGER {other(0), unrecognized-service(1), + invalid-invokeID(2), + invalid-result(3), + -- Value 4 reserved for further definition + max-recursion-exceeded(5), + value-out-of-range(6)}(0..6), + confirmed-errorPDU + [3] IMPLICIT INTEGER {other(0), unrecognized-service(1), + invalid-invokeID(2), + invalid-serviceError(3), + value-out-of-range(4)}(0..4), + unconfirmedPDU + [4] IMPLICIT INTEGER {other(0), unrecognized-service(1), + invalid-argument(2), + max-recursion-exceeded(3), + value-out-of-range(4)}(0..4), + pdu-error + [5] IMPLICIT INTEGER {unknown-pdu-type(0), invalid-pdu(1), + illegal-acse-mapping(2)}, + cancel-requestPDU + [6] IMPLICIT INTEGER {other(0), invalid-invokeID(1)}(0..1), + cancel-responsePDU + [7] IMPLICIT INTEGER {other(0), invalid-invokeID(1)}(0..1), + cancel-errorPDU + [8] IMPLICIT INTEGER {other(0), invalid-invokeID(1), + invalid-serviceError(2), + value-out-of-range(3)}(0..3), + conclude-requestPDU + [9] IMPLICIT INTEGER {other(0), invalid-argument(1)}(0..1), + conclude-responsePDU + [10] IMPLICIT INTEGER {other(0), invalid-result(1)}(0..1), + conclude-errorPDU + [11] IMPLICIT INTEGER {other(0), invalid-serviceError(1), + value-out-of-range(2)}(0..2)}} + +DefineAccessControlList-Request ::= SEQUENCE { + accessControlListName [0] IMPLICIT Identifier, + accessControlListElements + [1] IMPLICIT SEQUENCE {readAccessCondition + [0] AccessCondition OPTIONAL, + storeAccessCondition + [1] AccessCondition OPTIONAL, + writeAccessCondition + [2] AccessCondition OPTIONAL, + loadAccessCondition + [3] AccessCondition OPTIONAL, + executeAccessCondition + [4] AccessCondition OPTIONAL, + deleteAccessCondition + [5] AccessCondition OPTIONAL, + editAccessCondition + [6] AccessCondition OPTIONAL}} + +DefineAccessControlList-Response ::= NULL + +GetAccessControlListAttributes-Request ::= CHOICE { + accessControlListName [0] IMPLICIT Identifier, + vMD [1] IMPLICIT NULL, + namedObject + [2] IMPLICIT SEQUENCE {objectClass [0] ObjectClass, + objectName [1] ObjectName}} + +GetAccessControlListAttributes-Response ::= SEQUENCE { + name [0] Identifier, + accessControlListElements + [1] IMPLICIT SEQUENCE {readAccessCondition + [0] AccessCondition OPTIONAL, + storeAccessCondition + [1] AccessCondition OPTIONAL, + writeAccessCondition + [2] AccessCondition OPTIONAL, + loadAccessCondition + [3] AccessCondition OPTIONAL, + executeAccessCondition + [4] AccessCondition OPTIONAL, + deleteAccessCondition + [5] AccessCondition OPTIONAL, + editAccessCondition + [6] AccessCondition OPTIONAL}, + vMDuse [2] IMPLICIT BOOLEAN, + references + [3] IMPLICIT SEQUENCE OF + SEQUENCE {objectClass [0] ObjectClass, + objectCount [1] IMPLICIT INTEGER}, + accessControlList [4] IMPLICIT Identifier OPTIONAL + -- shall be included if and only if + -- aco has been negotiated--} + +ReportAccessControlledObjects-Request ::= SEQUENCE { + accessControlList [0] IMPLICIT Identifier, + objectClass [1] ObjectClass, + continueAfter [2] ObjectName OPTIONAL} + +ReportAccessControlledObjects-Response ::= SEQUENCE { + listOfNames [0] IMPLICIT SEQUENCE OF ObjectName, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +DeleteAccessControlList-Request ::= Identifier + +-- Name of Access Control List Object +DeleteAccessControlList-Response ::= NULL + +ChangeAccessControl-Request ::= SEQUENCE { + scopeOfChange + CHOICE {vMDOnly [0] IMPLICIT NULL, + listOfObjects + [1] IMPLICIT SEQUENCE {objectClass [0] ObjectClass, + objectScope + [1] CHOICE {specific + [0] IMPLICIT SEQUENCE OF + ObjectName, + -- Names of the objects (of class objectClass) + -- whose access is to be changed + aa-specific + [1] IMPLICIT NULL, + domain + [2] IMPLICIT Identifier, + -- Name of the Domain whose elements + -- are to be changed + vmd + [3] IMPLICIT NULL}}}, + accessControlListName [2] IMPLICIT Identifier + -- name of the AccessControlList Object that contains + -- the conditions for access control--} + +ChangeAccessControl-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberChanged [1] IMPLICIT Unsigned32} + +ChangeAccessControl-Error ::= Unsigned32 + +StatusResponse ::= SEQUENCE { + vmdLogicalStatus + [0] IMPLICIT INTEGER {state-changes-allowed(0), + no-state-changes-allowed(1), + limited-services-permitted(2), + support-services-allowed(3)}(0..3), + vmdPhysicalStatus + [1] IMPLICIT INTEGER {operational(0), partially-operational(1), + inoperable(2), needs-commissioning(3)}(0..3), + localDetail [2] IMPLICIT BIT STRING(SIZE (0..128)) OPTIONAL} + +CS-Status-Response ::= CHOICE { + fullResponse + SEQUENCE {operationState [0] IMPLICIT OperationState, + extendedStatus [1] IMPLICIT ExtendedStatus, + extendedStatusMask + [2] IMPLICIT ExtendedStatus DEFAULT '1111'B, + selectedProgramInvocation + CHOICE {programInvocation [3] IMPLICIT Identifier, + noneSelected [4] IMPLICIT NULL}}, + noExtraResponse NULL} + +OperationState ::= INTEGER { + idle(0), loaded(1), ready(2), executing(3), motion-paused(4), + manualInterventionRequired(5)}(0..5) + +ExtendedStatus ::= BIT STRING { + safetyInterlocksViolated(0), anyPhysicalResourcePowerOn(1), + allPhysicalResourcesCalibrated(2), localControl(3)}(SIZE (4)) + +Status-Request ::= BOOLEAN -- Extended Derivation + +Status-Response ::= StatusResponse + +UnsolicitedStatus ::= StatusResponse + +GetNameList-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + objectScope + [1] CHOICE {vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL}, + continueAfter [2] IMPLICIT Identifier OPTIONAL} + +GetNameList-Response ::= SEQUENCE { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +Identify-Request ::= NULL + +Identify-Response ::= SEQUENCE { + vendorName [0] IMPLICIT MMSString, + modelName [1] IMPLICIT MMSString, + revision [2] IMPLICIT MMSString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL} + +Rename-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier} + +Rename-Response ::= NULL + +GetCapabilityList-Request ::= SEQUENCE {continueAfter MMSString OPTIONAL} + +GetCapabilityList-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF MMSString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +VMDStop-Request ::= NULL + +VMDStop-Response ::= NULL + +VMDReset-Request ::= BOOLEAN -- Extended Derivation + +VMDReset-Response ::= StatusResponse + +InitiateDownloadSequence-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString, + sharable [2] IMPLICIT BOOLEAN} + +InitiateDownloadSequence-Response ::= NULL + +DownloadSegment-Request ::= Identifier -- Domain Name + +DownloadSegment-Response ::= SEQUENCE { + loadData LoadData, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +LoadData ::= CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL, + embedded EMBEDDED PDV} + +TerminateDownloadSequence-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL} + +TerminateDownloadSequence-Response ::= NULL + +InitiateUploadSequence-Request ::= Identifier -- Domain Name + +InitiateUploadSequence-Response ::= SEQUENCE { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString} + +UploadSegment-Request ::= Integer32 -- ULSM ID + +UploadSegment-Response ::= SEQUENCE { + loadData LoadData, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +TerminateUploadSequence-Request ::= Integer32 -- ULSM ID + +TerminateUploadSequence-Response ::= NULL + +RequestDomainDownload-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName} + +RequestDomainDownload-Response ::= NULL + +RequestDomainUpload-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName} + +RequestDomainUpload-Response ::= NULL + +LoadDomainContent-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName, + thirdParty [5] IMPLICIT ApplicationReference OPTIONAL} + +LoadDomainContent-Response ::= NULL + +StoreDomainContent-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL} + +StoreDomainContent-Response ::= NULL + +DeleteDomain-Request ::= Identifier -- Domain Name + +DeleteDomain-Response ::= NULL + +GetDomainAttributes-Request ::= Identifier -- Domain Name + +GetDomainAttributes-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF MMSString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, + -- Program Invocation Names + uploadInProgress [5] IMPLICIT Integer8, + accessControlList [6] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +CreateProgramInvocation-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring, + -- FALSE indicates CURRENT monitoring--} + +CreateProgramInvocation-Response ::= NULL + +CS-CreateProgramInvocation-Request ::= INTEGER { + normal(0), controlling(1), controlled(2)}(0..2) + +DeleteProgramInvocation-Request ::= Identifier -- Program Invocation Name + +DeleteProgramInvocation-Response ::= NULL + +Start-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument + CHOICE {simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + embeddedString EMBEDDED PDV} OPTIONAL} + +Start-Response ::= NULL + +Start-Error ::= ProgramInvocationState + +CS-Start-Request ::= [0] CHOICE { + normal NULL, + controlling + SEQUENCE {startLocation [0] IMPLICIT VisibleString OPTIONAL, + startCount [1] StartCount DEFAULT cycleCount:1}} + +StartCount ::= CHOICE { + noLimit [0] IMPLICIT NULL, + cycleCount [1] IMPLICIT INTEGER, + stepCount [2] IMPLICIT INTEGER} + +Stop-Request ::= SEQUENCE {programInvocationName [0] IMPLICIT Identifier} + +Stop-Response ::= NULL + +Stop-Error ::= ProgramInvocationState + +Resume-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument + CHOICE {simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV} OPTIONAL} + +Resume-Response ::= NULL + +Resume-Error ::= ProgramInvocationState + +CS-Resume-Request ::= [0] CHOICE { + normal NULL, + controlling + SEQUENCE {modeType + CHOICE {continueMode [0] IMPLICIT NULL, + changeMode [1] StartCount}}} + +Reset-Request ::= SEQUENCE {programInvocationName [0] IMPLICIT Identifier} + +Reset-Response ::= NULL + +Reset-Error ::= ProgramInvocationState + +Kill-Request ::= SEQUENCE {programInvocationName [0] IMPLICIT Identifier} + +Kill-Response ::= NULL + +GetProgramInvocationAttributes-Request ::= + Identifier -- Program Invocation Name + +GetProgramInvocationAttributes-Response ::= SEQUENCE { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + executionArgument + CHOICE {simpleString [5] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV}, + accessControlList [6] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +CS-GetProgramInvocationAttributes-Response ::= SEQUENCE { + errorCode [0] IMPLICIT INTEGER, + control + [1] CHOICE {controlling + [0] IMPLICIT SEQUENCE {controlledPI + [0] IMPLICIT SEQUENCE OF Identifier, + programLocation + [1] IMPLICIT VisibleString OPTIONAL, + runningMode + [2] CHOICE {freeRunning + [0] IMPLICIT NULL, + cycleLimited + [1] IMPLICIT INTEGER, + stepLimited + [2] IMPLICIT INTEGER}}, + controlled + [1] CHOICE {controllingPI [0] IMPLICIT Identifier, + none [1] IMPLICIT NULL}, + normal [2] IMPLICIT NULL}} + +Select-Request ::= SEQUENCE { + controlling [0] IMPLICIT Identifier OPTIONAL, + controlled [1] IMPLICIT SEQUENCE OF Identifier OPTIONAL + -- this field shall appear if and only if the controlling field is included--} + +Select-Response ::= NULL + +AlterProgramInvocationAttributes-Request ::= SEQUENCE { + programInvocation [0] IMPLICIT Identifier, + startCount [1] StartCount DEFAULT cycleCount:1} + +AlterProgramInvocationAttributes-Response ::= NULL + +ReconfigureProgramInvocation-Request ::= SEQUENCE { + oldProgramInvocationName [0] IMPLICIT Identifier, + newProgramInvocationName [1] IMPLICIT Identifier OPTIONAL, + domainsToAdd [2] IMPLICIT SEQUENCE OF Identifier, + domainsToRemove [3] IMPLICIT SEQUENCE OF Identifier} + +ReconfigureProgramInvocation-Response ::= NULL + +ControlElement ::= CHOICE { + beginDomainDef + [0] SEQUENCE {domainName [1] IMPLICIT Identifier, + capabilities [2] IMPLICIT SEQUENCE OF MMSString, + sharable [3] IMPLICIT BOOLEAN, + loadData [4] LoadData OPTIONAL}, + continueDomainDef + [1] SEQUENCE {domainName [1] IMPLICIT Identifier, + loadData [3] LoadData}, + endDomainDef [2] IMPLICIT Identifier, + piDefinition + [3] IMPLICIT SEQUENCE {piName [0] IMPLICIT Identifier, + listOfDomains [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL, + pIState + [4] IMPLICIT ProgramInvocationState OPTIONAL}} + +InitiateUnitControlLoad-Request ::= Identifier -- Unit Control Name + +InitiateUnitControlLoad-Response ::= NULL + +InitiateUnitControl-Error ::= CHOICE { + domain [0] IMPLICIT Identifier, + programInvocation [1] IMPLICIT Identifier} + +UnitControlLoadSegment-Request ::= Identifier -- Unit Control Name + +UnitControlLoadSegment-Response ::= SEQUENCE { + controlElements [0] IMPLICIT SEQUENCE OF ControlElement, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +UnitControlUpload-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, -- Unit Control Name + continueAfter + CHOICE {domain [1] IMPLICIT Identifier, + ulsmID [2] IMPLICIT INTEGER, + programInvocation [3] IMPLICIT Identifier} OPTIONAL} + +UnitControlUpload-Response ::= SEQUENCE { + controlElements [0] IMPLICIT SEQUENCE OF ControlElement, + nextElement + CHOICE {domain [1] IMPLICIT Identifier, + ulsmID [2] IMPLICIT INTEGER, + programInvocation [3] IMPLICIT Identifier} OPTIONAL} + +StartUnitControl-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, -- Unit Control Name + executionArgument + CHOICE {simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV} OPTIONAL} + +StartUnitControl-Response ::= NULL + +StartUnitControl-Error ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + programInvocationState [1] IMPLICIT ProgramInvocationState} + +StopUnitControl-Request ::= Identifier -- Unit Control Name + +StopUnitControl-Response ::= NULL + +StopUnitControl-Error ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + programInvocationState [1] IMPLICIT ProgramInvocationState} + +CreateUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier} + +CreateUnitControl-Response ::= NULL + +AddToUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier} + +AddToUnitControl-Response ::= NULL + +RemoveFromUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier} + +RemoveFromUnitControl-Response ::= NULL + +GetUnitControlAttributes-Request ::= Identifier -- Unit Control Name + +GetUnitControlAttributes-Response ::= SEQUENCE { + domains [0] IMPLICIT SEQUENCE OF Identifier, + programInvocations [1] IMPLICIT SEQUENCE OF Identifier} + +LoadUnitControlFromFile-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL} + +LoadUnitControlFromFile-Response ::= NULL + +LoadUnitControlFromFile-Error ::= CHOICE { + none [0] IMPLICIT NULL, + domain [1] IMPLICIT Identifier, + programInvocation [2] IMPLICIT Identifier} + +StoreUnitControlToFile-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL} + +StoreUnitControlToFile-Response ::= NULL + +DeleteUnitControl-Request ::= Identifier -- Unit Control Name + +DeleteUnitControl-Response ::= NULL + +DeleteUnitControl-Error ::= CHOICE { + domain [0] IMPLICIT Identifier, + programInvocation [1] IMPLICIT Identifier} + +TypeSpecification ::= CHOICE { + typeName [0] ObjectName, + typeDescription TypeDescription} + +AlternateAccess ::= + SEQUENCE OF + CHOICE {unnamed AlternateAccessSelection, + named + [5] IMPLICIT SEQUENCE {componentName [0] IMPLICIT Identifier, + access AlternateAccessSelection}} + +AlternateAccessSelection ::= CHOICE { + selectAlternateAccess + [0] IMPLICIT SEQUENCE {accessSelection + CHOICE {component [0] IMPLICIT Identifier, + index [1] IMPLICIT Unsigned32, + indexRange + [2] IMPLICIT SEQUENCE {lowIndex + [0] IMPLICIT Unsigned32, + numberOfElements + [1] IMPLICIT Unsigned32}, + allElements [3] IMPLICIT NULL}, + alternateAccess AlternateAccess}, + selectAccess + CHOICE {component [1] IMPLICIT Identifier, + index [2] IMPLICIT Unsigned32, + indexRange + [3] IMPLICIT SEQUENCE {lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32}, + allElements [4] IMPLICIT NULL}} + +AccessResult ::= CHOICE {failure [0] IMPLICIT DataAccessError, + success Data} + +Data ::= CHOICE { + -- context tag [0] is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, -- shall not be negative + floating-point [7] IMPLICIT FloatingPoint, + -- [8] is reserved + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + generalized-time [11] IMPLICIT GeneralizedTime, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, -- shall not be negative + booleanArray [14] IMPLICIT BIT STRING, + objId [15] IMPLICIT OBJECT IDENTIFIER, + ..., + mMSString [16] IMPLICIT MMSString, + utc-time [17] IMPLICIT UtcTime -- added by IEC61850 8.1 G3--} + +FloatingPoint ::= OCTET STRING + +DataAccessError ::= INTEGER { + object-invalidated(0), hardware-fault(1), temporarily-unavailable(2), + object-access-denied(3), object-undefined(4), invalid-address(5), + type-unsupported(6), type-inconsistent(7), object-attribute-inconsistent(8), + object-access-unsupported(9), object-non-existent(10), + object-value-invalid(11)}(0..11) + +VariableAccessSpecification ::= CHOICE { + listOfVariable + [0] IMPLICIT SEQUENCE OF + SEQUENCE {variableSpecification VariableSpecification, + alternateAccess + [5] IMPLICIT AlternateAccess OPTIONAL}, + variableListName [1] ObjectName} + +VariableSpecification ::= CHOICE { + name [0] ObjectName, + address [1] Address, + variableDescription + [2] IMPLICIT SEQUENCE {address Address, + typeSpecification TypeSpecification}, + -- the following element is only present to support the services + -- defined in annex E + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, + invalidated [4] IMPLICIT NULL} + +Read-Request ::= SEQUENCE { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification} + +Read-Response ::= SEQUENCE { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult} + +Write-Request ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data} + +Write-Response ::= + SEQUENCE OF + CHOICE {failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL} + +InformationReport ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult} + +GetVariableAccessAttributes-Request ::= CHOICE { + name [0] ObjectName, + address [1] Address} + +GetVariableAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeDescription [2] TypeDescription, + accessControlList [3] IMPLICIT Identifier OPTIONAL, + -- Shall not appear in minor version one or two + meaning [4] IMPLICIT VisibleString OPTIONAL} + +DefineNamedVariable-Request ::= SEQUENCE { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL} + +DefineNamedVariable-Response ::= NULL + +DeleteVariableAccess-Request ::= SEQUENCE { + scopeOfDelete + [0] IMPLICIT INTEGER {specific(0), aa-specific(1), domain(2), vmd(3)}(0..3) + DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL} + +DeleteVariableAccess-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32} + +DeleteVariableAccess-Error ::= Unsigned32 -- numberDeleted + +DefineNamedVariableList-Request ::= SEQUENCE { + variableListName ObjectName, + listOfVariable + [0] IMPLICIT SEQUENCE OF + SEQUENCE {variableSpecification VariableSpecification, + alternateAccess + [5] IMPLICIT AlternateAccess OPTIONAL}} + +DefineNamedVariableList-Response ::= NULL + +GetNamedVariableListAttributes-Request ::= ObjectName -- VariableListName + +GetNamedVariableListAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable + [1] IMPLICIT SEQUENCE OF + SEQUENCE {variableSpecification VariableSpecification, + alternateAccess + [5] IMPLICIT AlternateAccess OPTIONAL}, + accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +DeleteNamedVariableList-Request ::= SEQUENCE { + scopeOfDelete + [0] IMPLICIT INTEGER {specific(0), aa-specific(1), domain(2), vmd(3)}(0..3) + DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL} + +DeleteNamedVariableList-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32} + +DeleteNamedVariableList-Error ::= Unsigned32 -- numberDeleted + +DefineNamedType-Request ::= SEQUENCE { + typeName ObjectName, + typeSpecification TypeSpecification} + +DefineNamedType-Response ::= NULL + +GetNamedTypeAttributes-Request ::= ObjectName --TypeName + +GetNamedTypeAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification, + accessControlList [1] IMPLICIT Identifier OPTIONAL, + -- Shall not appear in minor version one or two + meaning [4] IMPLICIT VisibleString OPTIONAL} + +DeleteNamedType-Request ::= SEQUENCE { + scopeOfDelete + [0] IMPLICIT INTEGER {specific(0), aa-specific(1), domain(2), vmd(3)}(0..3) + DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL} + +DeleteNamedType-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32} + +DeleteNamedType-Error ::= Unsigned32 -- numberDeleted + +ExchangeData-Request ::= SEQUENCE { + dataExchangeName [0] ObjectName, + listOfRequestData [1] IMPLICIT SEQUENCE OF Data} + +ExchangeData-Response ::= SEQUENCE { + listOfResponseData [0] IMPLICIT SEQUENCE OF Data} + +GetDataExchangeAttributes-Request ::= ObjectName + +GetDataExchangeAttributes-Response ::= SEQUENCE { + inUse [0] IMPLICIT BOOLEAN, + listOfRequestTypeDescriptions [1] IMPLICIT SEQUENCE OF TypeDescription, + listOfResponseTypeDescriptions [2] IMPLICIT SEQUENCE OF TypeDescription, + programInvocation [3] IMPLICIT Identifier OPTIONAL, + accessControlList [4] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +TakeControl-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE, + applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL} + +TakeControl-Response ::= CHOICE { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier} + +RelinquishControl-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL} + +RelinquishControl-Response ::= NULL + +DefineSemaphore-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + numberOfTokens [1] IMPLICIT Unsigned16} + +DefineSemaphore-Response ::= NULL + +DeleteSemaphore-Request ::= ObjectName -- Semaphore Name + +DeleteSemaphore-Response ::= NULL + +ReportSemaphoreStatus-Request ::= ObjectName -- Semaphore Name + +ReportSemaphoreStatus-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER {token(0), pool(1)}(0..1), + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16, + accessControlList [5] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +ReportPoolSemaphoreStatus-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL} + +ReportPoolSemaphoreStatus-Response ::= SEQUENCE { + listOfNamedTokens + [0] IMPLICIT SEQUENCE OF + CHOICE {freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier}, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +ReportSemaphoreEntryStatus-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + state + [1] IMPLICIT INTEGER {queued(0), owner(1), hung(2)}(0..2), + entryIDToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL} + +ReportSemaphoreEntryStatus-Response ::= SEQUENCE { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +SemaphoreEntry ::= SEQUENCE { + entryID [0] IMPLICIT OCTET STRING, + entryClass + [1] IMPLICIT INTEGER {simple(0), modifier(1)}(0..1), + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT normalPriority, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE} + +AttachToSemaphore ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE} + +Input-Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, + listOfPromptData [2] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL} + +Input-Response ::= MMSString -- Input String + +Output-Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF MMSString} + +Output-Response ::= NULL + +TriggerEvent-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL} + +TriggerEvent-Response ::= NULL + +EventNotification ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + severity [2] IMPLICIT Severity, + currentState [3] IMPLICIT EC-State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult + [8] IMPLICIT SEQUENCE {eventActionName ObjectName, + successOrFailure + CHOICE {success + [0] IMPLICIT SEQUENCE {confirmedServiceResponse + + ConfirmedServiceResponse, + cs-Response-Detail + + [79] Response-Detail + OPTIONAL + -- shall not be transmitted if value is the + -- value of a tagged type derived from NULL--}, + failure + [1] IMPLICIT SEQUENCE {modifierPosition + [0] IMPLICIT Unsigned32 + OPTIONAL, + serviceError + [1] IMPLICIT ServiceError}}} + OPTIONAL} + +CS-EventNotification ::= [0] CHOICE { + string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + +AcknowledgeEventNotification-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC-State, + timeOfAcknowledgedTransition [3] EventTime} + +AcknowledgeEventNotification-Response ::= NULL + +GetAlarmSummary-Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgementFilter + [2] IMPLICIT INTEGER {not-acked(0), acked(1), all(2)}(0..2) + DEFAULT not-acked, + severityFilter + [3] IMPLICIT SEQUENCE {mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8} + DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL} + +GetAlarmSummary-Response ::= SEQUENCE { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +AlarmSummary ::= SEQUENCE { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC-State, + unacknowledgedState + [3] IMPLICIT INTEGER {none(0), active(1), idle(2), both(3)}(0..3), + displayEnhancement [4] EN-Additional-Detail OPTIONAL, + -- shall not be transmitted if the value is NULL + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL} + +EN-Additional-Detail ::= [0] CHOICE { + string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + +GetAlarmEnrollmentSummary-Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgementFilter + [2] IMPLICIT INTEGER {not-acked(0), acked(1), all(2)}(0..2) + DEFAULT not-acked, + severityFilter + [3] IMPLICIT SEQUENCE {mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8} + DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL} + +GetAlarmEnrollmentSummary-Response ::= SEQUENCE { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +AlarmEnrollmentSummary ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + clientApplication [2] ApplicationReference OPTIONAL, + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC-State, + displayEnhancement [5] EN-Additional-Detail OPTIONAL, + -- shall not be transmitted if the value is NULL + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule, + enrollmentState [8] IMPLICIT EE-State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL} + +AttachToEventCondition ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL} + +DefineEventCondition-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC-Class, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + severity [3] IMPLICIT Unsigned8 DEFAULT normalSeverity, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL} + +DefineEventCondition-Response ::= NULL + +CS-DefineEventCondition-Request ::= [0] CHOICE { + string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + +DeleteEventCondition-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL} + +DeleteEventCondition-Response ::= Unsigned32 --Candidates Not Deleted + +GetEventConditionAttributes-Request ::= ObjectName --Event Condition Name + +GetEventConditionAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC-Class, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + severity [3] IMPLICIT Unsigned8 DEFAULT normalSeverity, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable + [6] CHOICE {variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL} OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL, + accessControlList [8] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +CS-GetEventConditionAttributes-Response ::= SEQUENCE { + groupPriorityOverride + [0] CHOICE {priority [0] IMPLICIT Priority, + undefined [1] IMPLICIT NULL} OPTIONAL, + listOfReferencingECL [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + displayEnhancement + [2] CHOICE {string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement [2] IMPLICIT NULL}} + +ReportEventConditionStatus-Request ::= ObjectName --Event Condition Name + +ReportEventConditionStatus-Response ::= SEQUENCE { + currentState [0] IMPLICIT EC-State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL} + +AlterEventConditionMonitoring-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL, + evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL + -- At least one of enabled, priority, alarmSummaryReports, or + -- evaluationInterval shall be present.--} + +AlterEventConditionMonitoring-Response ::= NULL + +CS-AlterEventConditionMonitoring-Request ::= SEQUENCE { + changeDisplay + CHOICE {string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement [2] NULL} OPTIONAL} + +DefineEventAction-Request ::= SEQUENCE { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL, + confirmedServiceRequest [2] ConfirmedServiceRequest, + cs-extension [79] Request-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL--} + +DefineEventAction-Response ::= NULL + +DeleteEventAction-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL} + +DeleteEventAction-Response ::= Unsigned32 --Candidates Not Deleted + +GetEventActionAttributes-Request ::= ObjectName --EventActionName + +GetEventActionAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier, + confirmedServiceRequest [2] ConfirmedServiceRequest, + cs-extension [79] Request-Detail OPTIONAL, + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL + accessControlList [3] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +ReportEventActionStatus-Request ::= ObjectName -- Event Action Name + +ReportEventActionStatus-Response ::= Unsigned32 -- Number of Event Enrollments + +DefineEventEnrollment-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransitions [2] IMPLICIT Transitions, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL, + clientApplication [5] ApplicationReference OPTIONAL} + +DefineEventEnrollment-Response ::= NULL + +DefineEventEnrollment-Error ::= ObjectName + +CS-DefineEventEnrollment-Request ::= [0] CHOICE { + string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + +DeleteEventEnrollment-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName} + +DeleteEventEnrollment-Response ::= Unsigned32 --Candidates Not Deleted + +GetEventEnrollmentAttributes-Request ::= SEQUENCE { + scopeOfRequest + [0] IMPLICIT INTEGER {specific(0), client(1), ec(2), ea(3)}(0..3) + DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + clientApplication [2] ApplicationReference OPTIONAL, + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL} + +GetEventEnrollmentAttributes-Response ::= SEQUENCE { + listOfEEAttributes [0] IMPLICIT SEQUENCE OF EEAttributes, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +EEAttributes ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName + [1] CHOICE {eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL}, + eventActionName + [2] CHOICE {eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL} OPTIONAL, + clientApplication [3] ApplicationReference OPTIONAL, + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE-Class, + duration [6] IMPLICIT EE-Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32 OPTIONAL, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL, + displayEnhancement + [9] CHOICE {string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement NULL} + -- shall not be transmitted if the value is NULL--} + +ReportEventEnrollmentStatus-Request ::= ObjectName --Event Enrollment Name + +ReportEventEnrollmentStatus-Response ::= SEQUENCE { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE-Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE-State} + +AlterEventEnrollment-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL} + +AlterEventEnrollment-Response ::= SEQUENCE { + currentState + [0] CHOICE {state [0] IMPLICIT EE-State, + undefined [1] IMPLICIT NULL}, + transitionTime [1] EventTime} + +CS-AlterEventEnrollment-Request ::= SEQUENCE { + changeDisplay + CHOICE {string [0] IMPLICIT VisibleString, + index [1] IMPLICIT INTEGER, + noEnhancement [2] NULL} OPTIONAL} + +EE-State ::= INTEGER { + disabled(0), idle(1), active(2), activeNoAckA(3), idleNoAckI(4), + idleNoAckA(5), idleAcked(6), activeAcked(7), undefined(8)} + +DefineEventConditionList-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName, + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated.--} + +DefineEventConditionList-Response ::= NULL + +DefineEventConditionList-Error ::= ObjectName + +DeleteEventConditionList-Request ::= ObjectName -- EventConditionListName + +DeleteEventConditionList-Response ::= NULL + +AddEventConditionListReference-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName, + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated.--} + +AddEventConditionListReference-Response ::= NULL + +AddEventConditionListReference-Error ::= ObjectName + +RemoveEventConditionListReference-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName, + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName + -- shall appear if an only if recl has been negotiated. --} + +RemoveEventConditionListReference-Response ::= NULL + +RemoveEventConditionListReference-Error ::= CHOICE { + eventCondition [0] ObjectName, + eventConditionList [1] ObjectName} + +GetEventConditionListAttributes-Request ::= + ObjectName -- eventConditionListName + +GetEventConditionListAttributes-Response ::= SEQUENCE { + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName, + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated.--} + +ReportEventConditionListStatus-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, -- Event Condition List Name + continueAfter [1] IMPLICIT Identifier OPTIONAL} + +ReportEventConditionListStatus-Response ::= SEQUENCE { + listOfEventConditionStatus [1] IMPLICIT SEQUENCE OF EventConditionStatus, + moreFollows [2] IMPLICIT BOOLEAN DEFAULT TRUE} + +EventConditionStatus ::= SEQUENCE { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State, + numberOfEventEnrollments [2] IMPLICIT Unsigned32, + enabled [3] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [4] EventTime OPTIONAL, + timeOfLastTransitionToIdle [5] EventTime OPTIONAL} + +AlterEventConditionListMonitoring-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN, + priorityChange + [2] CHOICE {priorityValue [0] IMPLICIT INTEGER, + priorityReset [1] IMPLICIT NULL} OPTIONAL} + +AlterEventConditionListMonitoring-Response ::= NULL + +ReadJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + rangeStartSpecification + [1] CHOICE {startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING} OPTIONAL, + rangeStopSpecification + [2] CHOICE {endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32} OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter + [5] IMPLICIT SEQUENCE {timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING} + OPTIONAL} + +ReadJournal-Response ::= SEQUENCE { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +JournalEntry ::= SEQUENCE { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent} + +WriteJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent} + +WriteJournal-Response ::= NULL + +InitializeJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + limitSpecification + [1] IMPLICIT SEQUENCE {limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL} + OPTIONAL} + +InitializeJournal-Response ::= Unsigned32 -- Entries Deleted + +ReportJournalStatus-Request ::= ObjectName --Journal Name + +ReportJournalStatus-Response ::= SEQUENCE { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN, + accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +CreateJournal-Request ::= SEQUENCE {journalName [0] ObjectName} + +CreateJournal-Response ::= NULL + +DeleteJournal-Request ::= SEQUENCE {journalName [0] ObjectName} + +DeleteJournal-Response ::= NULL + +EntryContent ::= SEQUENCE { + occurrenceTime [0] IMPLICIT TimeOfDay, + entryForm + CHOICE {data + [2] IMPLICIT SEQUENCE {event + [0] IMPLICIT SEQUENCE {eventConditionName + [0] ObjectName, + currentState + + [1] IMPLICIT EC-State} + OPTIONAL, + listOfVariables + [1] IMPLICIT SEQUENCE OF + Journal-Variable OPTIONAL}, + annotation [3] MMSString}} + +END + + + +MMS-Environment-1 {iso standard 9506 part(2) mms-environment-version1(4)} +DEFINITIONS ::= +BEGIN + +EXPORTS ApplicationReference, Authentication-value; + +IMPORTS + AP-title, AP-invocation-identifier, AE-qualifier, AE-invocation-identifier, + Authentication-value + FROM ACSE-1 {joint-iso-itu-t association-control(2) modules(0) apdus(0) + version1(1)}; + +ApplicationReference ::= SEQUENCE { + ap-title [0] ACSE-1.AP-title OPTIONAL, + ap-invocation-id [1] ACSE-1.AP-invocation-identifier OPTIONAL, + ae-qualifier [2] ACSE-1.AE-qualifier OPTIONAL, + ae-invocation-id [3] ACSE-1.AE-invocation-identifier OPTIONAL} + +END + + + +MMS-SCI-Module-1 {iso standard 9506 part(2) mms-file-record-version1(2)} +DEFINITIONS ::= +BEGIN + +IMPORTS + ApplicationReference + FROM MMS-Environment-1 {iso standard 9506 part(2) + mms-environment-version1(4)} + AccessCondition, AdditionalCBBOptions, AdditionalSupportOptions, Address, + AlarmAckRule, Control-State, DomainState, EC-Class, EC-State, EE-Duration, + EE-Class, LogicalStatus, Modifier, ParameterSupportOptions, PhysicalStatus, + Priority, ProgramInvocationState, ServiceSupportOptions, Severity, + Transitions, TypeDescription + FROM MMS-Object-Module-1 {iso standard 9506 part(1) + mms-object-model-version1(2)} + AlternateAccess, ConfirmedServiceRequest, AttachToEventCondition, + AttachToSemaphore, Data, EE-State, Identifier, Integer8, Integer32, + MMSString, MMS255String, ObjectName, TimeOfDay, TypeSpecification, + Unsigned32, Unsigned8 + FROM ISO-9506-MMS-1 {iso standard 9506 part(2) + mms-abstract-syntax-version1(1)}; + +SCI-Information ::= SEQUENCE { + partOne [0] IMPLICIT VMD-File, + partTwo [1] IMPLICIT Service-and-Parameter-CBBs} + +VMD-File ::= SEQUENCE { + executiveFunction [0] IMPLICIT ApplicationReference, + vendorName [1] MMSString, + modelName [2] MMSString, + revision [3] MMSString, + abstractSyntaxes [4] IMPLICIT OBJECT IDENTIFIER, + -- no TRANSACTIONs, + -- no APPLICATION-ASSOCIATIONs, + accessControl [5] IMPLICIT Access-Control-List-instance, + logicalStatus [6] IMPLICIT LogicalStatus, + capabilities [7] IMPLICIT SEQUENCE OF MMSString, + physicalStatus [8] IMPLICIT PhysicalStatus, + local-detail [9] IMPLICIT BIT STRING, + accessControlLists + [10] IMPLICIT SEQUENCE OF Access-Control-List-instance, + domains [11] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [12] IMPLICIT SEQUENCE OF Program-Invocation-instance, + unitControls + [13] IMPLICIT SEQUENCE OF Unit-Control-instance, + unnamedVariables + [14] IMPLICIT SEQUENCE OF Unnamed-Variable-instance, + namedVariables + [15] IMPLICIT SEQUENCE OF Named-Variable-instance, + namedVariableLists + [16] IMPLICIT SEQUENCE OF Named-Variable-List-instance, + namedTypes [17] IMPLICIT SEQUENCE OF Named-Type-instance, + dataExchanges + [18] IMPLICIT SEQUENCE OF Data-Exchange-instance, + semaphores [19] IMPLICIT SEQUENCE OF Semaphore-instance, + operatorStations + [20] IMPLICIT SEQUENCE OF Operator-Station-instance, + eventConditions + [21] IMPLICIT SEQUENCE OF Event-Condition-instance, + eventActions + [22] IMPLICIT SEQUENCE OF Event-Action-instance, + eventEnrollments + [23] IMPLICIT SEQUENCE OF Event-Enrollment-instance, + eventConditionLists + [24] IMPLICIT SEQUENCE OF Event-Condition-List-instance, + journals [25] IMPLICIT SEQUENCE OF Journal-instance, + ..., + selected-Program-Invocation + CHOICE {selectedProgram [26] IMPLICIT Program-Invocation-instance, + noneSelected [27] IMPLICIT NULL}} + +Access-Control-List-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + readAccessCondition + [4] AccessCondition OPTIONAL, + storeAccessCondition + [5] AccessCondition OPTIONAL, + writeAccessCondition + [6] AccessCondition OPTIONAL, + loadAccessCondition + [7] AccessCondition OPTIONAL, + executeAccessCondition + [8] AccessCondition OPTIONAL, + deleteAccessCondition + [9] AccessCondition OPTIONAL, + editAccessCondition + [10] AccessCondition OPTIONAL, + -- + -- The following fields are used to record lists of objects placed + -- under the control of this ACCESS-CONTROL-LIST object. + -- They will be referred to collectively as the Controlled Object Lists + -- + accessControlLists + [11] IMPLICIT SEQUENCE OF + Access-Control-List-instance, + domains + [12] IMPLICIT SEQUENCE OF + Domain-instance, + programInvocations + [13] IMPLICIT SEQUENCE OF + Program-Invocation-instance, + unitControls + [14] IMPLICIT SEQUENCE OF + Unit-Control-instance, + unnamedVariables + [15] IMPLICIT SEQUENCE OF + Unnamed-Variable-instance, + namedVariables + [16] IMPLICIT SEQUENCE OF + Named-Variable-instance, + namedVariableLists + [17] IMPLICIT SEQUENCE OF + Named-Variable-List-instance, + namedTypes + [18] IMPLICIT SEQUENCE OF + Named-Type-instance, + dataExchanges + [19] IMPLICIT SEQUENCE OF + Data-Exchange-instance, + semaphores + [20] IMPLICIT SEQUENCE OF + Semaphore-instance, + operatorStations + [21] IMPLICIT SEQUENCE OF + Operator-Station-instance, + eventConditions + [22] IMPLICIT SEQUENCE OF + Event-Condition-instance, + eventActions + [23] IMPLICIT SEQUENCE OF + Event-Action-instance, + eventEnrollments + [24] IMPLICIT SEQUENCE OF + Event-Enrollment-instance, + journals + [25] IMPLICIT SEQUENCE OF + Journal-instance, + ..., + eventConditionLists + [26] IMPLICIT SEQUENCE OF + Event-Condition-List-instance}}} + +Domain-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {capabilities + [3] IMPLICIT SEQUENCE OF MMSString, + state + [4] IMPLICIT DomainState, + -- The aAssociation is not included + accessControl + [5] IMPLICIT Access-Control-List-instance, + sharable [6] IMPLICIT BOOLEAN, + programInvocations + [7] IMPLICIT SEQUENCE OF + Program-Invocation-instance, + -- uploadsInProgress is not included, + namedVariables + [8] IMPLICIT SEQUENCE OF + Named-Variable-instance, + namedVariableLists + [9] IMPLICIT SEQUENCE OF + Named-Variable-List-instance, + namedTypes + [10] IMPLICIT SEQUENCE OF + Named-Type-instance, + eventConditions + [11] IMPLICIT SEQUENCE OF + Event-Condition-instance, + eventActions + [12] IMPLICIT SEQUENCE OF + Event-Action-instance, + eventEnrollments + [13] IMPLICIT SEQUENCE OF + Event-Enrollment-instance, + eventConditionLists + [14] IMPLICIT SEQUENCE OF + Event-Condition-List-instance}}} + +Program-Invocation-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {programInvocationState + [3] IMPLICIT ProgramInvocationState, + domains + [4] IMPLICIT SEQUENCE OF Domain-instance, + accessControl + [5] IMPLICIT SEQUENCE OF + Access-Control-List-instance, + reusable + [6] IMPLICIT BOOLEAN, + monitor + [7] IMPLICIT BOOLEAN, + -- The following three fields shall all be present if the value of + -- monitor is true. + -- If present, the &name field of each object instance + -- shall have a value equal to the + -- &name field of this instance of the PROGRAM-INVOCATION. + eventCondition + [8] IMPLICIT SEQUENCE OF + Event-Condition-instance + OPTIONAL, + eventAction + [9] IMPLICIT SEQUENCE OF + Event-Action-instance + OPTIONAL, + eventEnrollment + [10] IMPLICIT SEQUENCE OF + Event-Enrollment-instance + OPTIONAL, + executionArgument + [11] MMSString, + ..., + control + [12] IMPLICIT Control-State, + controlling-Program-Invocation + [13] IMPLICIT Program-Invocation-instance, + -- The following field shall be present + -- if and only if the value of the &control field is controlling. + controlled-Program-Invocations + [14] IMPLICIT SEQUENCE OF + Program-Invocation-instance + OPTIONAL}}} + +Unit-Control-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + domains + [4] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [5] IMPLICIT SEQUENCE OF + Program-Invocation-instance}}} + +Unnamed-Variable-instance ::= SEQUENCE { + address [0] Address, + accessControl [1] IMPLICIT Access-Control-List-instance, + typeDescription [2] TypeDescription} + +Named-Variable-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + typeDescription [4] TypeDescription, + address [5] Address OPTIONAL, + meaning + [6] IMPLICIT VisibleString OPTIONAL}}} + +Named-Variable-List-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + listOfVariables + [4] IMPLICIT SEQUENCE OF + Variable-List-Item-instance}}} + +Variable-List-Item-instance ::= SEQUENCE { + -- one and only one of the following two lines shall appear + unnamedItem [0] IMPLICIT Unnamed-Variable-instance OPTIONAL, + namedItem [1] IMPLICIT Named-Variable-instance OPTIONAL, + -- the following specification may be included + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL} + +Named-Type-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + typeDescription [4] TypeDescription, + meaning + [5] IMPLICIT VisibleString OPTIONAL}}} + +Data-Exchange-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + request + [4] IMPLICIT SEQUENCE OF TypeDescription, + response + [5] IMPLICIT SEQUENCE OF TypeDescription, + linked [6] IMPLICIT BOOLEAN, + -- The following attribute shall appear if an only if the value of &linked is true. + programInvocation + [7] IMPLICIT Program-Invocation-instance + OPTIONAL}}} + +Semaphore-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + class + [4] IMPLICIT ENUMERATED {token, pool}, + -- If the value of &class is token, the following field shall appear + numberOfTokens + [5] IMPLICIT INTEGER OPTIONAL, + -- If the value of &class is pool, the following field shall appear + namedTokens + [6] IMPLICIT SEQUENCE OF VisibleString + OPTIONAL, + eventCondition + [7] IMPLICIT Event-Condition-instance}}} + +Operator-Station-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + stationType + [4] IMPLICIT ENUMERATED {entry, + display, + entry-display}}}} + +Event-Condition-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + ecClass + [4] IMPLICIT EC-Class, + ecState + [5] IMPLICIT EC-State, + priority + [6] IMPLICIT Priority, + severity + [7] IMPLICIT Severity, + eventEnrollments + [8] IMPLICIT SEQUENCE OF + Event-Enrollment-instance, + -- The following fields shall be present + -- if and only if the value of &ecClass is monitored. + enabled + [9] IMPLICIT BOOLEAN OPTIONAL, + alarmSummaryReports + [10] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable + CHOICE {named + [11] IMPLICIT Named-Variable-instance, + unnamed + [12] IMPLICIT Unnamed-Variable-instance, + unspecified [13] IMPLICIT NULL} + OPTIONAL, + evaluationInterval + [14] IMPLICIT INTEGER OPTIONAL, + ..., + displayEnhancement + CHOICE {text [15] MMSString, + number [16] IMPLICIT INTEGER, + none [17] IMPLICIT NULL}, + group-Priority-Override + CHOICE {priority + [18] IMPLICIT Priority, + undefined [19] IMPLICIT NULL} + OPTIONAL, + referencingEventConditionLists + [20] IMPLICIT SEQUENCE OF + Event-Condition-List-instance}}} + +Event-Action-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + confirmedServiceRequest + [4] ConfirmedServiceRequest, + modifiers + [5] IMPLICIT SEQUENCE OF Modifier, + eventEnrollments + [6] IMPLICIT SEQUENCE OF + Event-Enrollment-instance}}} + +Event-Enrollment-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + eeClass + [4] IMPLICIT EE-Class, + eventCondition + [5] IMPLICIT Event-Condition-instance, + ecTransitions + [6] IMPLICIT Transitions, + -- The following parameter is present if and only if the + -- value of &eeClass is modifier. + remainingDelay + CHOICE {time [7] IMPLICIT INTEGER, + forever [8] IMPLICIT NULL} + OPTIONAL, + -- The remaining parameters are present if and only if the + -- value of &eeClass is notification. + eventAction + [9] IMPLICIT Event-Action-instance + OPTIONAL, + duration + [10] IMPLICIT EE-Duration OPTIONAL, + clientApplication + [11] IMPLICIT ApplicationReference + OPTIONAL, + aaRule + [12] IMPLICIT AlarmAckRule OPTIONAL, + ..., + displayEnhancement + CHOICE {text [13] MMSString, + number [14] IMPLICIT INTEGER, + none [15] IMPLICIT NULL}}}} + +Event-Condition-List-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + eventConditions + [4] IMPLICIT SEQUENCE OF + Event-Condition-instance, + eventConditionLists + [5] IMPLICIT SEQUENCE OF + Event-Condition-List-instance, + referencingEventConditionLists + [6] IMPLICIT SEQUENCE OF + Event-Condition-List-instance}}} + +Journal-instance ::= SEQUENCE { + name [0] ObjectName, + definition + CHOICE {reference [1] IMPLICIT OBJECT IDENTIFIER, + details + [2] IMPLICIT SEQUENCE {accessControl + [3] IMPLICIT Access-Control-List-instance, + entries + [4] IMPLICIT SEQUENCE OF + Journal-Entry-instance}}} + +Journal-Entry-instance ::= SEQUENCE { + journal [0] IMPLICIT Journal-instance, + entry [1] IMPLICIT OCTET STRING, + clientApplication [2] IMPLICIT ApplicationReference, + timeStamp [3] IMPLICIT TimeOfDay, + orderOfReceipt [4] IMPLICIT INTEGER, + informationType [5] IMPLICIT ENUMERATED {annotation, event-data, data}, + -- The following attribute shall appear if and only if the + -- value of &informationType is annotation. + textComment [6] MMS255String OPTIONAL, + --The following attribute shall appear if and only if the + -- value of &informationType is event-data. + eventTransitionRecord + [7] IMPLICIT SEQUENCE {name [8] ObjectName, + currentState [9] IMPLICIT EC-State} OPTIONAL, + -- The following attribute shall appear if and only if the + -- value of &informationType is data or event-data. + journalVariables + [10] IMPLICIT SEQUENCE OF + SEQUENCE {variableTag [11] MMS255String, + valueSpecification [12] Data} OPTIONAL} + +Service-and-Parameter-CBBs ::= SEQUENCE { + services-Client [0] IMPLICIT ServiceSupportOptions, + services-Server [1] IMPLICIT ServiceSupportOptions, + parameters [2] IMPLICIT ParameterSupportOptions, + nest [3] IMPLICIT INTEGER, + extendedServices-Client [4] IMPLICIT AdditionalSupportOptions, + extendedServices-Server [5] IMPLICIT AdditionalSupportOptions, + extendedParameters [6] IMPLICIT AdditionalCBBOptions, + generalManagement [7] IMPLICIT GeneralManagementParameters, + vMDSupport [8] IMPLICIT VMDSupportParameters, + domainManagement [9] IMPLICIT DomainManagementParameters, + programInvocation [10] IMPLICIT ProgramInvocationManagementParameters, + variableAccess [11] IMPLICIT VariableAccessParameters, + dataParameters [12] IMPLICIT DataParameters, + semaphoreManagement [13] IMPLICIT SemaphoreManagementParameters, + operatorCommunication [14] IMPLICIT OperatorCommunicationParameters, + errors [15] IMPLICIT ErrorParameters, + fileManagement [16] IMPLICIT FileManagementParameters} + +GeneralManagementParameters ::= SEQUENCE { + localDetail [0] MMSString, + supportForTime + [1] IMPLICIT SEQUENCE {timeOfDay [2] IMPLICIT BOOLEAN, + timeSequence [3] IMPLICIT BOOLEAN}, + granularityOfTime [4] IMPLICIT INTEGER} + +VMDSupportParameters ::= SEQUENCE { + localDetail [0] MMSString, + extendedDerivation [1] MMSString + -- method used to perform extended derivation--} + +DomainManagementParameters ::= SEQUENCE { + loadDataOctet [0] MMSString, + -- description of the format of Load Data if the octet string form is used + loadDataSyntax [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + -- identifier of the Abstract Syntaxes used + maxUploads [2] IMPLICIT INTEGER} + +ProgramInvocationManagementParameters ::= SEQUENCE { + executionArgMaxSize [0] IMPLICIT INTEGER, + executionArgParseRules [1] MMSString, + executionArgSyntaxes [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + programLoction [3] MMSString, + -- syntax of the program Location notation + stepMode [4] IMPLICIT BOOLEAN + -- if true, step Mode is supported--} + +VariableAccessParameters ::= SEQUENCE { + uninterruptibleAccess [0] MMSString, + -- conditions under which it is guaranteed + singleMode [1] IMPLICIT BOOLEAN, + unnamedMode [2] IMPLICIT BOOLEAN} + +DataParameters ::= SEQUENCE { + bit-string [0] IMPLICIT INTEGER OPTIONAL, + integer [1] IMPLICIT INTEGER OPTIONAL, + unsigned [2] IMPLICIT INTEGER OPTIONAL, + floating-point + [3] IMPLICIT SEQUENCE {total [4] IMPLICIT INTEGER, + exponent [5] IMPLICIT INTEGER} OPTIONAL, + octet-string [10] IMPLICIT INTEGER OPTIONAL, + visible-string [11] IMPLICIT INTEGER OPTIONAL, + binary-time [12] IMPLICIT BOOLEAN OPTIONAL, + bcd [13] IMPLICIT INTEGER OPTIONAL, + mmsString [14] IMPLICIT INTEGER OPTIONAL} + +SemaphoreManagementParameters ::= SEQUENCE { + algorithm [0] IMPLICIT MMSString + -- method of processing the &priority field--} + +OperatorCommunicationParameters ::= SEQUENCE { + input-time-out [0] IMPLICIT INTEGER} + +ErrorParameters ::= SEQUENCE { + additionalCode [0] MMSString, + additionalDetial + [1] IMPLICIT SEQUENCE {size [2] IMPLICIT INTEGER, + syntax [3] MMSString}} + +FileManagementParameters ::= SEQUENCE {fileName [0] MMSString} + +END + + + +ISO-9506-MMS-1A {iso standard 9506 part(2) mms-annex-version1(3)} DEFINITIONS +::= +BEGIN + +EXPORTS + ObtainFile-Request, ObtainFile-Response, ObtainFile-Error, FileOpen-Request, + FileOpen-Response, FileRead-Request, FileRead-Response, FileClose-Request, + FileClose-Response, FileRename-Request, FileRename-Response, + FileRename-Error, FileDelete-Request, FileDelete-Response, + FileDirectory-Request, FileDirectory-Response, ScatteredAccessDescription, + DefineScatteredAccess-Request, DefineScatteredAccess-Response, + GetScatteredAccessAttributes-Request, GetScatteredAccessAttributes-Response; + +IMPORTS + FileName, ObjectName, AlternateAccess, VariableSpecification, Identifier, + Integer32, Unsigned32 + FROM ISO-9506-MMS-1 {iso standard 9506 part(2) + mms-abstract-syntax-version1(1)} + ApplicationReference + FROM MMS-Environment-1 {iso standard 9506 part(2) + mms-environment-version1(4)}; + +ObtainFile-Request ::= SEQUENCE { + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName} + +ObtainFile-Response ::= NULL + +ObtainFile-Error ::= INTEGER {source-file(0), destination-file(1)}(0..1) + +FileOpen-Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32} + +FileOpen-Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes} + +FileRead-Request ::= Integer32 -- FRSM ID + +FileRead-Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE} + +FileClose-Request ::= Integer32 -- FRSM ID + +FileClose-Response ::= NULL + +FileRename-Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName} + +FileRename-Response ::= NULL + +FileRename-Error ::= INTEGER {source-file(0), destination-file(1)}(0..1) + +FileDelete-Request ::= FileName + +FileDelete-Response ::= NULL + +FileDirectory-Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL} + +FileDirectory-Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE} + +DirectoryEntry ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes} + +FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, -- in octets + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL} + +ScatteredAccessDescription ::= + SEQUENCE OF + SEQUENCE {componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification, + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL} + +DefineScatteredAccess-Request ::= SEQUENCE { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription} + +DefineScatteredAccess-Response ::= NULL + +GetScatteredAccessAttributes-Request ::= ObjectName -- ScatteredAccessName + +GetScatteredAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription, + accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two--} + +END + + + +-- this part are the ACSE definitions (outside of MMS) +ACSE-1 {joint-iso-itu-t association-control(2) modules(0) apdus(0) version1(1)} +DEFINITIONS ::= +BEGIN + +EXPORTS + AP-title, AP-invocation-identifier, AE-qualifier, AE-invocation-identifier, + Authentication-value; + +AP-title ::= NULL + +AP-invocation-identifier ::= NULL + +AE-qualifier ::= NULL + +AE-invocation-identifier ::= NULL + +Authentication-value ::= NULL + +END \ No newline at end of file diff --git a/src/asn1/mms/more-asn1-files/mms-ioserver.asn b/src/asn1/mms/more-asn1-files/mms-ioserver.asn new file mode 100644 index 0000000..2fccbf4 --- /dev/null +++ b/src/asn1/mms/more-asn1-files/mms-ioserver.asn @@ -0,0 +1,1920 @@ +--Quelle: http://www.ioserver.com/mms.asn +---Corrections made December 15, 1994--- + +MMS { iso(1) standard(0) 9506(2) part(1) mms-general-module-version(1) } + +DEFINITIONS ::= + +BEGIN + +EXPORTS MMSpdu; + +IMPORTS + AP_title, + AP_invocation_identifier, + AE_qualifier, + AE_invocation_identifier +FROM ISO-8650-ACSE-1; + +MMSpdu ::= CHOICE { + confirmed_RequestPDU [0] IMPLICIT Confirmed_RequestPDU, + confirmed_ResponsePDU [1] IMPLICIT Confirmed_ResponsePDU, + confirmed_ErrorPDU [2] IMPLICIT Confirmed_ErrorPDU, + unconfirmed_PDU [3] IMPLICIT Unconfirmed_PDU, + rejectPDU [4] IMPLICIT RejectPDU, + cancel_RequestPDU [5] IMPLICIT Cancel_RequestPDU, + cancel_ResponsePDU [6] IMPLICIT Cancel_ResponsePDU, + cancel_ErrorPDU [7] IMPLICIT Cancel_ErrorPDU, + initiate_RequestPDU [8] IMPLICIT Initiate_RequestPDU, + initiate_ResponsePDU [9] IMPLICIT Initiate_ResponsePDU, + initiate_ErrorPDU [10] IMPLICIT Initiate_ErrorPDU, + conclude_RequestPDU [11] IMPLICIT Conclude_RequestPDU, + conclude_ResponsePDU [12] IMPLICIT Conclude_ResponsePDU, + conclude_ErrorPDU [13] IMPLICIT Conclude_ErrorPDU +} + +Confirmed_RequestPDU ::= SEQUENCE { + invokeID Unsigned32, + listOfModifier SEQUENCE OF Modifier OPTIONAL, + ConfirmedServiceRequest, + [79] Request_Detail OPTIONAL +} + +Unconfirmed_PDU ::= SEQUENCE { + UnconfirmedService, + [79] Request_Detail OPTIONAL +} + +Confirmed_ResponsePDU ::= SEQUENCE { + invokeID Unsigned32, + ConfirmedServiceResponse, + [79] Request_Detail OPTIONAL +} + +Confirmed_ErrorPDU ::= SEQUENCE { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError +} + +UnconfirmedService ::= CHOICE { + informationReport [0] IMPLICIT InformationReport, + unsolicitedStatus [1] IMPLICIT UnsolicitedStatus, + eventNotification [2] IMPLICIT EventNotification, + additionalService [3] AdditionalUnconfirmedService +} + +Modifier ::= CHOICE { + attach_To_Event_Condition [0] IMPLICIT AttachToEventCondition, + attach_To_Semaphore [1] IMPLICIT AttachToSemaphore +} + +ConfirmedServiceRequest ::= CHOICE { + status [0] IMPLICIT Status_Request, + getNameList [1] IMPLICIT GetNameList_Request, + identify [2] IMPLICIT Identify_Request, + rename [3] IMPLICIT Rename_Request, + read [4] IMPLICIT Read_Request, + write [5] IMPLICIT Write_Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes_Request, + defineNamedVariable [7] IMPLICIT DefineNamedVariable_Request, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess_Request, + getScatteredAccessAttributes [9] GetScatteredAccessAttributes_Request, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess_Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList_Request, + getNamedVariableListAttributes [12] GetNamedVariableListAttributes_Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList_Request, + defineNamedType [14] IMPLICIT DefineNamedType_Request, + getNamedTypeAttributes [15] GetNamedTypeAttributes_Request, + deleteNamedType [16] IMPLICIT DeleteNamedType_Request, + input [17] IMPLICIT Input_Request, + output [18] IMPLICIT Output_Request, + takeControl [19] IMPLICIT TakeControl_Request, + relinquishControl [20] IMPLICIT RelinquishControl_Request, + defineSemaphore [21] IMPLICIT DefineSemaphore_Request, + deleteSemaphore [22] DeleteSemaphore_Request, + reportSemaphoreStatus [23] ReportSemaphoreStatus_Request, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus_Request, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus_Request, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence_Request, + downloadSegment [27] IMPLICIT DownloadSegment_Request, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence_Request, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence_Request, + uploadSegment [30] IMPLICIT UploadSegment_Request, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence_Request, + requestDomainDownload [32] IMPLICIT RequestDomainDownload_Request, + requestDomainUpload [33] IMPLICIT RequestDomainUpload_Request, + loadDomainContent [34] IMPLICIT LoadDomainContent_Request, + storeDomainContent [35] IMPLICIT StoreDomainContent_Request, + deleteDomain [36] IMPLICIT DeleteDomain_Request, + getDomainAttributes [37] IMPLICIT GetDomainAttributes_Request, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Request, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation_Request, + start [40] IMPLICIT Start_Request, + stop [41] IMPLICIT Stop_Request, + resume [42] IMPLICIT Resume_Request, + reset [43] IMPLICIT Reset_Request, + kill [44] IMPLICIT Kill_Request, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes_Request, + obtainFile [46] IMPLICIT ObtainFile_Request, + defineEventCondition [47] IMPLICIT DefineEventCondition_Request, + deleteEventCondition [48] DeleteEventCondition_Request, + getEventConditionAttributes [49] GetEventConditionAttributes_Request, + reportEventConditionStatus [50] ReportEventConditionStatus_Request, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Request, + triggerEvent [52] IMPLICIT TriggerEvent_Request, + defineEventAction [53] IMPLICIT DefineEventAction_Request, + deleteEventAction [54] DeleteEventAction_Request, + getEventActionAttributes [55] GetEventActionAttributes_Request, + reportEventActionStatus [56] ReportEventActionStatus_Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Request, + deleteEventEnrollment [58] DeleteEventEnrollment_Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Request, + reportEventEnrollmentStatus [60] ReportEventEnrollmentStatus_Request, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes_Request, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification_Request, + getAlarmSummary [63] IMPLICIT GetAlarmSummary_Request, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary_Request, + readJournal [65] IMPLICIT ReadJournal_Request, + writeJournal [66] IMPLICIT WriteJournal_Request, + initializeJournal [67] IMPLICIT InitializeJournal_Request, + reportJournalStatus [68] ReportJournalStatus_Request, + createJournal [69] IMPLICIT CreateJournal_Request, + deleteJournal [70] IMPLICIT DeleteJournal_Request, + getCapabilityList [71] IMPLICIT GetCapabilityList_Request, + fileOpen [72] IMPLICIT FileOpen_Request, + fileRead [73] IMPLICIT FileRead_Request, + fileClose [74] IMPLICIT FileClose_Request, + fileRename [75] IMPLICIT FileRename_Request, + fileDelete [76] IMPLICIT FileDelete_Request, + fileDirectory [77] IMPLICIT FileDirectory_Request, + additionalService [78] AdditionalService_Request +} + +Request_Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceRequest does not match any of the tags below + otherRequests NULL, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Request, + start [40] IMPLICIT Start_Request, + resume [42] IMPLICIT Resume_Request, + defineEventCondition [47] IMPLICIT DefineEventCondition_Request, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Request +} + +ConfirmedServiceResponse ::= CHOICE { + status [0] IMPLICIT Status_Response, + getNameList [1] IMPLICIT GetNameList_Response, + identify [2] IMPLICIT Identify_Response, + rename [3] IMPLICIT Rename_Response, + read [4] IMPLICIT Read_Response, + write [5] IMPLICIT Write_Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes_Response, + defineNamedVariable [7] IMPLICIT DefineNamedVariable_Response, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess_Response, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes_Response, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess_Response, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList_Response, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes_Response, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList_Response, + defineNamedType [14] IMPLICIT DefineNamedType_Response, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes_Response, + deleteNamedType [16] IMPLICIT DeleteNamedType_Response, + input [17] IMPLICIT Input_Response, + output [18] IMPLICIT Output_Response, + takeControl [19] TakeControl_Response, + relinquishControl [20] IMPLICIT RelinquishControl_Response, + defineSemaphore [21] IMPLICIT DefineSemaphore_Response, + deleteSemaphore [22] IMPLICIT DeleteSemaphore_Response, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus_Response, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus_Response, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus_Response, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence_Response, + downloadSegment [27] IMPLICIT DownloadSegment_Response, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence_Response, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence_Response, + uploadSegment [30] IMPLICIT UploadSegment_Response, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence_Response, + requestDomainDownLoad [32] IMPLICIT RequestDomainDownload_Response, + requestDomainUpload [33] IMPLICIT RequestDomainUpload_Response, + loadDomainContent [34] IMPLICIT LoadDomainContent_Response, + storeDomainContent [35] IMPLICIT StoreDomainContent_Response, + deleteDomain [36] IMPLICIT DeleteDomain_Response, + getDomainAttributes [37] IMPLICIT GetDomainAttributes_Response, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Response, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation_Response, + start [40] IMPLICIT Start_Response, + stop [41] IMPLICIT Stop_Response, + resume [42] IMPLICIT Resume_Response, + reset [43] IMPLICIT Reset_Response, + kill [44] IMPLICIT Kill_Response, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes_Response, + obtainFile [46] IMPLICIT ObtainFile_Response, + fileOpen [72] IMPLICIT FileOpen_Response, + defineEventCondition [47] IMPLICIT DefineEventCondition_Response, + deleteEventCondition [48] IMPLICIT DeleteEventCondition_Response, + getEventConditionAttributes [49] IMPLICIT GetEventConditionAttributes_Response, + reportEventConditionStatus [50] IMPLICIT ReportEventConditionStatus_Response, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Response, + triggerEvent [52] IMPLICIT TriggerEvent_Response, + defineEventAction [53] IMPLICIT DefineEventAction_Response, + deleteEventAction [54] IMPLICIT DeleteEventAction_Response, + getEventActionAttributes [55] IMPLICIT GetEventActionAttributes_Response, + reportActionStatus [56] IMPLICIT ReportEventActionStatus_Response, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Response, + deleteEventEnrollment [58] IMPLICIT DeleteEventEnrollment_Response, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Response, + reportEventEnrollmentStatus [60] IMPLICIT ReportEventEnrollmentStatus_Response, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes_Response, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification_Response, + getAlarmSummary [63] IMPLICIT GetAlarmSummary_Response, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary_Response, + readJournal [65] IMPLICIT ReadJournal_Response, + writeJournal [66] IMPLICIT WriteJournal_Response, + initializeJournal [67] IMPLICIT InitializeJournal_Response, + reportJournalStatus [68] IMPLICIT ReportJournalStatus_Response, + createJournal [69] IMPLICIT CreateJournal_Response, + deleteJournal [70] IMPLICIT DeleteJournal_Response, + getCapabilityList [71] IMPLICIT GetCapabilityList_Response, + fileRead [73] IMPLICIT FileRead_Response, + fileClose [74] IMPLICIT FileClose_Response, + fileRename [75] IMPLICIT FileRename_Response, + fileDelete [76] IMPLICIT FileDelete_Response, + fileDirectory [77] IMPLICIT FileDirectory_Response, + additionalService [78] AdditionalService_Response +} + +--********************************** COMMON MMS TYPES *********************************** + +FileName ::= SEQUENCE OF GraphicString + +---TimeOfDay ::= OCTET STRING -- (SIZE (4 | 6)) + +Identifier ::= VisibleString + +Integer8 ::= INTEGER +Integer16 ::= INTEGER +Integer32 ::= INTEGER + +Unsigned8 ::= INTEGER +Unsigned16 ::= INTEGER +Unsigned32 ::= INTEGER + +ObjectName ::= CHOICE { + vmd_specific [0] IMPLICIT Identifier, + domain_specific [1] IMPLICIT SEQUENCE { + domainId Identifier, + itemId Identifier + }, + aa_specific [2] IMPLICIT Identifier +} + +ApplicationReference ::= SEQUENCE { + ap_title [0] ISO-8650-ACSE-1.AP_title OPTIONAL, + ap_invocation_id [1] ISO-8650-ACSE-1.AP_invocation_identifier OPTIONAL, + ae_qualifier [2] ISO-8650-ACSE-1.AE_qualifie OPTIONAL, + ae_invocation_id [3] ISO-8650-ACSE-1.AE_invocation_identifier OPTIONAL +} + +Priority ::= Unsigned8 + +normalPriority ::= 64 + +-- ************************************ GENERAL ************************************* + +Initiate_ErrorPDU ::= ServiceError + +Initiate_RequestPDU ::= SEQUENCE { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitRequestDetail [4] IMPLICIT InitRequestDetail +} + +InitRequestDetail ::= SEQUENCE { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions +} + +Initiate_ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitResponseDetail [4] IMPLICIT InitResponseDetail +} + +InitResponseDetail ::= SEQUENCE { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions +} + +ParameterSupportOptions ::= BIT STRING { + str1 (0), + str2 (1), + vnam (2), + valt (3), + vadr (4), + vsca (5), + tpy (6), + vlis (7), + real (8), + cei (10) +} + +ServiceSupportOptions ::= BIT STRING { + status (0), + getNameList (1), + identify (2), + rename (3), + read (4), + write (5), + getVariableAccessAttributes (6), + defineNamedVariable (7), + defineScatteredAccess (8), + getScatteredAccessAttributes (9), + deleteVariableAccess (10), + defineNamedVariableList (11), + getNamedVariableListAttributes (12), + deleteNamedVariableList (13), + defineNamedType (14), + getNamedTypeAttributes (15), + deleteNamedType (16), + input (17), + output (18), + takeControl (19), + relinquishControl (20), + defineSemaphore (21), + deleteSemaphore (22), + reportSemaphoreStatus (23), + reportPoolSemaphoreStatus (24), + reportSemaphoreEntryStatus (25), + initiateDownloadSequence (26), + downloadSegment (27), + terminateDownloadSequence (28), + initiateUploadSequence (29), + uploadSegment (30), + terminateUploadSequence (31), + requestDomainDownload (32), + requestDomainUpload (33), + loadDomainContent (34), + storeDomainContent (35), + deleteDomain (36), + getDomainAttributes (37), + createProgramInvocation (38), + deleteProgramInvocation (39), + start (40), + stop (41), + resume (42), + reset (43), + kill (44), + getProgramInvocationAttributes (45), + obtainFile (46), + defineEventCondition (47), + deleteEventCondition (48), + getEventConditionAttributes (49), + reportEventConditionStatus (50), + alterEventConditionMonitoring (51), + triggerEvent (52), + defineEventAction (53), + deleteEventAction (54), + getEventActionAttributes (55), + reportActionStatus (56), + defineEventEnrollment (57), + deleteEventEnrollment (58), + alterEventEnrollment (59), + reportEventEnrollmentStatus (60), + getEventEnrollmentAttributes (61), + acknowledgeEventNotification (62), + getAlarmSummary (63), + getAlarmEnrollmentSummary (64), + readJournal (65), + writeJournal (66), + initializeJournal (67), + reportJournalStatus (68), + createJournal (69), + deleteJournal (70), + getCapabilityList (71), + fileOpen (72), + fileRead (73), + fileClose (74), + fileRename (75), + fileDelete (76), + fileDirectory (77), + unsolicitedStatus (78), + informationReport (79), + eventNotification (80), + attachToEventCondition (81), + attachToSemaphore (82), + conclude (83), + cancel (84) +} + +---------------------------------- CONCLUDE -------------------------------- + +Conclude_RequestPDU ::= NULL + +Conclude_ResponsePDU ::= NULL + +Conclude_ErrorPDU ::= ServiceError + +---------------------------------- CANCEL -------------------------------- + +Cancel_RequestPDU ::= Unsigned32 -- originalInvokeID + +Cancel_ResponsePDU ::= Unsigned32 -- originalInvokeID + +Cancel_ErrorPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError +} + +------------------------------ Service_Error -------------------------------- + +ServiceError ::= SEQUENCE { + errorClass [0] CHOICE { + vmd_state [0] IMPLICIT INTEGER { + other (0), + vmd_state_conflict (1), + vmd_operational_problem (2), + domain_transfer_problem (3), + state_machine_id_invalid (4) + }, + application_reference [1] IMPLICIT INTEGER { + other (0), + aplication_unreachable (1), + connection_lost (2), + application_reference_invalid (3), + context_unsupported (4) + }, + definition [2] IMPLICIT INTEGER { + other (0), + object_undefined (1), + invalid_address (2), + type_unsupported (3), + type_inconsistent (4), + object_exists (5), + object_attribute_inconsistent (6) + }, + resource [3] IMPLICIT INTEGER { + other (0), + memory_unavailable (1), + processor_resource_unavailable (2), + mass_storage_unavailable (3), + capability_unavailable (4), + capability_unknown (5) + }, + service [4] IMPLICIT INTEGER { + other (0), + primitives_out_of_sequence (1), + object_sate_conflict (2), + pdu_size (3), + continuation_invalid (4), + object_constraint_conflict (5) + }, + service_preempt [5] IMPLICIT INTEGER { + other (0), + timeout (1), + deadlock (2), + cancel (3) + }, + time_resolution [6] IMPLICIT INTEGER { + other (0), + unsupportable_time_resolution (1) + }, + access [7] IMPLICIT INTEGER { + other (0), + object_access_unsupported (1), + object_non_existent (2), + object_access_denied (3), + object_invalidated (4) + }, + initiate [8] IMPLICIT INTEGER { + other (0), + version_incompatible (1), + max_segment_insufficient (2), + max_services_outstanding_calling_insufficient (3), + max_services_outstanding_called_insufficient (4), + service_CBB_insufficient (5), + parameter_CBB_insufficient (6), + nesting_level_insufficient (7) + }, + conclude [9] IMPLICIT INTEGER { + other (0), + further_communication_required (1) + }, + cancel [10] IMPLICIT INTEGER { + other (0), + invoke_id_unknown (1), + cancel_not_possible (2) + }, + file [11] IMPLICIT INTEGER { + other (0), + filename_ambiguous (1), + file_busy (2), + filename_syntax_error (3), + content_type_invalid (4), + position_invalid (5), + file_access_denied (6), + file_non_existent (7), + duplicate_filename (8), + insufficient_space_in_filestore (9) + }, + others [12] IMPLICIT INTEGER + }, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInformation [3] CHOICE { + obtainFile [0] IMPLICIT ObtainFile_Error, + start [1] IMPLICIT Start_Error, + stop [2] IMPLICIT Stop_Error, + resume [3] IMPLICIT Resume_Error, + reset [4] IMPLICIT Reset_Error, + deleteVariableAccess [5] IMPLICIT DeleteVariableAccess_Error, + deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList_Error, + deleteNamedType [7] IMPLICIT DeleteNamedType_Error, + defineEventEnrollment_Error [8] DefineEventEnrollment_Error, + fileRename [9] IMPLICIT FileRename_Error, + additionalService [10] AdditionalServiceError + } OPTIONAL +} + +---------------------------------- REJECT -------------------------------- + +RejectPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE { + confirmed_RequestPDU [1] IMPLICIT INTEGER { + other (0), + unrecognized_service (1), + unrecognized_modifier (2), + invalid_invokeID (3), + invalid_argument (4), + invalid_modifier (5), + max_serv_outstanding_exceeded (6), + max_recursion_exceeded (8), + value_out_of_range (9) + }, + + confirmed_responsePDU [2] IMPLICIT INTEGER { + other (0), + unrecognized_service (1), + invalid_invokeID (2), + invalid_result (3), + max_recursion_exceeded (5), + value_out_of_range (6) + }, + + confirmed_errorPDU [3] IMPLICIT INTEGER { + other (0), + unrecognized_service (1), + invalid_invokeID (2), + invalid_serviceError (3), + value_out_of_range (4) + }, + + unconfirmedPDU [4] IMPLICIT INTEGER { + other (0), + unrecognized_service (1), + invalid_argument (2), + max_recursion_exceeded (3), + value_out_of_range (4) + }, + + pdu_error [5] IMPLICIT INTEGER { + unknown_pdu_type (0), + invalid_pdu (1), + illegal_acse_mapping (2) + }, + + cancel_RequestPDU [6] IMPLICIT INTEGER { + other (0), + invalid_invokeID (1) + }, + + cancel_responsePDU [7] IMPLICIT INTEGER { + other (0), + invalid_invokeID (1) + }, + + cancel_errorPDU [8] IMPLICIT INTEGER { + other (0), + invalid_invokeID (1), + invalid_serviceError (2), + value_out_of_range (3) + }, + + conclude_RequestPDU [9] IMPLICIT INTEGER { + other (0), + invalid_argument (1) + }, + + conclude_responsePDU [10] IMPLICIT INTEGER { + other (0), + invalid_result (1) + }, + + conclude_errorPDU [11] IMPLICIT INTEGER { + other (0), + invalid_serviceError (1), + value_out_of_range (2) + } + } +} + +-- *************************************** VMD ******************************************** + +Status_Request ::= BOOLEAN + +Status_Response ::= SEQUENCE { + vmdLogicalStatus [0] IMPLICIT INTEGER { + state_changes_allowed (0), + no_state_changes_allowed (1), + limited_services_allowed (2), + support_services_allowed (3) + }, + vmdPhysicalStatus [1] IMPLICIT INTEGER { + operational (0), + partially_operational (1), + inoperable (2), + needs_commissioning (3) + }, + localDetail [2] IMPLICIT BIT STRING(SIZE(0..128)) OPTIONAL +} + +------------------------------- UNSOLICITEDSTATUS -------------------------------- + +UnsolicitedStatus ::= Status_Response + +--------------------------------- GETNAMELIST -------------------------------- + +GetNameList_Request ::= SEQUENCE { + extendedObjectClass [0] CHOICE { + objectClass [0] IMPLICIT INTEGER { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + }, + objectScope [1] CHOICE { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL +} + +GetNameList_Response ::= SEQUENCE { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +---------------------------------- IDENTIFY -------------------------------- + +Identify_Request ::= NULL + +Identify_Response ::= SEQUENCE { + vendorName [0] IMPLICIT VisibleString, + modelName [1] IMPLICIT VisibleString, + revision [2] IMPLICIT VisibleString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL +} + +---------------------------------- RENAME -------------------------------- + +Rename_Request ::= SEQUENCE { + extendedObjectClass [0] CHOICE { + objectClass [0] IMPLICIT INTEGER { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + }, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier +} + +Rename_Response ::= NULL + +---------------------------------- GET CAPABILITY LIST -------------------------------- + +GetCapabilityList_Request ::= SEQUENCE { + continueAfter VisibleString OPTIONAL +} + +GetCapabilityList_Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +-- ************************************* DOMAIN **************************************** + +InitiateDownloadSequence_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString, + sharable [2] IMPLICIT BOOLEAN +} + +InitiateDownloadSequence_Response ::= NULL + +---------------------------------- DOWNLOAD SEGMENT ----------------------------------- + +DownloadSegment_Request ::= Identifier + +DownloadSegment_Response ::= SEQUENCE { + loadData CHOICE { + non_coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +-------------------------------- TERMINATE DOWNLOAD ----------------------------------- + +TerminateDownloadSequence_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL +} + +TerminateDownloadSequence_Response ::= NULL + +-------------------------------- INITIATE UPLOAD ----------------------------------- + +InitiateUploadSequence_Request ::= Identifier -- Domain Name + +InitiateUploadSequence_Response ::= SEQUENCE { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString +} + +---------------------------------- UPLOAD SEGMENT ----------------------------------- + +UploadSegment_Request ::= Integer32 -- ULSM Identifier + +UploadSegment_Response ::= SEQUENCE { + loadData CHOICE { + non_coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +-------------------------------- TERMINATE UPLOAD ----------------------------------- + +TerminateUploadSequence_Request ::= Integer32 -- ULSM Identifer + +TerminateUploadSequence_Response ::= NULL + +----------------------------- REQUEST DOMAIN DOWNLOAD ----------------------------------- + +RequestDomainDownload_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName +} + +RequestDomainDownload_Response ::= NULL + +----------------------------- REQUEST DOMAIN UPLOAD ----------------------------------- + +RequestDomainUpload_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName +} + +RequestDomainUpload_Response ::= NULL + +----------------------------- LOAD DOMAIN CONTENT ----------------------------------- + +LoadDomainContent_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName, + thirdParty [5] IMPLICIT ApplicationReference OPTIONAL +} + +LoadDomainContent_Response ::= NULL + +----------------------------- STORE DOMAIN CONTENT ----------------------------------- + +StoreDomainContent_Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + filenName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL +} + +StoreDomainContent_Response ::= NULL + +----------------------------- DELETE DOMAIN ----------------------------------- + +DeleteDomain_Request ::= Identifier -- Domain Name + +DeleteDomain_Response ::= NULL + +----------------------------- GET DOMAIN ATTRIBUTES ----------------------------------- + +GetDomainAttributes_Request ::= Identifier -- Domain Name + +GetDomainAttributes_Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, -- PI Names + uploadInProgress [5] IMPLICIT Integer8 +} + +DomainState ::= INTEGER { + non_existent (0), + loading (1), + ready (2), + in_use (3), + complete (4), + incomplete (5), + d1 (7), + d2 (8), + d3 (9), + d4 (10), + d5 (11), + d6 (12), + d7 (13), + d8 (14), + d9 (15) +} + +-- ********************************* PROGRAM INVOCATION ********************************* + +----------------------CREATE PROGRAM INVOCATION --------------------- + +CreateProgramInvocation_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainName [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring + -- FALSE indicates CURRENT monitoring +} + +CreateProgramInvocation_Response ::= NULL + +----------------------DELETE PROGRAM INVOCATION --------------------- + +DeleteProgramInvocation_Request ::= Identifier -- Program Invocation Name + +DeleteProgramInvocation_Response ::= NULL + +----------------------------- START ------------------------------------ + +Start_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL +} + +Start_Response ::= NULL + +Start_Error ::= ProgramInvocationState + +----------------------------- STOP ------------------------------------ + +Stop_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier +} + +Stop_Response ::= NULL + +Stop_Error ::= ProgramInvocationState + +---------------------------- RESUME ------------------------------------ + +Resume_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL +} + +Resume_Response ::= NULL + +Resume_Error ::= ProgramInvocationState + +------------------------------ RESET ------------------------------------ + +Reset_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier +} + +Reset_Response ::= NULL + +Reset_Error ::= ProgramInvocationState + +------------------------------ KILL ------------------------------------ + +Kill_Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier +} + +Kill_Response ::= NULL + +--------------------------- GET PI ATTRIBUTES ------------------------------------ + +GetProgramInvocationAttributes_Request ::= Identifier -- Program Invocation Name + +GetProgramInvocationAttributes_Response ::= SEQUENCE { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + startArgument [5] IMPLICIT VisibleString, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL +} + +ProgramInvocationState ::= INTEGER { + non_existent (0), + unrunable (1), + idle (2), + running (3), + stopped (4), + starting (5), + stopping (6), + resuming (7), + resetting (8) +} + -- Companion Standard may add additional values + +-- *********************************** VARIABLES **************************************** + +TypeSpecification ::= CHOICE { + typeName [0] ObjectName, + array [1] IMPLICIT SEQUENCE { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification + }, + structure [2] IMPLICIT SEQUENCE { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF SEQUENCE { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + }, + + -- Simple Type -------- Size --------- + boolean [3] IMPLICIT NULL, + bit_string [4] IMPLICIT Integer32, + integer [5] IMPLICIT Unsigned8, + unsigned [6] IMPLICIT Unsigned8, + floating_point [7] IMPLICIT SEQUENCE { + format_width Unsigned8, + exponent_width Unsigned8 + }, + real [8] IMPLICIT SEQUENCE { + base [0] IMPLICIT INTEGER (2|10), + exponent [1] IMPLICIT INTEGER OPTIONAL, + mantissa [2] IMPLICIT INTEGER OPTIONAL + }, + octet_string [9] IMPLICIT Integer32, + visible_string [10] IMPLICIT Integer32, + generalized_time [11] IMPLICIT NULL, + binary_time [12] IMPLICIT BOOLEAN, + bcd [13] IMPLICIT Unsigned8, + objId [15] IMPLICIT NULL +} + +AlternateAccess ::= SEQUENCE OF CHOICE { + unnamed AlternateAccessSelection, + named [5] IMPLICIT SEQUENCE { + componentName [0] IMPLICIT Identifier, + accesst AlternateAccessSelection + } +} + +AlternateAccessSelection ::= CHOICE { + selectAccess CHOICE { + component [1] IMPLICIT Identifier, + index [2] IMPLICIT Unsigned32, + indexRange [3] IMPLICIT SEQUENCE { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [4] IMPLICIT NULL -- all array elements + } +} + +-------------------------------- READ ------------------------------- + +Read_Request ::= SEQUENCE { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification +} + +Read_Response ::= SEQUENCE { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult +} + +-------------------------------- WRITE ------------------------------- + +Write_Request ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data + } + +Write_Response ::= SEQUENCE OF CHOICE { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL +} + +---------------------------- INFORMATION REPORT -------------------------------- + +InformationReport ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult +} + +------------------------- GET VARIABLE ACCESS ATTRIBUTES ------------------------ + +GetVariableAccessAttributes_Request ::= CHOICE { + name [0] ObjectName, + address [1] Address +} + +GetVariableAccessAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeSpecification [2] TypeSpecification +} +--------------------------- DEFINE NAMED VARIABLE -------------------------------- + +DefineNamedVariable_Request ::= SEQUENCE { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL +} + +DefineNamedVariable_Response ::= NULL + +-------------------------- DEFINE SCATTERED ACCESS ------------------------------- + +DefineScatteredAccess_Request ::= SEQUENCE { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription +} + +DefineScatteredAccess_Response ::= NULL + +------------------------- GET SCATTERED ACCESS ATTRIBUTES ------------------------ + +GetScatteredAccessAttributes_Request ::= ObjectName -- ScatteredAccessName + +GetScatteredAccessAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription +} + +----------------------------- DELETE VARIABLE ACCESS ------------------------------ + +DeleteVariableAccess_Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa_specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL +} + +DeleteVariableAccess_Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 +} + +DeleteVariableAccess_Error ::= Unsigned32 -- numberDeleted + +------------------------- DEFINE NAMED VAR. LIST ------------------------------- + +DefineNamedVariableList_Request ::= SEQUENCE { + variableListName ObjectName, + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } +} + +DefineNamedVariableList_Response ::= NULL + +------------------------- GET NAMED VAR. LIST ATTRIBUTES ------------------------ + +GetNamedVariableListAttributes_Request ::= ObjectName -- VariableListName + +GetNamedVariableListAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } +} + +------------------------- DELETE NAMED VAR. LIST ------------------------------- + +DeleteNamedVariableList_Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa_specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL +} + +DeleteNamedVariableList_Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 +} + +DeleteNamedVariableList_Error ::= Unsigned32 -- number Deleted + +------------------------- DEFINE NAMED TYPE ------------------------------- + +DefineNamedType_Request ::= SEQUENCE { + typeName ObjectName, + typeSpecification TypeSpecification +} + +DefineNamedType_Response ::= NULL + +------------------------- GET NAMED TYPE ATTRIB. ------------------------------- + +GetNamedTypeAttributes_Request ::= ObjectName -- TypeName + +GetNamedTypeAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification +} + +------------------------- DELETE NAMED TYPE ------------------------------- + +DeleteNamedType_Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa_specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL +} + +DeleteNamedType_Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 +} + +DeleteNamedType_Error ::= Unsigned32 -- number Deleted + +---------------------------- SUPPORT DEFINITIONS ---------------------------- + +AccessResult ::= CHOICE { + failure [0] IMPLICIT DataAccessError, + success Data +} + +DataAccessError ::= INTEGER { + object_invalidated (0), + hardware_fault (1), + temporarly_unavailable (2), + object_access_denied (3), + object_undefined (4), + invalid_address (5), + type_unsupported (6), + type_inconsistent (7), + object_attribute_inconsistent (8), + object_access_unsupported (9), + object_non_existent (10) +} + +Data ::= CHOICE { + -- context tag 0 is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit_string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, + floating_point [7] IMPLICIT FloatingPoint, + real [8] IMPLICIT REAL, + octet_string [9] IMPLICIT OCTET STRING, + visible_string [10] IMPLICIT VisibleString, + binary_time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, + booleanArray [14] IMPLICIT BIT STRING +} + +---FloatingPoint ::= OCTET STRING + +VariableAccessSpecification ::= CHOICE { + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + }, + variableListName [1] ObjectName +} + +ScatteredAccessDescription ::= SEQUENCE OF SEQUENCE { + componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification, + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL +} + +VariableSpecification ::= CHOICE { + name [0] ObjectName, + address [1] Address, + variableDescription [2] IMPLICIT SEQUENCE { + address Address, + typeSpecification TypeSpecification + }, + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, + invalidated [4] IMPLICIT NULL +} + +Address ::= CHOICE { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] IMPLICIT VisibleString, + unconstrainedAddress [2] IMPLICIT OCTET STRING +} + +-- ********************************* SEMAPHORES ***************************************** + +TakeControl_Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE, + applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL +} + +TakeControl_Response ::= CHOICE { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier +} + +-------------------------------- RELINQUISH CONTROL ----------------------------- + +RelinquishControl_Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL +} + +RelinquishControl_Response ::= NULL + +------------------------------- DEFINE SEMAPHORE -------------------------------- + +DefineSemaphore_Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + numbersOfTokens [1] IMPLICIT Unsigned16 +} + +DefineSemaphore_Response ::= NULL + +------------------------------- DELETE SEMAPHORE -------------------------------- + +DeleteSemaphore_Request ::= ObjectName -- Semaphore Name + +DeleteSemaphore_Response ::= NULL + +--------------------------- REPORT SEMAPHORE STATUS ----------------------------- + +ReportSemaphoreStatus_Request ::= ObjectName -- SemaphoreName + +ReportSemaphoreStatus_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER { + token (0), + pool (1) + }, + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16 +} + +--------------------------- REPORT POOL SEMAPHORE STATUS ----------------------------- + +ReportPoolSemaphoreStatus_Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL +} + +ReportPoolSemaphoreStatus_Response ::= SEQUENCE { + listOfNamedTokens [0] IMPLICIT SEQUENCE OF CHOICE { + freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +--------------------------- REPORT SEMAPHORE ENTRY STATUS ----------------------------- + +ReportSemaphoreEntryStatus_Request ::=SEQUENCE { + semaphoreName [0] ObjectName, + state [1] IMPLICIT INTEGER { + queued (0), + owner (1), + hung (2) + }, + entryIdToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL +} + +ReportSemaphoreEntryStatus_Response ::= SEQUENCE { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +AttachToSemaphore ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE +} + +SemaphoreEntry ::= SEQUENCE { + entryId [0] IMPLICIT OCTET STRING, + entryClass [1] IMPLICIT INTEGER { + simple (0), + modifier (1) + }, + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT 64, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE +} + +--******************************** OPERATOR COMMUNICATION ***************************** + +------------------------------------------ INPUT ------------------------------------ + +Input_Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, + listOfPromptData [2] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL +} + +Input_Response ::= VisibleString -- Input String + +--------------------------------------- OUTPUT ------------------------------------- + +Output_Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF VisibleString +} + +Output_Response ::= NULL + +-- ************************************ EVENTS ********************************************* + +DefineEventCondition_Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC_Class, + prio_rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL +} + +DefineEventCondition_Response ::= NULL + +DeleteEventCondition_Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa_specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL +} + +DeleteEventCondition_Response ::= Unsigned32 -- Candidates Not Deleted + +GetEventConditionAttributes_Request ::= ObjectName -- Event Condition Name + +GetEventConditionAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC_Class, + prio_rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable [6] CHOICE { + variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL + } OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL +} + +ReportEventConditionStatus_Request ::= ObjectName -- EventConditionName + +ReportEventConditionStatus_Response ::= SEQUENCE { + currentState [0] IMPLICIT EC_State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL +} + +AlterEventConditionMonitoring_Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL, + evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL +} + +AlterEventConditionMonitoring_Response ::= NULL + +TriggerEvent_Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL +} + +TriggerEvent_Response ::= NULL + +DefineEventAction_Request ::= SEQUENCE { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL, + confirmed_Service_Request [2] ConfirmedServiceRequest +} + +DefineEventAction_Response ::= NULL + +DeleteEventAction_Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa_specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL +} + +DeleteEventAction_Response ::= Unsigned32 -- candidates not deleted + +GetEventActionAttributes_Request ::= ObjectName -- Event Action Name + +GetEventActionAttributes_Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier, + confirmed_Service_Request [2] ConfirmedServiceRequest +} + +ReportEventActionStatus_Request ::= ObjectName -- EventActionName + +ReportEventActionStatus_Response ::= Unsigned32 -- Number of Event Enrollments + +DefineEventEnrollment_Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransition [2] IMPLICIT Transitions, + alarmAcknowledgementRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL, + clientApplication [5] ApplicationReference OPTIONAL +} + +DefineEventEnrollment_Response ::= NULL + +DefineEventEnrollment_Error ::= ObjectName + +DeleteEventEnrollment_Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName +} + +DeleteEventEnrollment_Response ::= Unsigned32 -- candidates not deleted + +GetEventEnrollmentAttributes_Request ::= SEQUENCE { + scopeOfRequest [0] IMPLICIT INTEGER { + specific (0), + client (1), + ec (2), + ea (3) + } DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + clientApplication [2] ApplicationReference OPTIONAL, + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL +} + +EventEnrollment ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + eventActionName [2] CHOICE { + eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL + } OPTIONAL, + clientApplication [3] ApplicationReference OPTIONAL, + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE_Class, + duration [6] IMPLICIT EE_Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL +} + +GetEventEnrollmentAttributes_Response ::= SEQUENCE { + listOfEventEnrollment [0] IMPLICIT SEQUENCE OF EventEnrollment, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +ReportEventEnrollmentStatus_Request ::= ObjectName -- Event Enrollment Name + +ReportEventEnrollmentStatus_Response ::= SEQUENCE { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE_Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE_State +} + +AlterEventEnrollment_Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL +} + +AlterEventEnrollment_Response ::= SEQUENCE { + currentState [0] CHOICE { + state [0] IMPLICIT EE_State, + undefined [1] IMPLICIT NULL + }, + transitionTime [1] EventTime +} + +AcknowledgeEventNotification_Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC_State, + timeOfAcknowledgedTransition [3] EventTime +} + +AcknowledgeEventNotification_Response ::= NULL + +GetAlarmSummary_Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER { + not_acked (0), + acked (1), + all (2) + } DEFAULT not_acked, + severityFilter [3] IMPLICIT SEQUENCE { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL +} + +GetAlarmSummary_Response ::= SEQUENCE { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +AlarmSummary ::= SEQUENCE { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC_State, + unacknowledgedState [3] IMPLICIT INTEGER { + none (0), + active (1), + idle (2), + both (3) + }, + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL +} + +GetAlarmEnrollmentSummary_Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER { + not_acked (0), + acked (1), + all (2) + } DEFAULT not_acked, + severityFilter [3] IMPLICIT SEQUENCE { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL +} + +GetAlarmEnrollmentSummary_Response ::= SEQUENCE { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +AlarmEnrollmentSummary ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + clientApplication [2] ApplicationReference OPTIONAL, + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC_State, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + enrollementState [8] IMPLICIT EE_State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL +} + +EventNotification ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + severity [2] IMPLICIT Unsigned8, + currentState [3] IMPLICIT EC_State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult [8] IMPLICIT SEQUENCE { + eventActioName ObjectName, + eventActionResult CHOICE { + success [0] ConfirmedServiceResponse, + failure [1] IMPLICIT ServiceError + } + } OPTIONAL +} + +AttachToEventCondition ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL +} + +EventTime ::= CHOICE { + timeOfDayT [0] IMPLICIT TimeOfDay, + timeSequenceIdentifier [1] IMPLICIT Unsigned32 +} + +EC_Class ::= INTEGER { + network_triggered (0), + monitored (1) +} + +EC_State ::= INTEGER { + disabled (0), + idle (1), + active (2) +} + +EE_State ::= INTEGER { + disabled (0), + idle (1), + active (2), + activeNoAckA (3), + idleNoAckI (4), + idleNoAckA (5), + idleAcked (6), + activeAcked (7) +} + +Transitions ::= BIT STRING { + idle_to_disabled (0), + active_to_disabled (1), + disabled_to_idle (2), + active_to_idle (3), + disabled_to_active (4), + idle_to_active (5), + any_to_deleted (6) +} + +AlarmAckRule ::= INTEGER { + none (0), + simple (1), + ack_active (2), + ack_all (3) +} + +EE_Class ::= INTEGER { + modifier (0), + notification (1) +} + +EE_Duration ::= INTEGER { + current (0), + permanent (1) +} + +-- ********************************** JOURNAL ******************************************* + +---------------------------------- READ JOURNAL ---------------------------------- + +ReadJournal_Request ::= SEQUENCE { + journalName [0] ObjectName, + rangeStartSpecification [1] CHOICE { + startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING + } OPTIONAL, + rangeStopSpecification [2] CHOICE { + endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32 + } OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter [5] IMPLICIT SEQUENCE { + timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING + } +} + +ReadJournal_Response ::= SEQUENCE { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +JournalEntry ::= SEQUENCE { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent +} + +---------------------------------- WRITE JOURNAL ---------------------------------- + +WriteJournal_Request ::= SEQUENCE { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent +} + +WriteJournal_Response ::= NULL + +-------------------------------- INITIALIZE JOURNAL ---------------------------------- + +InitializeJournal_Request ::= SEQUENCE { + journalName [0] ObjectName, + limitSpecification [1] IMPLICIT SEQUENCE { + limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL + } OPTIONAL +} + +InitializeJournal_Response ::= Unsigned32 -- entries deleted + +---------------------------------- REPORT JOURNAL STATUS ----------------------------- + +ReportJournalStatus_Request ::= ObjectName -- Journal Name + +ReportJournalStatus_Response ::= SEQUENCE { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN +} + +---------------------------------- CREATE JOURNAL ---------------------------------- + +CreateJournal_Request ::= SEQUENCE { + journalName [0] ObjectName +} + +CreateJournal_Response ::= NULL + +---------------------------------- DELETE JOURNAL ---------------------------------- + +DeleteJournal_Request ::= SEQUENCE { + journalName [0] ObjectName +} + +DeleteJournal_Response ::= NULL + +-------------------------------- SUPPORTING PRODUCTIONS ---------------------------- + +EntryContent ::= SEQUENCE { + occurenceTime [0] IMPLICIT TimeOfDay, + additionalDetail [1] JOU_Additional_Detail OPTIONAL, + -- additionalDetail shall be omitted + -- from abstract syntax defined in this standard + entryForm CHOICE { + data [2] IMPLICIT SEQUENCE { + event [0] IMPLICIT SEQUENCE { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC_State + } OPTIONAL, + listOfVariables [1] IMPLICIT SEQUENCE OF SEQUENCE { + variableTag [0] IMPLICIT VisibleString, + valueSpecification [1] Data + } OPTIONAL + }, + annotation [3] IMPLICIT VisibleString + } +} + +JOU_Additional_Detail ::= NULL -- Defined by Companion Standard + +-- **************************************** FILES ********************************************* + +ObtainFile_Request ::= SEQUENCE { + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName +} + +ObtainFile_Response ::= NULL + +ObtainFile_Error ::= INTEGER { + source_file (0), + destination_file (1) +} + +FileOpen_Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32 +} + +FileOpen_Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes +} + +FileRead_Request ::= Integer32 + +FileRead_Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + +FileClose_Request ::= Integer32 + +FileClose_Response ::= NULL + +FileRename_Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName +} + +FileRename_Response ::= NULL + +FileRename_Error ::= INTEGER { + source_file (0), + destination_file (1) +} + +FileDelete_Request ::= FileName + +FileDelete_Response ::= NULL + +FileDirectory_Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL +} + +FileDirectory_Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE +} + +DirectoryEntry ::= SEQUENCE { + filename [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes +} + +FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL +} + +END diff --git a/src/asn1/mms/more-asn1-files/mms-iso.asn b/src/asn1/mms/more-asn1-files/mms-iso.asn new file mode 100644 index 0000000..a5f2aee --- /dev/null +++ b/src/asn1/mms/more-asn1-files/mms-iso.asn @@ -0,0 +1,4767 @@ +--Quelle: http://isotc.iso.org/livelink/livelink/8434785/protocol.txt?func=doc.Fetch&nodeid=8434785 + ISO-9506-MMS-1 { iso standard 9506 part(2) mms-abstract-syntax-version1(1) } +DEFINITIONS ::= BEGIN + + EXPORTS AlternateAccess, + AttachToEventCondition, + AttachToSemaphore, + ConfirmedServiceRequest, + Data, + EE-State, + FileName, + Identifier, + Integer8, + Integer32, + MMSString, + MMS255String, + ObjectName, + TimeOfDay, + TypeSpecification, + Unsigned32, + Unsigned8, + VariableSpecification; + + IMPORTS ApplicationReference, + Authentication-value FROM + MMS-Environment-1 { iso standard 9506 part(2) mms-environment-version1 (4) } + ObtainFile-Request, + ObtainFile-Response, + ObtainFile-Error, + FileOpen-Request, + FileOpen-Response, + FileRead-Request, + FileRead-Response, + FileClose-Request, + FileClose-Response, + FileRename-Request, + FileRename-Response, + FileRename-Error, + FileDelete-Request, + FileDelete-Response, + FileDirectory-Request, + FileDirectory-Response, + DefineScatteredAccess-Request, + DefineScatteredAccess-Response, + ScatteredAccessDescription, + GetScatteredAccessAttributes-Request, + GetScatteredAccessAttributes-Response FROM + ISO-9506-MMS-1A { iso standard 9506 part(2) mms-annex-version1(3) } + AccessCondition, + AdditionalCBBOptions, + AdditionalSupportOptions, + Address, + AlarmAckRule, + Control-State, + DomainState, + EC-State, + EC-Class, + EE-Duration, + EE-Class, + EventTime, + Journal-Variable, + LogicalStatus, + Modifier, + normalPriority, + normalSeverity, + ParameterSupportOptions, + PhysicalStatus, + Priority, + ProgramInvocationState, + Running-Mode, + ServiceSupportOptions, + Severity, + Transitions, + TypeDescription, + ULState, + VMDState + FROM MMS-Object-Module-1 + { iso standard 9506 part(1) mms-object-model-version1(2) }; + + MMSpdu ::= CHOICE { + confirmed-RequestPDU [0] IMPLICIT Confirmed-RequestPDU, + confirmed-ResponsePDU [1] IMPLICIT Confirmed-ResponsePDU, + confirmed-ErrorPDU [2] IMPLICIT Confirmed-ErrorPDU, +IF ( unsolicitedStatus informationReport eventNotification ) + unconfirmed-PDU [3] IMPLICIT Unconfirmed-PDU, +ELSE + unconfirmed-PDU [3] IMPLICIT NULL, +ENDIF + rejectPDU [4] IMPLICIT RejectPDU, +IF (cancel) + cancel-RequestPDU [5] IMPLICIT Cancel-RequestPDU, + cancel-ResponsePDU [6] IMPLICIT Cancel-ResponsePDU, + cancel-ErrorPDU [7] IMPLICIT Cancel-ErrorPDU, +ELSE + cancel-RequestPDU [5] IMPLICIT NULL, + cancel-ResponsePDU [6] IMPLICIT NULL, + cancel-ErrorPDU [7] IMPLICIT NULL, +ENDIF + initiate-RequestPDU [8] IMPLICIT Initiate-RequestPDU, + initiate-ResponsePDU [9] IMPLICIT Initiate-ResponsePDU, + initiate-ErrorPDU [10] IMPLICIT Initiate-ErrorPDU, + conclude-RequestPDU [11] IMPLICIT Conclude-RequestPDU, + conclude-ResponsePDU [12] IMPLICIT Conclude-ResponsePDU, + conclude-ErrorPDU [13] IMPLICIT Conclude-ErrorPDU + } + + Confirmed-RequestPDU ::= SEQUENCE { + invokeID Unsigned32, +IF (attachToEventCondition attachToSemaphore ) + listOfModifiers SEQUENCE OF Modifier OPTIONAL, +ENDIF + service ConfirmedServiceRequest, + ... +IF ( csr cspi ), + service-ext [79] Request-Detail OPTIONAL +ENDIF + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL + } + + ConfirmedServiceRequest ::= CHOICE { +IF ( status ) + status + [0] IMPLICIT Status-Request +ELSE + status + [0] IMPLICIT NULL +ENDIF +IF ( getNameList ) +, getNameList + [1] IMPLICIT GetNameList-Request +ELSE +, getNameList + [1] IMPLICIT NULL +ENDIF +IF ( identify ) +, identify + [2] IMPLICIT Identify-Request +ELSE +, identify + [2] IMPLICIT NULL +ENDIF +IF ( rename ) +, rename + [3] IMPLICIT Rename-Request +ELSE +, rename + [3] IMPLICIT NULL +ENDIF +IF ( read ) +, read + [4] IMPLICIT Read-Request +ELSE +, read + [4] IMPLICIT NULL +ENDIF +IF ( write ) +, write + [5] IMPLICIT Write-Request +ELSE +, write + [5] IMPLICIT NULL +ENDIF +IF ( vnam vadr ) +IF ( getVariableAccessAttributes ) +, getVariableAccessAttributes + [6] GetVariableAccessAttributes-Request +ELSE +, getVariableAccessAttributes + [6] IMPLICIT NULL +ENDIF +ELSE +, getVariableAccessAttributes + [6] IMPLICIT NULL +ENDIF +IF ( vnam ) +IF ( vadr ) +IF ( defineNamedVariable ) +, defineNamedVariable + [7] IMPLICIT DefineNamedVariable-Request +ELSE +, defineNamedVariable + [7] IMPLICIT NULL +ENDIF +ELSE +, defineNamedVariable + [7] IMPLICIT NULL +ENDIF +ELSE +, defineNamedVariable + [7] IMPLICIT NULL +ENDIF +IF ( vsca ) + -- [8] is reserved for a service defined in Annex E +IF ( defineScatteredAccess ) +, defineScatteredAccess + [8] IMPLICIT DefineScatteredAccess-Request +ELSE +, defineScatteredAccess + [8] IMPLICIT NULL +ENDIF + -- [9] is reserved for a service defined in Annex E +IF ( getScatteredAccessAttributes ) +, getScatteredAccessAttributes + [9] GetScatteredAccessAttributes-Request +ELSE +, getScatteredAccessAttributes + [9] IMPLICIT NULL +ENDIF +ELSE +, defineScatteredAccess + [8] IMPLICIT NULL, + getScatteredAccessAttributes + [9] IMPLICIT NULL +ENDIF +IF ( vnam ) +IF ( deleteVariableAccess ) +, deleteVariableAccess + [10] IMPLICIT DeleteVariableAccess-Request +ELSE +, deleteVariableAccess + [10] IMPLICIT NULL +ENDIF +ELSE +, deleteVariableAccess + [10] IMPLICIT NULL +ENDIF +IF ( vlis ) +IF ( vnam ) +IF ( defineNamedVariableList ) +, defineNamedVariableList + [11] IMPLICIT DefineNamedVariableList-Request +ELSE +, defineNamedVariableList + [11] IMPLICIT NULL +ENDIF +IF ( getNamedVariableListAttributes ) + , getNamedVariableListAttributes + [12] GetNamedVariableListAttributes-Request +ELSE +, getNamedVariableListAttributes + [12] IMPLICIT NULL +ENDIF +IF ( deleteNamedVariableList ) +, deleteNamedVariableList + [13] IMPLICIT DeleteNamedVariableList-Request +ELSE +, deleteNamedVariableList + [13] IMPLICIT NULL +ENDIF +ELSE +, defineNamedVariableList + [11] IMPLICIT NULL, + getNamedVariableListAttribute + [12] IMPLICIT NULL, + deleteNamedVariableList + [13] IMPLICIT NULL +ENDIF +ELSE +, defineNamedVariableList + [11] IMPLICIT NULL, + getNamedVariableListAttributes + [12] IMPLICIT NULL, + deleteNamedVariableList + [13] IMPLICIT NULL +ENDIF +ENDIF +IF ( vnam ) +IF ( defineNamedType ) +, defineNamedType + [14] IMPLICIT DefineNamedType-Request +ELSE +, defineNamedType + [14] IMPLICIT NULL +ENDIF +IF ( getNamedTypeAttributes ) +, getNamedTypeAttributes + [15] GetNamedTypeAttributes-Request +ELSE +, getNamedTypeAttributes + [15] IMPLICIT NULL +ENDIF +IF ( deleteNamedType ) +, deleteNamedType + [16] IMPLICIT DeleteNamedType-Request +ELSE +, deleteNamedType + [16] IMPLICIT NULL +ENDIF +ELSE +, defineNamedType + [14] IMPLICIT NULL, + getNamedTypeAttributes + [15] IMPLICIT NULL, + deleteNamedType + [16] IMPLICIT NULL +ENDIF +IF ( input ) +, input + [17] IMPLICIT Input-Request +ELSE +, input + [17] IMPLICIT NULL +ENDIF +IF ( output ) +, output + [18] IMPLICIT Output-Request +ELSE +, output + [18] IMPLICIT NULL +ENDIF +IF ( takeControl ) +, takeControl + [19] IMPLICIT TakeControl-Request +ELSE +, takeControl + [19] IMPLICIT NULL +ENDIF +IF ( relinquishControl ) +, relinquishControl + [20] IMPLICIT RelinquishControl-Request +ELSE +, relinquishControl + [20] IMPLICIT NULL +ENDIF +IF ( defineSemaphore ) +, defineSemaphore + [21] IMPLICIT DefineSemaphore-Request +ELSE +, defineSemaphore + [21] IMPLICIT NULL +ENDIF +IF ( deleteSemaphore ) +, deleteSemaphore + [22] DeleteSemaphore-Request +ELSE +, deleteSemaphore + [22] IMPLICIT NULL +ENDIF +IF ( reportSemaphoreStatus ) +, reportSemaphoreStatus + [23] ReportSemaphoreStatus-Request +ELSE +, reportSemaphoreStatus + [23] IMPLICIT NULL +ENDIF +IF ( reportPoolSemaphoreStatus ) +, reportPoolSemaphoreStatus + [24] IMPLICIT ReportPoolSemaphoreStatus-Request +ELSE +, reportPoolSemaphoreStatus + [24] IMPLICIT NULL +ENDIF +IF ( reportSemaphoreEntryStatus ) +, reportSemaphoreEntryStatus + [25] IMPLICIT ReportSemaphoreEntryStatus-Request +ELSE +, reportSemaphoreEntryStatus + [25] IMPLICIT NULL +ENDIF +IF ( initiateDownloadSequence ) +, initiateDownloadSequence + [26] IMPLICIT InitiateDownloadSequence-Request, + downloadSegment + [27] IMPLICIT DownloadSegment-Request, + terminateDownloadSequence + [28] IMPLICIT TerminateDownloadSequence-Request +ELSE +, initiateDownloadSequence + [26] IMPLICIT NULL, + downloadSegment + [27] IMPLICIT NULL, + terminateDownloadSequence + [28] IMPLICIT NULL +ENDIF +IF ( initiateUploadSequence ) +, initiateUploadSequence + [29] IMPLICIT InitiateUploadSequence-Request, + uploadSegment + [30] IMPLICIT UploadSegment-Request, + terminateUploadSequence + [31] IMPLICIT TerminateUploadSequence-Request +ELSE +, initiateUploadSequence + [29] IMPLICIT NULL, + uploadSegment + [30] IMPLICIT NULL, + terminateUploadSequence + [31] IMPLICIT NULL +ENDIF +IF ( requestDomainDownload ) +, requestDomainDownload + [32] IMPLICIT RequestDomainDownload-Request +ELSE +, requestDomainDownload + [32] IMPLICIT NULL +ENDIF +IF ( requestDomainUpload ) +, requestDomainUpload + [33] IMPLICIT RequestDomainUpload-Request +ELSE +, requestDomainUpload + [33] IMPLICIT NULL +ENDIF +IF ( loadDomainContent ) +, loadDomainContent + [34] IMPLICIT LoadDomainContent-Request +ELSE +, loadDomainContent + [34] IMPLICIT NULL +ENDIF +IF ( storeDomainContent ) +, storeDomainContent + [35] IMPLICIT StoreDomainContent-Request +ELSE +, storeDomainContent + [35] IMPLICIT NULL +ENDIF +IF ( deleteDomain ) +, deleteDomain + [36] IMPLICIT DeleteDomain-Request +ELSE +, deleteDomain + [36] IMPLICIT NULL +ENDIF +IF ( getDomainAttributes ) +, getDomainAttributes + [37] IMPLICIT GetDomainAttributes-Request +ELSE +, getDomainAttributes + [37] IMPLICIT NULL +ENDIF +IF ( createProgramInvocation ) +, createProgramInvocation + [38] IMPLICIT CreateProgramInvocation-Request +ELSE +, createProgramInvocation + [38] IMPLICIT NULL +ENDIF +IF ( deleteProgramInvocation ) +, deleteProgramInvocation + [39] IMPLICIT DeleteProgramInvocation-Request +ELSE +, deleteProgramInvocation + [39] IMPLICIT NULL +ENDIF +IF ( start ) +, start + [40] IMPLICIT Start-Request +ELSE +, start + [40] IMPLICIT NULL +ENDIF +IF ( stop ) +, stop + [41] IMPLICIT Stop-Request +ELSE +, stop + [41] IMPLICIT NULL +ENDIF +IF ( resume ) +, resume + [42] IMPLICIT Resume-Request +ELSE +, resume + [42] IMPLICIT NULL +ENDIF +IF ( reset ) +, reset + [43] IMPLICIT Reset-Request +ELSE +, reset + [43] IMPLICIT NULL +ENDIF +IF ( kill ) +, kill + [44] IMPLICIT Kill-Request +ELSE +, kill + [44] IMPLICIT NULL +ENDIF +IF ( getProgramInvocationAttributes ) +, getProgramInvocationAttributes + [45] IMPLICIT GetProgramInvocationAttributes-Request +ELSE +, getProgramInvocationAttributes + [45] IMPLICIT NULL +ENDIF +IF ( obtainFile ) +, obtainFile + [46] IMPLICIT ObtainFile-Request +ELSE +, obtainFile + [46] IMPLICIT NULL +ENDIF +IF ( defineEventCondition ) +, defineEventCondition + [47] IMPLICIT DefineEventCondition-Request +ELSE +, defineEventCondition + [47] IMPLICIT NULL +ENDIF +IF ( deleteEventCondition ) +, deleteEventCondition + [48] DeleteEventCondition-Request +ELSE +, deleteEventCondition + [48] IMPLICIT NULL +ENDIF +IF ( getEventConditionAttributes ) +, getEventConditionAttributes + [49] GetEventConditionAttributes-Request +ELSE +, getEventConditionAttributes + [49] IMPLICIT NULL +ENDIF +IF ( reportEventConditionStatus ) +, reportEventConditionStatus + [50] ReportEventConditionStatus-Request +ELSE +, reportEventConditionStatus + [50] IMPLICIT NULL +ENDIF +IF ( alterEventConditionMonitoring ) +, alterEventConditionMonitoring + [51] IMPLICIT AlterEventConditionMonitoring-Request +ELSE +, alterEventConditionMonitoring + [51] IMPLICIT NULL +ENDIF +IF ( triggerEvent ) +, triggerEvent + [52] IMPLICIT TriggerEvent-Request +ELSE +, triggerEvent + [52] IMPLICIT NULL +ENDIF +IF ( defineEventAction ) +, defineEventAction + [53] IMPLICIT DefineEventAction-Request +ELSE +, defineEventAction + [53] IMPLICIT NULL +ENDIF +IF ( deleteEventAction ) +, deleteEventAction + [54] DeleteEventAction-Request +ELSE +, deleteEventAction + [54] IMPLICIT NULL +ENDIF +IF ( getEventActionAttributes ) +, getEventActionAttributes + [55] GetEventActionAttributes-Request +ELSE +, getEventActionAttributes + [55] IMPLICIT NULL +ENDIF +IF ( reportEventActionStatus ) +, reportEventActionStatus + [56] ReportEventActionStatus-Request +ELSE +, reportEventActionStatus + [56] IMPLICIT NULL +ENDIF +IF ( defineEventEnrollment ) +, defineEventEnrollment + [57] IMPLICIT DefineEventEnrollment-Request +ELSE +, defineEventEnrollment + [57] IMPLICIT NULL +ENDIF +IF ( deleteEventEnrollment ) +, deleteEventEnrollment + [58] DeleteEventEnrollment-Request +ELSE +, deleteEventEnrollment + [58] IMPLICIT NULL +ENDIF +IF ( alterEventEnrollment ) +, alterEventEnrollment + [59] IMPLICIT AlterEventEnrollment-Request +ELSE +, alterEventEnrollment + [59] IMPLICIT NULL +ENDIF +IF ( reportEventEnrollmentStatus ) +, reportEventEnrollmentStatus + [60] ReportEventEnrollmentStatus-Request +ELSE +, reportEventEnrollmentStatus + [60] IMPLICIT NULL +ENDIF +IF ( getEventEnrollmentAttributes ) +, getEventEnrollmentAttributes + [61] IMPLICIT GetEventEnrollmentAttributes-Request +ELSE +, getEventEnrollmentAttributes + [61] IMPLICIT NULL +ENDIF +IF ( acknowledgeEventNotification ) +, acknowledgeEventNotification + [62] IMPLICIT AcknowledgeEventNotification-Request +ELSE +, acknowledgeEventNotification + [62] IMPLICIT NULL +ENDIF +IF ( getAlarmSummary ) +, getAlarmSummary + [63] IMPLICIT GetAlarmSummary-Request +ELSE +, getAlarmSummary + [63] IMPLICIT NULL +ENDIF +IF ( getAlarmEnrollmentSummary ) +, getAlarmEnrollmentSummary + [64] IMPLICIT GetAlarmEnrollmentSummary-Request +ELSE +, getAlarmEnrollmentSummary + [64] IMPLICIT NULL +ENDIF +IF ( readJournal ) +, readJournal + [65] IMPLICIT ReadJournal-Request +ELSE +, readJournal + [65] IMPLICIT NULL +ENDIF +IF ( writeJournal ) +, writeJournal + [66] IMPLICIT WriteJournal-Request +ELSE +, writeJournal + [66] IMPLICIT NULL +ENDIF +IF ( initializeJournal ) +, initializeJournal + [67] IMPLICIT InitializeJournal-Request +ELSE +, initializeJournal + [67] IMPLICIT NULL +ENDIF +IF ( reportJournalStatus ) +, reportJournalStatus + [68] ReportJournalStatus-Request +ELSE +, reportJournalStatus + [68] IMPLICIT NULL +ENDIF +IF ( createJournal ) +, createJournal + [69] IMPLICIT CreateJournal-Request +ELSE +, createJournal + [69] IMPLICIT NULL +ENDIF +IF ( deleteJournal ) +, deleteJournal + [70] IMPLICIT DeleteJournal-Request +ELSE +, deleteJournal + [70] IMPLICIT NULL +ENDIF +IF ( getCapabilityList ) +, getCapabilityList + [71] IMPLICIT GetCapabilityList-Request +ELSE +, getCapabilityList + [71] IMPLICIT NULL +ENDIF + -- choices [72] through [77] are reserved for use by services + -- defined in annex D +IF ( fileOpen ) +, fileOpen + [72] IMPLICIT FileOpen-Request +ELSE +, fileOpen + [72] IMPLICIT NULL +ENDIF +IF ( fileRead ) +, fileRead + [73] IMPLICIT FileRead-Request +ELSE +, fileRead + [73] IMPLICIT NULL +ENDIF +IF ( fileClose ) +, fileClose + [74] IMPLICIT FileClose-Request +ELSE +, fileClose + [74] IMPLICIT NULL +ENDIF +IF ( fileRename ) +, fileRename + [75] IMPLICIT FileRename-Request +ELSE +, fileRename + [75] IMPLICIT NULL +ENDIF +IF ( fileDelete ) +, fileDelete + [76] IMPLICIT FileDelete-Request +ELSE +, fileDelete + [76] IMPLICIT NULL +ENDIF +IF ( fileDirectory ) +, fileDirectory + [77] IMPLICIT FileDirectory-Request +ELSE +, fileDirectory + [77] IMPLICIT NULL +ENDIF +,... +IF ( csr cspi ) +, additionalService + [78] AdditionalService-Request +ENDIF + -- choice [79] is reserved +IF ( getDataExchangeAttributes ) +, getDataExchangeAttributes + [80] GetDataExchangeAttributes-Request + -- Shall not appear in minor version 1 +ENDIF +IF ( exchangeData ) +, exchangeData + [81] IMPLICIT ExchangeData-Request + -- Shall not appear in minor version 1 +ENDIF +IF ( defineAccessControlList ) +, defineAccessControlList + [82] IMPLICIT DefineAccessControlList-Request + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( getAccessControlListAttributes ) +, getAccessControlListAttributes + [83] GetAccessControlListAttributes-Request + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( reportAccessControlledObjects ) +, reportAccessControlledObjects + [84] IMPLICIT ReportAccessControlledObjects-Request + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( deleteAccessControlList ) +, deleteAccessControlList + [85] IMPLICIT DeleteAccessControlList-Request + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( changeAccessControl ) +, changeAccessControl + [86] IMPLICIT ChangeAccessControl-Request + -- Shall not appear in minor version 1 or 2 +ENDIF + ,... + } + + AdditionalService-Request ::= CHOICE { +IF ( csr ) +IF ( vMDStop ) + vMDStop + [0] IMPLICIT VMDStop-Request +ELSE + vMDStop + [0] IMPLICIT NULL +ENDIF +IF ( vMDReset ) +, vMDReset + [1] IMPLICIT VMDReset-Request +ELSE +, vMDReset + [1] IMPLICIT NULL +ENDIF +IF ( select ) +, select + [2] IMPLICIT Select-Request +ELSE +, select + [2] IMPLICIT NULL +ENDIF +IF ( alterProgramInvocationAttributes ) +, alterPI + [3] IMPLICIT AlterProgramInvocationAttributes-Request +ELSE +, alterPI + [3] IMPLICIT NULL +ENDIF +ELSE +, vMDStop + [0] IMPLICIT NULL, + vMDReset + [1] IMPLICIT NULL, + select + [2] IMPLICIT NULL, + alterPI + [3] IMPLICIT NULL +ENDIF +IF ( cspi ) +IF ( initiateUnitControlLoad ) +, initiateUCLoad + [4] IMPLICIT InitiateUnitControlLoad-Request +ELSE +, initiateUCLoad + [4] IMPLICIT NULL +ENDIF +IF ( unitControlLoadSegment ) +, uCLoad + [5] IMPLICIT UnitControlLoadSegment-Request +ELSE +, uCLoad + [5] IMPLICIT NULL +ENDIF +IF ( unitControlUpload ) +, uCUpload + [6] IMPLICIT UnitControlUpload-Request +ELSE +, uCUpload + [6] IMPLICIT NULL +ENDIF +IF ( startUnitControl ) +, startUC + [7] IMPLICIT StartUnitControl-Request +ELSE +, startUC + [7] IMPLICIT NULL +ENDIF +IF ( stopUnitControl ) +, stopUC + [8] IMPLICIT StopUnitControl-Request +ELSE +, stopUC + [8] IMPLICIT NULL +ENDIF + IF ( createUnitControl ) +, createUC + [9] IMPLICIT CreateUnitControl-Request +ELSE +, createUC + [9] IMPLICIT NULL +ENDIF +IF ( addToUnitControl ) +, addToUC + [10] IMPLICIT AddToUnitControl-Request +ELSE +, addToUC + [10] IMPLICIT NULL +ENDIF +IF ( removeFromUnitControl ) +, removeFromUC + [11] IMPLICIT RemoveFromUnitControl-Request +ELSE +, removeFromUC + [11] IMPLICIT NULL +ENDIF +IF ( getUnitControlAttributes ) +, getUCAttributes + [12] IMPLICIT GetUnitControlAttributes-Request +ELSE +, getUCAttributes + [12] IMPLICIT NULL +ENDIF +IF ( loadUnitControlFromFile ) +, loadUCFromFile + [13] IMPLICIT LoadUnitControlFromFile-Request +ELSE +, loadUCFromFile + [13] IMPLICIT NULL +ENDIF +IF ( storeUnitControlToFile ) +, storeUCToFile + [14] IMPLICIT StoreUnitControlToFile-Request +ELSE +, storeUCToFile + [14] IMPLICIT NULL +ENDIF +IF ( deleteUnitControl ) +, deleteUC + [15] IMPLICIT DeleteUnitControl-Request +ELSE +, deleteUC + [15] IMPLICIT NULL +ENDIF +IF ( defineEventConditionList ) +, defineECL + [16] DefineEventConditionList-Request +ELSE +, defineECL + [16] IMPLICIT NULL +ENDIF +IF ( deleteEventConditionList ) +, deleteECL + [17] DeleteEventConditionList-Request +ELSE +, deleteECL + [17] IMPLICIT NULL +ENDIF +IF ( addEventConditionListReference ) +, addECLReference + [18] IMPLICIT AddEventConditionListReference-Request +ELSE +, addECLReference + [18] IMPLICIT NULL +ENDIF +IF ( removeEventConditionListReference ) +, removeECLReference + [19] IMPLICIT RemoveEventConditionListReference-Request +ELSE +, removeECLReference + [19] IMPLICIT NULL +ENDIF +IF ( getEventConditionListAttributes ) +, getECLAttributes + [20] GetEventConditionListAttributes-Request +ELSE +, getECLAttributes + [20] IMPLICIT NULL +ENDIF +IF ( reportEventConditionListStatus ) +, reportECLStatus + [21] IMPLICIT ReportEventConditionListStatus-Request +ELSE +, reportECLStatus + [21] IMPLICIT NULL +ENDIF +IF ( alterEventConditionListMonitoring ) +, alterECLMonitoring + [22] IMPLICIT AlterEventConditionListMonitoring-Request +ELSE +, alterECLMonitoring + [22] IMPLICIT NULL +ENDIF +ELSE +, initiateUCLoad + [4] IMPLICIT NULL, + uCLoad + [5] IMPLICIT NULL, + uCUpload + [6] IMPLICIT NULL, + startUC + [7] IMPLICIT NULL, + stopUC + [8] IMPLICIT NULL, + createUC + [9] IMPLICIT NULL, + addToUC + [10] IMPLICIT NULL, + removeFromUC + [11] IMPLICIT NULL, + getUCAttributes + [12] IMPLICIT NULL, + loadUCFromFile + [13] IMPLICIT NULL, + storeUCToFile + [14] IMPLICIT NULL, + deleteUC + [15] IMPLICIT NULL, + defineECL + [16] IMPLICIT NULL, + deleteECL + [17] IMPLICIT NULL, + addECLReference + [18] IMPLICIT NULL, + removeECLReference + [19] IMPLICIT NULL, + getECLAttributes + [20] IMPLICIT NULL, + reportECLStatus + [21] IMPLICIT NULL, + alterECLMonitoring + [22] IMPLICIT NULL +ENDIF + } + + Request-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceRequest does not match any of the tags below + otherRequests NULL +IF ( createProgramInvocation ) +, createProgramInvocation + [38] IMPLICIT CS-CreateProgramInvocation-Request +ELSE +, createProgramInvocation + [38] IMPLICIT NULL +ENDIF +IF ( start ) +, start + [40] IMPLICIT CS-Start-Request +ELSE +, start + [40] IMPLICIT NULL +ENDIF +IF ( resume ) +, resume + [42] IMPLICIT CS-Resume-Request +ELSE +, resume + [42] IMPLICIT NULL +ENDIF +IF ( defineEventCondition ) +, defineEventCondition + [47] IMPLICIT CS-DefineEventCondition-Request +ELSE +, defineEventCondition + [47] IMPLICIT NULL +ENDIF +IF ( alterEventConditionMonitoring ) +, alterEventConditionMonitoring + [51] IMPLICIT CS-AlterEventConditionMonitoring-Request +ELSE +, alterEventConditionMonitoring + [51] IMPLICIT NULL +ENDIF +IF ( defineEventEnrollment ) +, defineEventEnrollment + [57] IMPLICIT CS-DefineEventEnrollment-Request +ELSE +, defineEventEnrollment + [57] IMPLICIT NULL +ENDIF +IF ( alterEventEnrollment ) +, alterEventEnrollment + [59] IMPLICIT CS-AlterEventEnrollment-Request +ELSE +, alterEventEnrollment + [59] IMPLICIT NULL +ENDIF + } + + Unconfirmed-PDU ::= SEQUENCE { + service UnconfirmedService, + ... +IF ( cspi ) +, service-ext [79] Unconfirmed-Detail OPTIONAL +ENDIF + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL + } + + UnconfirmedService ::= CHOICE { +IF (informationReport ) + informationReport + [0] IMPLICIT InformationReport +ELSE + informationReport + [0] IMPLICIT NULL +ENDIF +IF ( unsolicitedStatus ) +, unsolicitedStatus + [1] IMPLICIT UnsolicitedStatus +ELSE +, unsolicitedStatus + [1] IMPLICIT NULL +ENDIF +IF ( eventNotification ) +, eventNotification + [2] IMPLICIT EventNotification +ELSE +, eventNotification + [2] IMPLICIT NULL +ENDIF + } + + Unconfirmed-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- UnconfirmedService does not match any of the tags below + otherRequests NULL +IF ( cspi ) +, eventNotification + [2] IMPLICIT CS-EventNotification +ENDIF + } + + Confirmed-ResponsePDU ::= SEQUENCE { + invokeID Unsigned32, + service ConfirmedServiceResponse, + ... +IF ( csr cspi ), + service-ext [79] Response-Detail OPTIONAL +ENDIF + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL + } + + ConfirmedServiceResponse ::= CHOICE { +IF ( status ) + status + [0] IMPLICIT Status-Response +ELSE + status + [0] IMPLICIT RejectPDU +ENDIF +IF ( getNameList ) +, getNameList + [1] IMPLICIT GetNameList-Response +ELSE +, getNameList + [1] IMPLICIT RejectPDU +ENDIF +IF ( identify ) +, identify + [2] IMPLICIT Identify-Response +ELSE +, identify + [2] IMPLICIT RejectPDU +ENDIF +IF ( rename ) +, rename + [3] IMPLICIT Rename-Response +ELSE +, rename + [3] IMPLICIT RejectPDU +ENDIF +IF ( read ) +, read + [4] IMPLICIT Read-Response +ELSE +, read + [4] IMPLICIT RejectPDU + ENDIF +IF ( write ) +, write + [5] IMPLICIT Write-Response +ELSE +, write + [5] IMPLICIT RejectPDU +ENDIF +IF ( vnam vadr ) +IF ( getVariableAccessAttributes ) +, getVariableAccessAttributes + [6] IMPLICIT GetVariableAccessAttributes-Response +ELSE +, getVariableAccessAttributes + [6] IMPLICIT RejectPDU +ENDIF +ELSE +, getVariableAccessAttributes + [6] IMPLICIT RejectPDU +ENDIF +IF ( vnam ) +IF ( vadr ) +IF ( defineNamedVariable ) +, defineNamedVariable + [7] IMPLICIT DefineNamedVariable-Response +ELSE +, defineNamedVariable + [7] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedVariable + [7] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedVariable + [7] IMPLICIT RejectPDU +ENDIF +IF ( vsca ) + -- choice [8] is reserved for a service defined in Annex E +IF ( defineScatteredAccess ) +, defineScatteredAccess + [8] IMPLICIT DefineScatteredAccess-Response +ELSE +, defineScatteredAccess + [8] IMPLICIT RejectPDU +ENDIF + -- choice [9] is reserved for a service defined in Annex E +IF ( getScatteredAccessAttributes ) +, getScatteredAccessAttributes + [9] IMPLICIT GetScatteredAccessAttributes-Response +ELSE +, getScatteredAccessAttributes + [9] IMPLICIT RejectPDU +ENDIF +ELSE +, defineScatteredAccess + [8] IMPLICIT RejectPDU, + getScatteredAccessAttributes + [9] IMPLICIT RejectPDU +ENDIF +IF ( vnam ) +IF ( deleteVariableAccess ) +, deleteVariableAccess + [10] IMPLICIT DeleteVariableAccess-Response +ELSE +, deleteVariableAccess + [10] IMPLICIT RejectPDU +ENDIF +ELSE +, deleteVariableAccess + [10] IMPLICIT RejectPDU +ENDIF +IF ( vlis ) +IF ( vnam ) +IF ( defineNamedVariableList ) +, defineNamedVariableList + [11] IMPLICIT DefineNamedVariableList-Response +ELSE +, defineNamedVariableList + [11] IMPLICIT RejectPDU +ENDIF +IF ( getNamedVariableListAttributes ) +, getNamedVariableListAttributes + [12] IMPLICIT GetNamedVariableListAttributes-Response +ELSE +, getNamedVariableListAttributes + [12] IMPLICIT RejectPDU +ENDIF +IF ( deleteNamedVariableList ) +, deleteNamedVariableList + [13] IMPLICIT DeleteNamedVariableList-Response +ELSE +, deleteNamedVariableList + [13] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedVariableList + [11] IMPLICIT RejectPDU, + getNamedVariableListAttributes + [12] IMPLICIT RejectPDU, + deleteNamedVariableList + [13] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedVariableList + [11] IMPLICIT RejectPDU, + getNamedVariableListAttributes + [12] IMPLICIT RejectPDU, + deleteNamedVariableList + [13] IMPLICIT RejectPDU +ENDIF +IF ( vnam ) +IF ( defineNamedType ) +, defineNamedType + [14] IMPLICIT DefineNamedType-Response +ELSE +, defineNamedType + [14] IMPLICIT RejectPDU +ENDIF +IF ( getNamedTypeAttributes ) +, getNamedTypeAttributes + [15] IMPLICIT GetNamedTypeAttributes-Response +ELSE +, getNamedTypeAttributes + [15] IMPLICIT RejectPDU +ENDIF +IF ( deleteNamedType ) +, deleteNamedType + [16] IMPLICIT DeleteNamedType-Response +ELSE +, deleteNamedType + [16] IMPLICIT RejectPDU +ENDIF +ELSE +, defineNamedType + [14] IMPLICIT RejectPDU, + getNamedTypeAttributes + [15] IMPLICIT RejectPDU, + deleteNamedType + [16] IMPLICIT RejectPDU +ENDIF +IF ( input ) +, input + [17] IMPLICIT Input-Response +ELSE +, input + [17] IMPLICIT RejectPDU +ENDIF +IF ( output ) +, output + [18] IMPLICIT Output-Response +ELSE +, output + [18] IMPLICIT RejectPDU +ENDIF +IF ( takeControl ) +, takeControl + [19] TakeControl-Response +ELSE +, takeControl + [19] IMPLICIT RejectPDU +ENDIF +IF ( relinquishControl ) +, relinquishControl + [20] IMPLICIT RelinquishControl-Response +ELSE +, relinquishControl + [20] IMPLICIT RejectPDU +ENDIF +IF ( defineSemaphore ) +, defineSemaphore + [21] IMPLICIT DefineSemaphore-Response +ELSE +, defineSemaphore + [21] IMPLICIT RejectPDU +ENDIF +IF ( deleteSemaphore ) +, deleteSemaphore + [22] IMPLICIT DeleteSemaphore-Response +ELSE +, deleteSemaphore + [22] IMPLICIT RejectPDU +ENDIF +IF ( reportSemaphoreStatus ) +, reportSemaphoreStatus + [23] IMPLICIT ReportSemaphoreStatus-Response +ELSE +, reportSemaphoreStatus + [23] IMPLICIT RejectPDU +ENDIF +IF ( reportPoolSemaphoreStatus ) +, reportPoolSemaphoreStatus + [24] IMPLICIT ReportPoolSemaphoreStatus-Response +ELSE +, reportPoolSemaphoreStatus + [24] IMPLICIT RejectPDU +ENDIF +IF ( reportSemaphoreEntryStatus ) +, reportSemaphoreEntryStatus + [25] IMPLICIT ReportSemaphoreEntryStatus-Response +ELSE +, reportSemaphoreEntryStatus + [25] IMPLICIT RejectPDU +ENDIF +IF ( initiateDownloadSequence ) +, initiateDownloadSequence + [26] IMPLICIT InitiateDownloadSequence-Response, + downloadSegment + [27] IMPLICIT DownloadSegment-Response, + terminateDownloadSequence + [28] IMPLICIT TerminateDownloadSequence-Response +ELSE +, initiateDownloadSequence + [26] IMPLICIT RejectPDU, + downloadSegment + [27] IMPLICIT RejectPDU, + terminateDownloadSequence + [28] IMPLICIT RejectPDU +ENDIF +IF ( initiateUploadSequence ) +, initiateUploadSequence + [29] IMPLICIT InitiateUploadSequence-Response, + uploadSegment + [30] IMPLICIT UploadSegment-Response, + terminateUploadSequence + [31] IMPLICIT TerminateUploadSequence-Response +ELSE +, initiateUploadSequence + [29] IMPLICIT RejectPDU, + uploadSegment + [30] IMPLICIT RejectPDU, + terminateUploadSequence + [31] IMPLICIT RejectPDU +ENDIF +IF ( requestDomainDownload ) +, requestDomainDownload + [32] IMPLICIT RequestDomainDownload-Response +ELSE +, requestDomainDownload + [32] IMPLICIT RejectPDU +ENDIF +IF ( requestDomainUpload ) +, requestDomainUpload + [33] IMPLICIT RequestDomainUpload-Response +ELSE +, requestDomainUpload + [33] IMPLICIT RejectPDU +ENDIF +IF ( loadDomainContent ) +, loadDomainContent + [34] IMPLICIT LoadDomainContent-Response +ELSE +, loadDomainContent + [34] IMPLICIT RejectPDU +ENDIF +IF ( storeDomainContent ) +, storeDomainContent + [35] IMPLICIT StoreDomainContent-Response +ELSE +, storeDomainContent + [35] IMPLICIT RejectPDU +ENDIF +IF ( deleteDomain ) +, deleteDomain + [36] IMPLICIT DeleteDomain-Response +ELSE +, deleteDomain + [36] IMPLICIT RejectPDU +ENDIF +IF ( getDomainAttributes ) +, getDomainAttributes + [37] IMPLICIT GetDomainAttributes-Response +ELSE +, getDomainAttributes + [37] IMPLICIT RejectPDU +ENDIF +IF ( createProgramInvocation ) +, createProgramInvocation + [38] IMPLICIT CreateProgramInvocation-Response +ELSE +, createProgramInvocation + [38] IMPLICIT RejectPDU +ENDIF +IF ( deleteProgramInvocation ) +, deleteProgramInvocation + [39] IMPLICIT DeleteProgramInvocation-Response +ELSE +, deleteProgramInvocation + [39] IMPLICIT RejectPDU +ENDIF +IF ( start ) +, start + [40] IMPLICIT Start-Response +ELSE +, start + [40] IMPLICIT RejectPDU +ENDIF +IF ( stop ) +, stop + [41] IMPLICIT Stop-Response +ELSE +, stop + [41] IMPLICIT RejectPDU +ENDIF +IF ( resume ) +, resume + [42] IMPLICIT Resume-Response +ELSE +, resume + [42] IMPLICIT RejectPDU +ENDIF +IF ( reset ) +, reset + [43] IMPLICIT Reset-Response +ELSE +, reset + [43] IMPLICIT RejectPDU +ENDIF +IF ( kill ) +, kill + [44] IMPLICIT Kill-Response +ELSE +, kill + [44] IMPLICIT RejectPDU +ENDIF +IF ( getProgramInvocationAttributes ) +, getProgramInvocationAttributes + [45] IMPLICIT GetProgramInvocationAttributes-Response +ELSE +, getProgramInvocationAttributes + [45] IMPLICIT RejectPDU +ENDIF +IF ( obtainFile ) +, obtainFile + [46] IMPLICIT ObtainFile-Response +ELSE +, obtainFile + [46] IMPLICIT RejectPDU +ENDIF +IF ( defineEventCondition ) +, defineEventCondition + [47] IMPLICIT DefineEventCondition-Response +ELSE +, defineEventCondition + [47] IMPLICIT RejectPDU +ENDIF +IF ( deleteEventCondition ) +, deleteEventCondition + [48] IMPLICIT DeleteEventCondition-Response +ELSE +, deleteEventCondition + [48] IMPLICIT RejectPDU +ENDIF +IF ( getEventConditionAttributes ) +, getEventConditionAttributes + [49] IMPLICIT GetEventConditionAttributes-Response +ELSE +, getEventConditionAttributes + [49] IMPLICIT RejectPDU +ENDIF +IF ( reportEventConditionStatus ) +, reportEventConditionStatus + [50] IMPLICIT ReportEventConditionStatus-Response +ELSE +, reportEventConditionStatus + [50] IMPLICIT RejectPDU +ENDIF +IF ( alterEventConditionMonitoring ) +, alterEventConditionMonitoring + [51] IMPLICIT AlterEventConditionMonitoring-Response +ELSE +, alterEventConditionMonitoring + [51] IMPLICIT RejectPDU +ENDIF +IF ( triggerEvent ) +, triggerEvent + [52] IMPLICIT TriggerEvent-Response +ELSE +, triggerEvent + [52] IMPLICIT RejectPDU +ENDIF +IF ( defineEventAction ) +, defineEventAction + [53] IMPLICIT DefineEventAction-Response +ELSE +, defineEventAction + [53] IMPLICIT RejectPDU +ENDIF +IF ( deleteEventAction ) +, deleteEventAction + [54] IMPLICIT DeleteEventAction-Response +ELSE +, deleteEventAction + [54] IMPLICIT RejectPDU +ENDIF +IF ( getEventActionAttributes ) +, getEventActionAttributes + [55] IMPLICIT GetEventActionAttributes-Response +ELSE +, getEventActionAttributes + [55] IMPLICIT RejectPDU +ENDIF +IF ( reportEventActionStatus ) +, reportEventActionStatus + [56] IMPLICIT ReportEventActionStatus-Response +ELSE +, reportEventActionStatus + [56] IMPLICIT RejectPDU +ENDIF +IF ( defineEventEnrollment ) +, defineEventEnrollment + [57] IMPLICIT DefineEventEnrollment-Response +ELSE +, defineEventEnrollment + [57] IMPLICIT RejectPDU +ENDIF +IF ( deleteEventEnrollment ) +, deleteEventEnrollment + [58] IMPLICIT DeleteEventEnrollment-Response +ELSE +, deleteEventEnrollment + [58] IMPLICIT RejectPDU +ENDIF +IF ( alterEventEnrollment ) +, alterEventEnrollment + [59] IMPLICIT AlterEventEnrollment-Response +ELSE +, alterEventEnrollment + [59] IMPLICIT RejectPDU +ENDIF +IF ( reportEventEnrollmentStatus ) +, reportEventEnrollmentStatus + [60] IMPLICIT ReportEventEnrollmentStatus-Response +ELSE +, reportEventEnrollmentStatus + [60] IMPLICIT RejectPDU +ENDIF +IF ( getEventEnrollmentAttributes ) +, getEventEnrollmentAttributes + [61] IMPLICIT GetEventEnrollmentAttributes-Response +ELSE +, getEventEnrollmentAttributes + [61] IMPLICIT RejectPDU +ENDIF +IF ( acknowledgeEventNotification ) +, acknowledgeEventNotification + [62] IMPLICIT AcknowledgeEventNotification-Response +ELSE +, acknowledgeEventNotification + [62] IMPLICIT RejectPDU +ENDIF +IF ( getAlarmSummary ) +, getAlarmSummary + [63] IMPLICIT GetAlarmSummary-Response +ELSE +, getAlarmSummary + [63] IMPLICIT RejectPDU +ENDIF +IF ( getAlarmEnrollmentSummary ) +, getAlarmEnrollmentSummary + [64] IMPLICIT GetAlarmEnrollmentSummary-Response +ELSE +, getAlarmEnrollmentSummary + [64] IMPLICIT RejectPDU +ENDIF +IF ( readJournal ) +, readJournal + [65] IMPLICIT ReadJournal-Response +ELSE +, readJournal + [65] IMPLICIT RejectPDU +ENDIF +IF ( writeJournal ) +, writeJournal + [66] IMPLICIT WriteJournal-Response +ELSE +, writeJournal + [66] IMPLICIT RejectPDU +ENDIF +IF ( initializeJournal ) +, initializeJournal + [67] IMPLICIT InitializeJournal-Response +ELSE +, initializeJournal + [67] IMPLICIT RejectPDU +ENDIF +IF ( reportJournalStatus ) +, reportJournalStatus + [68] IMPLICIT ReportJournalStatus-Response +ELSE +, reportJournalStatus + [68] IMPLICIT RejectPDU +ENDIF +IF ( createJournal ) +, createJournal + [69] IMPLICIT CreateJournal-Response +ELSE +, createJournal + [69] IMPLICIT RejectPDU +ENDIF +IF ( deleteJournal ) +, deleteJournal + [70] IMPLICIT DeleteJournal-Response +ELSE +, deleteJournal + [70] IMPLICIT RejectPDU +ENDIF +IF ( getCapabilityList ) +, getCapabilityList + [71] IMPLICIT GetCapabilityList-Response +ELSE +, getCapabilityList + [71] IMPLICIT RejectPDU +ENDIF + -- choices [72] through [77] are reserved for use by services + -- defined in annex D +IF ( fileOpen ) +, fileOpen + [72] IMPLICIT FileOpen-Response +ELSE +, fileOpen + [72] IMPLICIT RejectPDU +ENDIF +IF ( fileRead ) +, fileRead + [73] IMPLICIT FileRead-Response +ELSE +, fileRead + [73] IMPLICIT RejectPDU +ENDIF +IF ( fileClose ) +, fileClose + [74] IMPLICIT FileClose-Response +ELSE +, fileClose + [74] IMPLICIT RejectPDU +ENDIF +IF ( fileRename ) +, fileRename + [75] IMPLICIT FileRename-Response +ELSE +, fileRename + [75] IMPLICIT RejectPDU +ENDIF +IF ( fileDelete ) +, fileDelete + [76] IMPLICIT FileDelete-Response +ELSE +, fileDelete + [76] IMPLICIT RejectPDU +ENDIF +IF ( fileDirectory ) +, fileDirectory + [77] IMPLICIT FileDirectory-Response +ELSE +, fileDirectory + [77] IMPLICIT RejectPDU +ENDIF +,... +IF ( csr cspi ) +, additionalService + [78] AdditionalService-Response + -- choice [79] is reserved +IF ( getDataExchangeAttributes ), +, getDataExchangeAttributes + [80] GetDataExchangeAttributes-Response + -- Shall not appear in minor version 1 +ENDIF +IF ( exchangeData ), +, exchangeData + [81] IMPLICIT ExchangeData-Response + -- Shall not appear in minor version 1 +ENDIF +IF ( defineAccessControlList ), +, defineAccessControlList + [82] IMPLICIT DefineAccessControlList-Response + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( getAccessControlListAttributes ), +, getAccessControlListAttributes + [83] IMPLICIT GetAccessControlListAttributes-Response + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( reportAccessControlledObjects ), +, reportAccessControlledObjects + [84] IMPLICIT ReportAccessControlledObjects-Response + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( deleteAccessControlList ), +, deleteAccessControlList + [85] IMPLICIT DeleteAccessControlList-Response + -- Shall not appear in minor version 1 or 2 +ENDIF +IF ( changeAccessControl ), +, changeAccessControl + [86] IMPLICIT ChangeAccessControl-Response + -- Shall not appear in minor version 1 or 2 +ENDIF + ,... + } + + AdditionalService-Response ::= CHOICE { +IF ( csr ) +IF ( vMDStop ) + vMDStop + [0] IMPLICIT VMDStop-Response +ELSE + vMDStop + [0] IMPLICIT RejectPDU +ENDIF +IF ( vMDReset ) +, vMDReset + [1] IMPLICIT VMDReset-Response +ELSE +, vMDReset + [1] IMPLICIT RejectPDU +ENDIF +IF ( select ) +, select + [2] IMPLICIT Select-Response +ELSE +, select + [2] IMPLICIT RejectPDU +ENDIF +IF ( alterProgramInvocationAttributes ) +, alterPI + [3] IMPLICIT AlterProgramInvocationAttributes-Response +ELSE +, alterPI + [3] IMPLICIT RejectPDU +ENDIF +ELSE +, vMDStop + [0] IMPLICIT RejectPDU, + vMDReset + [1] IMPLICIT RejectPDU, + select + [2] IMPLICIT RejectPDU, + alterPI + [3] IMPLICIT RejectPDU +ENDIF +IF ( cspi ) +IF ( initiateUnitControlLoad ) +, initiateUCLoad + [4] IMPLICIT InitiateUnitControlLoad-Response +ELSE +, initiateUCLoad + [4] IMPLICIT RejectPDU +ENDIF +IF ( unitControlLoadSegment ) +, uCLoad + [5] IMPLICIT UnitControlLoadSegment-Response +ELSE +, uCLoad + [5] IMPLICIT RejectPDU +ENDIF +IF ( unitControlUpload ) +, uCUpload + [6] IMPLICIT UnitControlUpload-Response +ELSE +, uCUpload + [6] IMPLICIT RejectPDU +ENDIF +IF ( startUnitControl ) +, startUC + [7] IMPLICIT StartUnitControl-Response +ELSE +, startUC + [7] IMPLICIT RejectPDU +ENDIF +IF ( stopUnitControl ) +, stopUC + [8] IMPLICIT StopUnitControl-Response +ELSE +, stopUC + [8] IMPLICIT RejectPDU +ENDIF +IF ( createUnitControl ) +, createUC + [9] IMPLICIT CreateUnitControl-Response +ELSE +, createUC + [9] IMPLICIT RejectPDU +ENDIF +IF ( addToUnitControl ) +, addToUC + [10] IMPLICIT AddToUnitControl-Response +ELSE +, addToUC + [10] IMPLICIT RejectPDU +ENDIF +IF ( removeFromUnitControl ) +, removeFromUC + [11] IMPLICIT RemoveFromUnitControl-Response +ELSE +, removeFromUC + [11] IMPLICIT RejectPDU +ENDIF +IF ( getUnitControlAttributes ) +, getUCAttributes + [12] IMPLICIT GetUnitControlAttributes-Response +ELSE +, getUCAttributes + [12] IMPLICIT RejectPDU +ENDIF +IF ( loadUnitControlFromFile ) +, loadUCFromFile + [13] IMPLICIT LoadUnitControlFromFile-Response +ELSE +, loadUCFromFile + [13] IMPLICIT RejectPDU +ENDIF +IF ( storeUnitControlToFile ) +, storeUCToFile + [14] IMPLICIT StoreUnitControlToFile-Response +ELSE +, storeUCToFile + [14] IMPLICIT RejectPDU +ENDIF +IF ( deleteUnitControl ) +, deleteUC + [15] IMPLICIT DeleteUnitControl-Response +ELSE +, deleteUC + [15] IMPLICIT RejectPDU +ENDIF +IF ( defineEventConditionList ) +, defineECL + [16] IMPLICIT DefineEventConditionList-Response +ELSE +, defineECL + [16] IMPLICIT RejectPDU +ENDIF +IF ( deleteEventConditionList ) +, deleteECL + [17] IMPLICIT DeleteEventConditionList-Response +ELSE +, deleteECL + [17] IMPLICIT RejectPDU +ENDIF +IF ( addEventConditionListReference ) +, addECLReference + [18] IMPLICIT AddEventConditionListReference-Response +ELSE +, addECLReference + [18] IMPLICIT RejectPDU +ENDIF +IF ( removeEventConditionListReference ) +, removeECLReference + [19] IMPLICIT RemoveEventConditionListReference-Response +ELSE +, removeECLReference + [19] IMPLICIT RejectPDU +ENDIF +IF ( getEventConditionListAttributes ) +, getECLAttributes + [20] IMPLICIT GetEventConditionListAttributes-Response +ELSE +, getECLAttributes + [20] IMPLICIT RejectPDU +ENDIF +IF ( reportEventConditionListStatus ) +, reportECLStatus + [21] IMPLICIT ReportEventConditionListStatus-Response +ELSE +, reportECLStatus + [21] IMPLICIT RejectPDU +ENDIF +IF ( alterEventConditionListMonitoring ) +, alterECLMonitoring + [22] IMPLICIT AlterEventConditionListMonitoring-Response +ELSE +, alterECLMonitoring + [22] IMPLICIT RejectPDU +ENDIF +ELSE +, initiateUCLoad + [4] IMPLICIT RejectPDU, + uCLoad + [5] IMPLICIT RejectPDU, + uCUpload + [6] IMPLICIT RejectPDU, + startUC + [7] IMPLICIT RejectPDU, + stopUC + [8] IMPLICIT RejectPDU, + createUC + [9] IMPLICIT RejectPDU, + addToUC + [10] IMPLICIT RejectPDU, + removeFromUC + [11] IMPLICIT RejectPDU, + getUCAttributes + [12] IMPLICIT RejectPDU, + loadUCFromFile + [13] IMPLICIT RejectPDU, + storeUCToFile + [14] IMPLICIT RejectPDU, + deleteUC + [15] IMPLICIT RejectPDU, + defineECL + [16] IMPLICIT RejectPDU, + deleteECL + [17] IMPLICIT RejectPDU, + addECLReference + [18] IMPLICIT RejectPDU, + removeECLReference + [19] IMPLICIT RejectPDU, + getECLAttributes + [20] IMPLICIT RejectPDU, + reportECLStatus + [21] IMPLICIT RejectPDU, + alterECLMonitoring + [22] IMPLICIT RejectPDU +ENDIF + } + + Response-Detail ::= CHOICE { + -- this choice shall be selected if the tag value of the + -- ConfirmedServiceResponse does not match any of the tags below + otherRequests NULL +IF ( status ) +, status + [0] CS-Status-Response +ENDIF +IF ( getProgramInvocationAttributes ) +, getProgramInvocationAttributes + [45] IMPLICIT CS-GetProgramInvocationAttributes-Response +ENDIF +IF ( getEventConditionAttributes ) +, getEventConditionAttributes + [49] IMPLICIT CS-GetEventConditionAttributes-Response +ENDIF + } + + Confirmed-ErrorPDU ::= SEQUENCE { + invokeID [0] IMPLICIT Unsigned32, +IF ( attachToEventCondition attachToSemaphore ) + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, +ENDIF + serviceError [2] IMPLICIT ServiceError + } + + ServiceError ::= SEQUENCE { + errorClass [0] CHOICE { + vmd-state [0] IMPLICIT INTEGER { + other (0), + vmd-state-conflict (1), + vmd-operational-problem (2), + domain-transfer-problem (3), + state-machine-id-invalid (4) + } (0..4), + application-reference [1] IMPLICIT INTEGER { + other (0), + application-unreachable (1), + connection-lost (2), + application-reference-invalid (3), + context-unsupported (4) + } (0..4), + definition [2] IMPLICIT INTEGER { + other (0), + object-undefined (1), + invalid-address (2), + type-unsupported (3), + type-inconsistent (4), + object-exists (5), + object-attribute-inconsistent (6) + } (0..6), + resource [3] IMPLICIT INTEGER { + other (0), + memory-unavailable (1), + processor-resource-unavailable (2), + mass-storage-unavailable (3), + capability-unavailable (4), + capability-unknown (5) + } (0..5), + service [4] IMPLICIT INTEGER { + other (0), + primitives-out-of-sequence (1), + object-state-conflict (2), + -- Value 3 reserved for further definition + continuation-invalid (4), + object-constraint-conflict (5) + } (0..5), + service-preempt [5] IMPLICIT INTEGER { + other (0), + timeout (1), + deadlock (2), + cancel (3) + } (0..3), + time-resolution [6] IMPLICIT INTEGER { + other (0), + unsupportable-time-resolution (1) + } (0..1), + access [7] IMPLICIT INTEGER { + other (0), + object-access-unsupported (1), + object-non-existent (2), + object-access-denied (3), + object-invalidated (4) + } (0..4), + initiate [8] IMPLICIT INTEGER { + other (0), + -- Values 1 and 2 are reserved for further definition + max-services-outstanding-calling-insufficient (3), + max-services-outstanding-called-insufficient (4), + service-CBB-insufficient (5), + parameter-CBB-insufficient (6), + nesting-level-insufficient (7) + } (0..7), + conclude [9] IMPLICIT INTEGER { + other (0), + further-communication-required (1) + } (0..1) +IF ( cancel ) +, cancel [10] IMPLICIT INTEGER { + other (0), + invoke-id-unknown (1), + cancel-not-possible (2) + } (0..2) +ELSE +, cancel [10] IMPLICIT NULL +ENDIF +IF ( fileOpen fileClose fileRead fileRename fileDelete fileDirectory obtainFile ) +, file [11] IMPLICIT INTEGER { + other (0), + filename-ambiguous (1), + file-busy (2), + filename-syntax-error (3), + content-type-invalid (4), + position-invalid (5), + file-access-denied (6), + file-non-existent (7), + duplicate-filename (8), + insufficient-space-in-filestore (9) + } (0..9) +ELSE +, file [11] IMPLICIT NULL +ENDIF +, others [12] IMPLICIT INTEGER + } , + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInfo [3] CHOICE { +IF ( obtainFile ) + obtainFile [0] IMPLICIT ObtainFile-Error +ELSE + obtainFile [0] IMPLICIT NULL +ENDIF +IF ( start ) +, start [1] IMPLICIT Start-Error +ELSE +, start [1] IMPLICIT NULL +ENDIF +IF ( stop ) +, stop [2] IMPLICIT Stop-Error +ELSE +, stop [2] IMPLICIT NULL +ENDIF +IF ( resume ) +, resume [3] IMPLICIT Resume-Error +ELSE +, resume [3] IMPLICIT NULL +ENDIF +IF ( reset ) +, reset [4] IMPLICIT Reset-Error +ELSE +, reset [4] IMPLICIT NULL +ENDIF +IF ( deleteVariableAccess ) +, deleteVariableAccess [5] IMPLICIT DeleteVariableAccess-Error +ELSE +, deleteVariableAccess [5] IMPLICIT NULL +ENDIF +IF ( deleteNamedVariableList ) +, deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList-Error +ELSE +, deleteNamedVariableList [6] IMPLICIT NULL +ENDIF +IF ( deleteNamedType ) +, deleteNamedType [7] IMPLICIT DeleteNamedType-Error +ELSE +, deleteNamedType [7] IMPLICIT NULL +ENDIF +IF ( defineEventEnrollment ) + , defineEventEnrollment-Error [8] DefineEventEnrollment-Error +ELSE + , defineEventEnrollment-Error [8] IMPLICIT NULL +ENDIF + -- [9] Reserved for use by annex D +IF ( fileRename ) +, fileRename [9] IMPLICIT FileRename-Error +ELSE +, fileRename [9] IMPLICIT NULL +ENDIF +IF ( csr cspi ) +, additionalService [10] AdditionalService-Error +ELSE +, additionalService [10] IMPLICIT NULL +ENDIF +IF ( changeAccessControl ) +, changeAccessControl [11] IMPLICIT ChangeAccessControl-Error +ELSE + changeAccessControl 11] IMPLICIT NULL +ENDIF + } OPTIONAL + } + + AdditionalService-Error ::= CHOICE { +IF ( defineEventConditionList ) + defineEcl [0] DefineEventConditionList-Error +ELSE + defineEcl [0] IMPLICIT NULL +ENDIF +IF ( addEventConditionListReference ) +, addECLReference [1] AddEventConditionListReference-Error +ELSE +, addECLReference [1] IMPLICIT NULL +ENDIF +IF ( removeEventConditionListReference ) +, removeECLReference [2] RemoveEventConditionListReference-Error +ELSE +, removeECLReference [2] IMPLICIT NULL +ENDIF +IF ( initiateUnitControlLoad ) +, initiateUC [3] InitiateUnitControl-Error +ELSE +, initiateUC [3] IMPLICIT NULL +ENDIF +IF ( startUnitControl ) +, startUC [4] IMPLICIT StartUnitControl-Error +ELSE +, startUC [4] IMPLICIT NULL +ENDIF +IF ( stopUnitControl ) +, stopUC [5] IMPLICIT StopUnitControl-Error +ELSE +, stopUC [5] IMPLICIT NULL +ENDIF +IF ( deleteUnitControl ) +, deleteUC [6] DeleteUnitControl-Error +ELSE +, deleteUC [6] IMPLICIT NULL +ENDIF +IF ( loadUnitControlFromFile ) +, loadUCFromFile [7] LoadUnitControlFromFile-Error +ELSE +, loadUCFromFile [7] IMPLICIT NULL +ENDIF + } + + TimeOfDay ::= OCTET STRING (SIZE(4|6)) + + maxIdentifier INTEGER ::= 32 + +Identifier ::= +IF (char) + UTF8String (SIZE(1..maxIdentifier)) +ELSE + VisibleString ( FROM + ("A"|"a"|"B"|"b"|"C"|"c"|"D"|"d"|"E"|"e"|"F"|"f"| + "G"|"g"|"H"|"h"|"I"|"i"|"J"|"j"|"K"|"k"|"L"|"l"| + "M"|"m"|"N"|"n"|"O"|"o"|"P"|"p"|"Q"|"q"|"R"|"r"| + "S"|"s"|"T"|"t"|"U"|"u"|"V"|"v"|"W"|"w"|"X"|"x"| + "Y"|"y"|"Z"|"z"|"$"|"_"|"0"|"1"|"2"|"3"|"4"|"5"| + "6"|"7"|"8"|"9") ) (SIZE(1..maxIdentifier)) +ENDIF + + Integer8 ::= INTEGER(-128..127) -- range -128 <= i <= 127 + + Integer16 ::= INTEGER(-32768..32767) -- range -32,768 <= i <= 32,767 + + Integer32 ::= INTEGER(-2147483648..2147483647) -- range -2**31 <= i <= 2**31 - 1 + + Unsigned8 ::= INTEGER(0..127) -- range 0 <= i <= 127 + + Unsigned16 ::= INTEGER(0..32767) -- range 0 <= i <= 32767 + + Unsigned32 ::= INTEGER(0..2147483647) -- range 0 <= i <= 2**31 - 1 + + ObjectName ::= CHOICE { + vmd-specific [0] IMPLICIT Identifier, + domain-specific [1] IMPLICIT SEQUENCE { + domainID Identifier, + itemID Identifier + }, + aa-specific [2] IMPLICIT Identifier + } + + ObjectClass ::= CHOICE { + basicObjectClass [0] IMPLICIT INTEGER { +IF ( vnam ) + namedVariable (0) +ENDIF + -- value 1 is reserved for definition in Annex E +IF ( vsca ) +, scatteredAccess (1) +ENDIF +IF ( vlis ) +, namedVariableList (2) +ENDIF +IF ( vnam ) +, namedType (3) +ENDIF +, semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11), + dataExchange (12), + -- Shall not appear in minor version 1 + accessControlList (13) + -- Shall not appear in minor version 1 or 2 + } (0..13), + ... +IF ( cspi ) +, csObjectClass [1] IMPLICIT INTEGER { + eventConditionList (0), + unitControl (1) } (0..1) +ENDIF + } + + MMSString ::= +IF ( char ) + UTF8String +ELSE + VisibleString +ENDIF + + MMS255String ::= +IF ( char ) + UTF8String (SIZE(1..255)) +ELSE + VisibleString (SIZE(1..255)) +ENDIF + + FileName ::= SEQUENCE OF GraphicString + + Initiate-RequestPDU ::= SEQUENCE { + + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initRequestDetail [4] IMPLICIT SEQUENCE { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions , + ... +IF (csr cspi) +, additionalSupportedCalling [3] IMPLICIT AdditionalSupportOptions +ENDIF +IF (cspi) +, additionalCbbSupportedCalling [4] IMPLICIT AdditionalCBBOptions, + privilegeClassIdentityCalling [5] IMPLICIT VisibleString +ENDIF + } + } + + Initiate-ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initResponseDetail [4] IMPLICIT SEQUENCE { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions, + ... +IF (csr cspi) +, additionalSupportedCalled [3] IMPLICIT AdditionalSupportOptions +ENDIF +IF (cspi ) +, additionalCbbSupportedCalled [4] IMPLICIT AdditionalCBBOptions, + privilegeClassIdentityCalled [5] IMPLICIT VisibleString +ENDIF + } + } + + Initiate-ErrorPDU ::= ServiceError + + Conclude-RequestPDU ::= NULL + + Conclude-ResponsePDU ::= NULL + + Conclude-ErrorPDU ::= ServiceError + + Cancel-RequestPDU ::= Unsigned32 -- originalInvokeID + + Cancel-ResponsePDU ::= Unsigned32 -- originalInvokeID + + Cancel-ErrorPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError + } + + RejectPDU ::= SEQUENCE { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE { + confirmed-requestPDU [1] IMPLICIT INTEGER { + other (0), + unrecognized-service (1), + unrecognized-modifier (2), + invalid-invokeID (3), + invalid-argument (4), + invalid-modifier (5), + max-serv-outstanding-exceeded (6), + -- Value 7 reserved for further definition + max-recursion-exceeded (8), + value-out-of-range (9) + } (0..9), + confirmed-responsePDU [2] IMPLICIT INTEGER { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-result (3), + -- Value 4 reserved for further definition + max-recursion-exceeded (5), + value-out-of-range (6) + } (0..6), + confirmed-errorPDU [3] IMPLICIT INTEGER { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-serviceError (3), + value-out-of-range (4) + } (0..4), + unconfirmedPDU [4] IMPLICIT INTEGER { + other (0), + unrecognized-service (1), + invalid-argument (2), + max-recursion-exceeded (3), + value-out-of-range (4) + } (0..4), + pdu-error [5] IMPLICIT INTEGER { + unknown-pdu-type (0), + invalid-pdu (1), + illegal-acse-mapping (2) + }, +IF ( cancel ) + cancel-requestPDU [6] IMPLICIT INTEGER { + other (0), + invalid-invokeID (1) + } (0..1), + cancel-responsePDU [7] IMPLICIT INTEGER { + other (0), + invalid-invokeID (1) + } (0..1), + cancel-errorPDU [8] IMPLICIT INTEGER { + other (0), + invalid-invokeID (1), + invalid-serviceError (2), + value-out-of-range (3) + } (0..3), +ELSE + cancel-requestPDU [6] IMPLICIT NULL, + cancel-responsePDU [7] IMPLICIT NULL, + cancel-errorPDU [8] IMPLICIT NULL, +ENDIF + conclude-requestPDU [9] IMPLICIT INTEGER { + other (0), + invalid-argument (1) + } (0..1), + conclude-responsePDU [10] IMPLICIT INTEGER { + other (0), + invalid-result (1) + } (0..1), + conclude-errorPDU [11] IMPLICIT INTEGER { + other (0), + invalid-serviceError (1), + value-out-of-range (2) + } (0..2) + } + } + + DefineAccessControlList-Request ::= SEQUENCE { + accessControlListName [0] IMPLICIT Identifier, + accessControlListElements [1] IMPLICIT SEQUENCE { + readAccessCondition [0] AccessCondition OPTIONAL, + storeAccessCondition [1] AccessCondition OPTIONAL, + writeAccessCondition [2] AccessCondition OPTIONAL, + loadAccessCondition [3] AccessCondition OPTIONAL, + executeAccessCondition [4] AccessCondition OPTIONAL, + deleteAccessCondition [5] AccessCondition OPTIONAL, + editAccessCondition [6] AccessCondition OPTIONAL + } + } + + DefineAccessControlList-Response ::= NULL + + GetAccessControlListAttributes-Request ::= CHOICE { + accessControlListName [0] IMPLICIT Identifier, + vMD [1] IMPLICIT NULL, + namedObject [2] IMPLICIT SEQUENCE { + objectClass [0] ObjectClass, + objectName [1] ObjectName + } + } + + GetAccessControlListAttributes-Response ::= SEQUENCE { + name [0] Identifier, + accessControlListElements [1] IMPLICIT SEQUENCE { + readAccessCondition [0] AccessCondition OPTIONAL, + storeAccessCondition [1] AccessCondition OPTIONAL, + writeAccessCondition [2] AccessCondition OPTIONAL, + loadAccessCondition [3] AccessCondition OPTIONAL, + executeAccessCondition [4] AccessCondition OPTIONAL, + deleteAccessCondition [5] AccessCondition OPTIONAL, + editAccessCondition [6] AccessCondition OPTIONAL + }, + vMDuse [2] IMPLICIT BOOLEAN, + references [3] IMPLICIT SEQUENCE OF SEQUENCE { + objectClass [0] ObjectClass, + objectCount [1] IMPLICIT INTEGER + } +IF ( aco ) +, accessControlList [4] IMPLICIT Identifier OPTIONAL + -- shall be included if and only if + -- aco has been negotiated +ENDIF + } + + ReportAccessControlledObjects-Request ::= SEQUENCE { + accessControlList [0] IMPLICIT Identifier, + objectClass [1] ObjectClass, + continueAfter [2] ObjectName OPTIONAL + } + +ReportAccessControlledObjects-Response ::= SEQUENCE { + listOfNames [0] IMPLICIT SEQUENCE OF ObjectName, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + DeleteAccessControlList-Request ::= Identifier + -- Name of Access Control List Object + + DeleteAccessControlList-Response ::= NULL + + ChangeAccessControl-Request ::= SEQUENCE { + scopeOfChange CHOICE { + vMDOnly [0] IMPLICIT NULL, + listOfObjects [1] IMPLICIT SEQUENCE { + objectClass [0] ObjectClass, + objectScope [1] CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + -- Names of the objects (of class objectClass) + -- whose access is to be changed + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + -- Name of the Domain whose elements + -- are to be changed + vmd [3] IMPLICIT NULL + } + } + }, + accessControlListName [2] IMPLICIT Identifier + -- name of the AccessControlList Object that contains + -- the conditions for access control + } + + ChangeAccessControl-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberChanged [1] IMPLICIT Unsigned32 + } + + ChangeAccessControl-Error ::= Unsigned32 + + StatusResponse ::= SEQUENCE { + vmdLogicalStatus [0] IMPLICIT INTEGER { + state-changes-allowed (0), + no-state-changes-allowed (1), + limited-services-permitted (2), + support-services-allowed (3) + } (0..3), + vmdPhysicalStatus [1] IMPLICIT INTEGER { + operational (0), + partially-operational (1), + inoperable (2), + needs-commissioning (3) + } (0..3), + localDetail [2] IMPLICIT BIT STRING (SIZE(0..128)) OPTIONAL + } + + CS-Status-Response ::= CHOICE { +IF ( csr ) + fullResponse SEQUENCE { + operationState [0] IMPLICIT OperationState, + extendedStatus [1] IMPLICIT ExtendedStatus, + extendedStatusMask [2] IMPLICIT ExtendedStatus DEFAULT '1111'B, + selectedProgramInvocation CHOICE { + programInvocation [3] IMPLICIT Identifier, + noneSelected [4] IMPLICIT NULL } } +ENDIF +IF ( csr cspi ) +, +ENDIF +IF ( cspi ) + noExtraResponse NULL +ENDIF + } + + OperationState ::= INTEGER { + idle (0), + loaded (1), + ready (2), + executing (3), + motion-paused (4), + manualInterventionRequired (5) } (0..5) + + ExtendedStatus ::= BIT STRING { + safetyInterlocksViolated (0), + anyPhysicalResourcePowerOn (1), + allPhysicalResourcesCalibrated (2), + localControl (3) } (SIZE(4)) + + Status-Request ::= BOOLEAN -- Extended Derivation + + Status-Response ::= StatusResponse + + UnsolicitedStatus ::= StatusResponse + + GetNameList-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + objectScope [1] CHOICE { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL }, + continueAfter [2] IMPLICIT Identifier OPTIONAL } + + GetNameList-Response ::= SEQUENCE { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + Identify-Request ::= NULL + + Identify-Response ::= SEQUENCE { + vendorName [0] IMPLICIT MMSString, + modelName [1] IMPLICIT MMSString, + revision [2] IMPLICIT MMSString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL + } + + Rename-Request ::= SEQUENCE { + objectClass [0] ObjectClass, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier } + + Rename-Response ::= NULL + + GetCapabilityList-Request ::= SEQUENCE { + continueAfter MMSString OPTIONAL + } + + GetCapabilityList-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF MMSString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + VMDStop-Request ::= NULL + + VMDStop-Response ::= NULL + + VMDReset-Request ::= BOOLEAN -- Extended Derivation + + VMDReset-Response ::= StatusResponse + + InitiateDownloadSequence-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString, + sharable [2] IMPLICIT BOOLEAN } + + InitiateDownloadSequence-Response ::= NULL + + DownloadSegment-Request ::= Identifier -- Domain Name + + DownloadSegment-Response ::= SEQUENCE { + loadData LoadData, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + LoadData ::= CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL, + embedded EMBEDDED PDV } + + TerminateDownloadSequence-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL } + + TerminateDownloadSequence-Response ::= NULL + + InitiateUploadSequence-Request ::= Identifier -- Domain Name + + InitiateUploadSequence-Response ::= SEQUENCE { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString } + + UploadSegment-Request ::= Integer32 -- ULSM ID + + UploadSegment-Response ::= SEQUENCE { + loadData LoadData, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + TerminateUploadSequence-Request ::= Integer32 -- ULSM ID + + TerminateUploadSequence-Response ::= NULL + + RequestDomainDownload-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName } + + RequestDomainDownload-Response ::= NULL + + RequestDomainUpload-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName } + + RequestDomainUpload-Response ::= NULL + + LoadDomainContent-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF MMSString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName +IF ( tpy ) +, thirdParty [5] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + LoadDomainContent-Response ::= NULL + + StoreDomainContent-Request ::= SEQUENCE { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName +IF ( tpy ) +, thirdParty [2] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + StoreDomainContent-Response ::= NULL + + DeleteDomain-Request ::= Identifier -- Domain Name + + DeleteDomain-Response ::= NULL + + GetDomainAttributes-Request ::= Identifier -- Domain Name + + GetDomainAttributes-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF MMSString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, + -- Program Invocation Names + uploadInProgress [5] IMPLICIT Integer8 +IF ( aco ) +, accessControlList [6] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + CreateProgramInvocation-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE +IF ( eventNotification ) +IF ( getProgramInvocationAttributes ) +, monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring, + -- FALSE indicates CURRENT monitoring +ENDIF +ENDIF + } + + CreateProgramInvocation-Response ::= NULL + + CS-CreateProgramInvocation-Request ::= INTEGER { + normal (0), + controlling (1), + controlled (2) + } (0..2) + + DeleteProgramInvocation-Request ::= Identifier -- Program Invocation Name + + DeleteProgramInvocation-Response ::= NULL + + Start-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + embeddedString EMBEDDED PDV } OPTIONAL } + + Start-Response ::= NULL + + Start-Error ::= ProgramInvocationState + + CS-Start-Request ::= [0] CHOICE { + normal NULL, + controlling SEQUENCE { + startLocation [0] IMPLICIT VisibleString OPTIONAL, + startCount [1] StartCount DEFAULT cycleCount: 1 + } } + + StartCount ::= CHOICE { + noLimit [0] IMPLICIT NULL, + cycleCount [1] IMPLICIT INTEGER, + stepCount [2] IMPLICIT INTEGER } + + Stop-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier } + + Stop-Response ::= NULL + + Stop-Error ::= ProgramInvocationState + + Resume-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV } OPTIONAL + } + + Resume-Response ::= NULL + + Resume-Error ::= ProgramInvocationState + + CS-Resume-Request ::= [0] CHOICE { + normal NULL, + controlling SEQUENCE { + modeType CHOICE { + continueMode [0] IMPLICIT NULL, + changeMode [1] StartCount + } } } + + Reset-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier } + + Reset-Response ::= NULL + + Reset-Error ::= ProgramInvocationState + + Kill-Request ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier } + + Kill-Response ::= NULL + + GetProgramInvocationAttributes-Request ::= Identifier -- Program Invocation Name + + GetProgramInvocationAttributes-Response ::= SEQUENCE { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + executionArgument CHOICE { + simpleString [5] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV } +IF ( aco ) +, accessControlList [6] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + CS-GetProgramInvocationAttributes-Response ::= SEQUENCE { + errorCode [0] IMPLICIT INTEGER, + control [1] CHOICE { + controlling [0] IMPLICIT SEQUENCE { + controlledPI [0] IMPLICIT SEQUENCE OF Identifier, + programLocation [1] IMPLICIT VisibleString OPTIONAL, + runningMode [2] CHOICE { + freeRunning [0] IMPLICIT NULL, + cycleLimited [1] IMPLICIT INTEGER, + stepLimited [2] IMPLICIT INTEGER } + }, + controlled [1] CHOICE { + controllingPI [0] IMPLICIT Identifier, + none [1] IMPLICIT NULL + }, + normal [2] IMPLICIT NULL } } + + Select-Request ::= SEQUENCE { + controlling [0] IMPLICIT Identifier OPTIONAL, + controlled [1] IMPLICIT SEQUENCE OF Identifier OPTIONAL + -- this field shall appear if and only if the controlling field is included + } + + Select-Response ::= NULL + + AlterProgramInvocationAttributes-Request ::= SEQUENCE { + programInvocation [0] IMPLICIT Identifier, + startCount [1] StartCount DEFAULT cycleCount: 1 } + + AlterProgramInvocationAttributes-Response ::= NULL + + ReconfigureProgramInvocation-Request ::= SEQUENCE { + oldProgramInvocationName [0] IMPLICIT Identifier, + newProgramInvocationName [1] IMPLICIT Identifier OPTIONAL, + domainsToAdd [2] IMPLICIT SEQUENCE OF Identifier, + domainsToRemove [3] IMPLICIT SEQUENCE OF Identifier } + + ReconfigureProgramInvocation-Response ::= NULL + + ControlElement ::= CHOICE { + beginDomainDef [0] SEQUENCE { + domainName [1] IMPLICIT Identifier, + capabilities [2] IMPLICIT SEQUENCE OF MMSString, + sharable [3] IMPLICIT BOOLEAN, + loadData [4] LoadData OPTIONAL + }, + continueDomainDef [1] SEQUENCE { + domainName [1] IMPLICIT Identifier, + loadData [3] LoadData + }, + endDomainDef [2] IMPLICIT Identifier, + piDefinition [3] IMPLICIT SEQUENCE { + piName [0] IMPLICIT Identifier, + listOfDomains [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL, + pIState [4] IMPLICIT ProgramInvocationState OPTIONAL + } } + + InitiateUnitControlLoad-Request ::= Identifier -- Unit Control Name + + InitiateUnitControlLoad-Response ::= NULL + + InitiateUnitControl-Error ::= CHOICE { + domain [0] IMPLICIT Identifier, + programInvocation [1] IMPLICIT Identifier + } + + UnitControlLoadSegment-Request ::= Identifier -- Unit Control Name + + UnitControlLoadSegment-Response ::= SEQUENCE { + controlElements [0] IMPLICIT SEQUENCE OF ControlElement, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + UnitControlUpload-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, -- Unit Control Name + continueAfter CHOICE { + domain [1] IMPLICIT Identifier, + ulsmID [2] IMPLICIT INTEGER, + programInvocation [3] IMPLICIT Identifier } OPTIONAL + } + + UnitControlUpload-Response ::= SEQUENCE { + controlElements [0] IMPLICIT SEQUENCE OF ControlElement, + nextElement CHOICE { + domain [1] IMPLICIT Identifier, + ulsmID [2] IMPLICIT INTEGER, + programInvocation [3] IMPLICIT Identifier } OPTIONAL + } + + StartUnitControl-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, -- Unit Control Name + executionArgument CHOICE { + simpleString [1] IMPLICIT MMSString, + encodedString EXTERNAL, + enmbeddedString EMBEDDED PDV } OPTIONAL + } + + StartUnitControl-Response ::= NULL + + StartUnitControl-Error ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + programInvocationState [1] IMPLICIT ProgramInvocationState } + + StopUnitControl-Request ::= Identifier -- Unit Control Name + + StopUnitControl-Response ::= NULL + + StopUnitControl-Error ::= SEQUENCE { + programInvocationName [0] IMPLICIT Identifier, + programInvocationState [1] IMPLICIT ProgramInvocationState } + + CreateUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier } + + CreateUnitControl-Response ::= NULL + + AddToUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier } + + AddToUnitControl-Response ::= NULL + + RemoveFromUnitControl-Request ::= SEQUENCE { + unitControl [0] IMPLICIT Identifier, -- Unit Control Name + domains [1] IMPLICIT SEQUENCE OF Identifier, + programInvocations [2] IMPLICIT SEQUENCE OF Identifier } + + RemoveFromUnitControl-Response ::= NULL + + GetUnitControlAttributes-Request ::= Identifier -- Unit Control Name + + GetUnitControlAttributes-Response ::= SEQUENCE { + domains [0] IMPLICIT SEQUENCE OF Identifier, + programInvocations [1] IMPLICIT SEQUENCE OF Identifier } + + LoadUnitControlFromFile-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName +IF ( tpy ) +, thirdParty [2] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + LoadUnitControlFromFile-Response ::= NULL + + LoadUnitControlFromFile-Error ::= CHOICE { + none [0] IMPLICIT NULL, + domain [1] IMPLICIT Identifier, + programInvocation [2] IMPLICIT Identifier + } + + StoreUnitControlToFile-Request ::= SEQUENCE { + unitControlName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName +IF ( tpy ) +, thirdParty [2] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + StoreUnitControlToFile-Response ::= NULL + + DeleteUnitControl-Request ::= Identifier -- Unit Control Name + + DeleteUnitControl-Response ::= NULL + + DeleteUnitControl-Error ::= CHOICE { + domain [0] IMPLICIT Identifier, + programInvocation [1] IMPLICIT Identifier } + + TypeSpecification ::= CHOICE { + typeName [0] ObjectName, + typeDescription TypeDescription } + + AlternateAccess ::= SEQUENCE OF CHOICE { + unnamed AlternateAccessSelection +IF ( str2 ) +, named [5] IMPLICIT SEQUENCE { + componentName [0] IMPLICIT Identifier, + access AlternateAccessSelection } +ENDIF + } + + AlternateAccessSelection ::= CHOICE { + selectAlternateAccess [0] IMPLICIT SEQUENCE { + accessSelection CHOICE { +IF ( str2 ) + component [0] IMPLICIT Identifier, +ELSE + component [0] IMPLICIT NULL, +ENDIF +IF ( str1 ) + index [1] IMPLICIT Unsigned32, + indexRange [2] IMPLICIT SEQUENCE { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, +ELSE + index [1] IMPLICIT NULL, + indexRange [2] IMPLICIT NULL, +ENDIF + allElements [3] IMPLICIT NULL + }, + alternateAccess AlternateAccess + }, + selectAccess CHOICE { +IF ( str2 ) + component [1] IMPLICIT Identifier, +ELSE + component [1] IMPLICIT NULL, +ENDIF +IF ( str1 ) + index [2] IMPLICIT Unsigned32, + indexRange [3] IMPLICIT SEQUENCE { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, +ELSE + index [2] IMPLICIT NULL, + indexRange [3] IMPLICIT NULL, +ENDIF + allElements [4] IMPLICIT NULL + } } + + AccessResult ::= CHOICE { + failure [0] IMPLICIT DataAccessError, + success Data } + + Data ::= CHOICE { + -- context tag 0 is reserved for AccessResult +IF ( str1 ) + array [1] IMPLICIT SEQUENCE OF Data, +ELSE + array [1] IMPLICIT NULL, +ENDIF +IF ( str2 ) + structure [2] IMPLICIT SEQUENCE OF Data, +ELSE + structure [2] IMPLICIT NULL, +ENDIF + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, -- shall not be negative + floating-point [7] IMPLICIT FloatingPoint, + -- [8] is reserved + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + generalized-time [11] IMPLICIT GeneralizedTime, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, -- shall not be negative + booleanArray [14] IMPLICIT BIT STRING, + objId [15] IMPLICIT OBJECT IDENTIFIER, + ..., + mMSString [16] IMPLICIT MMSString + } + + FloatingPoint ::= OCTET STRING + + DataAccessError ::= INTEGER { + object-invalidated (0), + hardware-fault (1), + temporarily-unavailable (2), + object-access-denied (3), + object-undefined (4), + invalid-address (5), + type-unsupported (6), + type-inconsistent (7), + object-attribute-inconsistent (8), + object-access-unsupported (9), + object-non-existent (10), + object-value-invalid (11) + } (0..11) + + VariableAccessSpecification ::= CHOICE { + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification, +IF ( valt ) + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL +ENDIF + } +IF ( vlis ) +, variableListName [1] ObjectName +ENDIF + } + + VariableSpecification ::= CHOICE { +IF ( vnam ) + name [0] ObjectName, +ENDIF +IF ( vadr ) + address [1] Address, + variableDescription [2] IMPLICIT SEQUENCE { + address Address, + typeSpecification TypeSpecification + }, +ENDIF + -- the following element is only present to support the services + -- defined in annex E +IF ( vsca ) + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, +ELSE + scatteredAccessDescription [3] IMPLICIT NULL, +ENDIF + invalidated [4] IMPLICIT NULL + } + + Read-Request ::= SEQUENCE { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification } + + Read-Response ::= SEQUENCE { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult } + + Write-Request ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data } + + Write-Response ::= SEQUENCE OF CHOICE { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL } + + InformationReport ::= SEQUENCE { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult } + + GetVariableAccessAttributes-Request ::= CHOICE { +IF ( vnam ) + name [0] ObjectName +IF ( vadr ) +, +ENDIF +IF ( vadr) + address [1] Address +ENDIF + } + + GetVariableAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, +IF ( vadr ) + address [1] Address OPTIONAL, +ENDIF + typeDescription [2] TypeDescription +IF ( aco ) +, accessControlList [3] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF +IF ( sem ) +, meaning [4] IMPLICIT VisibleString OPTIONAL +ENDIF + } + + DefineNamedVariable-Request ::= SEQUENCE { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL } + + DefineNamedVariable-Response ::= NULL + + DeleteVariableAccess-Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } (0..3) DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL } + + DeleteVariableAccess-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 } + + DeleteVariableAccess-Error ::= Unsigned32 -- numberDeleted + + DefineNamedVariableList-Request ::= SEQUENCE { + variableListName ObjectName, + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification +IF (valt) +, alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL +ENDIF + } } + + DefineNamedVariableList-Response ::= NULL + + GetNamedVariableListAttributes-Request ::= ObjectName -- VariableListName + + GetNamedVariableListAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT SEQUENCE OF SEQUENCE { + variableSpecification VariableSpecification +IF ( valt ) +, alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL } +ENDIF +IF ( aco ) +, accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + DeleteNamedVariableList-Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } (0..3) DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL } + + DeleteNamedVariableList-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 } + + DeleteNamedVariableList-Error ::= Unsigned32 -- numberDeleted + + DefineNamedType-Request ::= SEQUENCE { + typeName ObjectName, + typeSpecification TypeSpecification } + + DefineNamedType-Response ::= NULL + + GetNamedTypeAttributes-Request ::= ObjectName --TypeName + + GetNamedTypeAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification +IF ( aco ) +, accessControlList [1] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF +IF ( sem ) +, meaning [4] IMPLICIT VisibleString OPTIONAL +ENDIF + } + + DeleteNamedType-Request ::= SEQUENCE { + scopeOfDelete [0] IMPLICIT INTEGER { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } (0..3) DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL } + + DeleteNamedType-Response ::= SEQUENCE { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + DeleteNamedType-Error ::= Unsigned32 -- numberDeleted + + ExchangeData-Request ::= SEQUENCE { + dataExchangeName [0] ObjectName, + listOfRequestData [1] IMPLICIT SEQUENCE OF Data } + + ExchangeData-Response ::= SEQUENCE { + listOfResponseData [0] IMPLICIT SEQUENCE OF Data } + + GetDataExchangeAttributes-Request ::= ObjectName + + GetDataExchangeAttributes-Response ::= SEQUENCE { + inUse [0] IMPLICIT BOOLEAN, + listOfRequestTypeDescriptions [1] IMPLICIT SEQUENCE OF TypeDescription, + listOfResponseTypeDescriptions [2] IMPLICIT SEQUENCE OF TypeDescription, + programInvocation [3] IMPLICIT Identifier OPTIONAL +IF (aco) +, accessControlList [4] IMPLICIT Identifier OPTIONAL +ENDIF + -- Shall not appear in minor version one or two + } + + TakeControl-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE +IF ( tpy ) +, applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL +ENDIF + } + + TakeControl-Response ::= CHOICE { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier } + + RelinquishControl-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL } + + RelinquishControl-Response ::= NULL + + DefineSemaphore-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + numberOfTokens [1] IMPLICIT Unsigned16 } + + DefineSemaphore-Response ::= NULL + + DeleteSemaphore-Request ::= ObjectName -- Semaphore Name + + DeleteSemaphore-Response ::= NULL + + ReportSemaphoreStatus-Request ::= ObjectName -- Semaphore Name + + ReportSemaphoreStatus-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER { + token (0), + pool (1) } (0..1), + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16 +IF (aco) +, accessControlList [5] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + ReportPoolSemaphoreStatus-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL } + + ReportPoolSemaphoreStatus-Response ::= SEQUENCE { + listOfNamedTokens [0] IMPLICIT SEQUENCE OF CHOICE { + freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + ReportSemaphoreEntryStatus-Request ::= SEQUENCE { + semaphoreName [0] ObjectName, + state [1] IMPLICIT INTEGER { + queued (0), + owner (1), + hung (2) } (0..2), + entryIDToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL } + + ReportSemaphoreEntryStatus-Response ::= SEQUENCE { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + SemaphoreEntry ::= SEQUENCE { + entryID [0] IMPLICIT OCTET STRING, + entryClass [1] IMPLICIT INTEGER { + simple (0), + modifier (1) } (0..1), + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT normalPriority, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE } + + AttachToSemaphore ::= SEQUENCE { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE } + + Input-Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, +IF (output) + listOfPromptData [2] IMPLICIT SEQUENCE OF MMSString OPTIONAL, +ENDIF + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL } + + Input-Response ::= MMSString -- Input String + + Output-Request ::= SEQUENCE { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF MMSString } + + Output-Response ::= NULL + + TriggerEvent-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL } + + TriggerEvent-Response ::= NULL + + EventNotification ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + severity [2] IMPLICIT Severity, + currentState [3] IMPLICIT EC-State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult [8] IMPLICIT SEQUENCE { + eventActionName ObjectName, + successOrFailure CHOICE { + success [0] IMPLICIT SEQUENCE { + confirmedServiceResponse ConfirmedServiceResponse +IF ( csr cspi ) +, cs-Response-Detail [79] Response-Detail OPTIONAL + -- shall not be transmitted if value is the + -- value of a tagged type derived from NULL +ENDIF + }, + failure [1] IMPLICIT SEQUENCE { + modifierPosition [0] IMPLICIT Unsigned32 OPTIONAL, + serviceError [1] IMPLICIT ServiceError } + } + } OPTIONAL + } + + CS-EventNotification ::= [0] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + + AcknowledgeEventNotification-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC-State, + timeOfAcknowledgedTransition [3] EventTime } + + AcknowledgeEventNotification-Response ::= NULL + + GetAlarmSummary-Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgementFilter [2] IMPLICIT INTEGER { + not-acked (0), + acked (1), + all (2) + } (0..2) DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 } + DEFAULT { mostSevere 0, leastSevere 127 }, + continueAfter [5] ObjectName OPTIONAL + } + + GetAlarmSummary-Response ::= SEQUENCE { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + AlarmSummary ::= SEQUENCE { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC-State, + unacknowledgedState [3] IMPLICIT INTEGER { + none (0), + active (1), + idle (2), + both (3) + } (0..3), +IF ( csr cspi ) + displayEnhancement [4] EN-Additional-Detail OPTIONAL, + -- shall not be transmitted if the value is NULL +ELSE + displayEnhancement [4] NULL, +ENDIF + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL } + + EN-Additional-Detail ::= [0] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + + GetAlarmEnrollmentSummary-Request ::= SEQUENCE { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgementFilter [2] IMPLICIT INTEGER { + not-acked (0), + acked (1), + all (2) + } (0..2) DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 } + DEFAULT { mostSevere 0, leastSevere 127 }, + continueAfter [5] ObjectName OPTIONAL + } + + GetAlarmEnrollmentSummary-Response ::= SEQUENCE { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF +AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + AlarmEnrollmentSummary ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, +IF ( tpy ) + clientApplication [2] ApplicationReference OPTIONAL, +ELSE + clientApplication [2] NULL, +ENDIF + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC-State, +IF ( cspi ) + displayEnhancement [5] EN-Additional-Detail OPTIONAL, + -- shall not be transmitted if the value is NULL +ELSE + displayEnhancement [5] NULL, +ENDIF + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule, + enrollmentState [8] IMPLICIT EE-State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL } + + AttachToEventCondition ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL } + + DefineEventCondition-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC-Class, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + severity [3] IMPLICIT Unsigned8 DEFAULT normalSeverity, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL } + + DefineEventCondition-Response ::= NULL + + CS-DefineEventCondition-Request ::= [0] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + + DeleteEventCondition-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL } + + DeleteEventCondition-Response ::= Unsigned32 --Candidates Not Deleted + + GetEventConditionAttributes-Request ::= ObjectName --Event Condition Name + + GetEventConditionAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC-Class, + priority [2] IMPLICIT Priority DEFAULT normalPriority, + severity [3] IMPLICIT Unsigned8 DEFAULT normalSeverity, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable [6] CHOICE { + variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL } OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL +IF (aco), + accessControlList [8] IMPLICIT Identifier OPTIONAL +ENDIF + -- Shall not appear in minor version one or two + } + + CS-GetEventConditionAttributes-Response ::= SEQUENCE { + groupPriorityOverride [0] CHOICE { + priority [0] IMPLICIT Priority, + undefined [1] IMPLICIT NULL } OPTIONAL, + listOfReferencingECL [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + displayEnhancement [2] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement [2] IMPLICIT NULL } + } + + ReportEventConditionStatus-Request ::= ObjectName --Event Condition Name + + ReportEventConditionStatus-Response ::= SEQUENCE { + currentState [0] IMPLICIT EC-State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL } + + AlterEventConditionMonitoring-Request ::= SEQUENCE { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL +IF ( cei ) +, evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL +ENDIF + -- At least one of enabled, priority, alarmSummaryReports, or + -- evaluationInterval shall be present. + } + + AlterEventConditionMonitoring-Response ::= NULL + + CS-AlterEventConditionMonitoring-Request ::= SEQUENCE { + changeDisplay CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement [2] NULL } OPTIONAL + } + + DefineEventAction-Request ::= SEQUENCE { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL, + confirmedServiceRequest [2] ConfirmedServiceRequest +IF ( csr cspi ) +, cs-extension [79] Request-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL +ENDIF + } + + DefineEventAction-Response ::= NULL + + DeleteEventAction-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL } + + DeleteEventAction-Response ::= Unsigned32 --Candidates Not Deleted + + GetEventActionAttributes-Request ::= ObjectName --EventActionName + + GetEventActionAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier, + confirmedServiceRequest [2] ConfirmedServiceRequest +IF ( csr cspi ) +, cs-extension [79] Request-Detail OPTIONAL + -- shall not be transmitted if value is the value + -- of a tagged type derived from NULL +ENDIF +IF (aco) +, accessControlList [3] IMPLICIT Identifier OPTIONAL +ENDIF + -- Shall not appear in minor version one or two + } + + ReportEventActionStatus-Request ::= ObjectName -- Event Action Name + + ReportEventActionStatus-Response ::= Unsigned32 -- Number of Event Enrollments + + DefineEventEnrollment-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransitions [2] IMPLICIT Transitions, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL +IF ( tpy ) +, clientApplication [5] ApplicationReference OPTIONAL +ENDIF + } + + DefineEventEnrollment-Response ::= NULL + + DefineEventEnrollment-Error ::= ObjectName + + CS-DefineEventEnrollment-Request ::= [0] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + + DeleteEventEnrollment-Request ::= CHOICE { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName } + + DeleteEventEnrollment-Response ::= Unsigned32 --Candidates Not Deleted + + GetEventEnrollmentAttributes-Request ::= SEQUENCE { + scopeOfRequest [0] IMPLICIT INTEGER { + specific (0), + client (1), + ec (2), + ea (3) } (0..3) DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, +IF ( tpy ) + clientApplication [2] ApplicationReference OPTIONAL, +ELSE + clientApplication [2] NULL, +ENDIF + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL } + + GetEventEnrollmentAttributes-Response ::= SEQUENCE { + listOfEEAttributes [0] IMPLICIT SEQUENCE OF EEAttributes, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + EEAttributes ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL }, + eventActionName [2] CHOICE { + eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL } OPTIONAL, +IF ( tpy ) + clientApplication [3] ApplicationReference OPTIONAL, +ELSE + clientApplication [3] NULL, +ENDIF + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE-Class, + duration [6] IMPLICIT EE-Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32 OPTIONAL, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL +IF ( csr cspi ) +, displayEnhancement [9] CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement NULL } + -- shall not be transmitted if the value is NULL +ELSE + displayEnhancement [9] NULL +IF ( aco ) +, accessControlList [11] IMPLICIT Identifier + -- shall not appear in minor version one or two +ENDIF + } + + ReportEventEnrollmentStatus-Request ::= ObjectName --Event Enrollment Name + + ReportEventEnrollmentStatus-Response ::= SEQUENCE { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE-Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE-State } + + AlterEventEnrollment-Request ::= SEQUENCE { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL } + + AlterEventEnrollment-Response ::= SEQUENCE { + currentState [0] CHOICE { + state [0] IMPLICIT EE-State, + undefined [1] IMPLICIT NULL }, + transitionTime [1] EventTime } + + CS-AlterEventEnrollment-Request ::= SEQUENCE { + changeDisplay CHOICE { +IF ( des ) + string [0] IMPLICIT VisibleString, +ENDIF +IF ( dei ) + index [1] IMPLICIT INTEGER, +ENDIF + noEnhancement [2] NULL } OPTIONAL } + + EE-State ::= INTEGER { + disabled (0), + idle (1), + active (2), + activeNoAckA (3), + idleNoAckI (4), + idleNoAckA (5), + idleAcked (6), + activeAcked (7), + undefined (8) + } + + DefineEventConditionList-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName +IF ( recl ), + listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated. +ENDIF + } + + DefineEventConditionList-Response ::= NULL + + DefineEventConditionList-Error ::= ObjectName + + DeleteEventConditionList-Request ::= ObjectName -- EventConditionListName + + DeleteEventConditionList-Response ::= NULL + + AddEventConditionListReference-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName +IF ( recl ) +, listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated. +ENDIF + } + + AddEventConditionListReference-Response ::= NULL + + AddEventConditionListReference-Error ::= ObjectName + + RemoveEventConditionListReference-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName +IF ( recl ) +, listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName + -- shall appear if an only if recl has been negotiated. +ENDIF + } + + RemoveEventConditionListReference-Response ::= NULL + + RemoveEventConditionListReference-Error ::= CHOICE { + eventCondition [0] ObjectName, + eventConditionList [1] ObjectName } + + GetEventConditionListAttributes-Request ::= ObjectName -- eventConditionListName + + GetEventConditionListAttributes-Response ::= SEQUENCE { + listOfEventConditionName [1] IMPLICIT SEQUENCE OF ObjectName +IF ( recl ) +, listOfEventConditionListName [2] IMPLICIT SEQUENCE OF ObjectName OPTIONAL + -- shall appear if an only if recl has been negotiated. +ENDIF + } + + ReportEventConditionListStatus-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, -- Event Condition List Name + continueAfter [1] IMPLICIT Identifier OPTIONAL } + + ReportEventConditionListStatus-Response ::= SEQUENCE { + listOfEventConditionStatus [1] IMPLICIT SEQUENCE OF EventConditionStatus, + moreFollows [2] IMPLICIT BOOLEAN DEFAULT TRUE } + + EventConditionStatus ::= SEQUENCE { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State, + numberOfEventEnrollments [2] IMPLICIT Unsigned32, + enabled [3] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [4] EventTime OPTIONAL, + timeOfLastTransitionToIdle [5] EventTime OPTIONAL } + + AlterEventConditionListMonitoring-Request ::= SEQUENCE { + eventConditionListName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN, + priorityChange [2] CHOICE { + priorityValue [0] IMPLICIT INTEGER, + priorityReset [1] IMPLICIT NULL } OPTIONAL + } + + AlterEventConditionListMonitoring-Response ::= NULL + + ReadJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + rangeStartSpecification [1] CHOICE { + startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING } OPTIONAL, + rangeStopSpecification [2] CHOICE { + endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32 } OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter [5] IMPLICIT SEQUENCE { + timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING } OPTIONAL + } + + ReadJournal-Response ::= SEQUENCE { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + JournalEntry ::= SEQUENCE { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent } + + WriteJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent } + + WriteJournal-Response ::= NULL + + InitializeJournal-Request ::= SEQUENCE { + journalName [0] ObjectName, + limitSpecification [1] IMPLICIT SEQUENCE { + limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL } OPTIONAL + } + + InitializeJournal-Response ::= Unsigned32 -- Entries Deleted + + ReportJournalStatus-Request ::= ObjectName --Journal Name + + ReportJournalStatus-Response ::= SEQUENCE { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN +IF ( aco ) +, accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + CreateJournal-Request ::= SEQUENCE { + journalName [0] ObjectName } + + CreateJournal-Response ::= NULL + + DeleteJournal-Request ::= SEQUENCE { + journalName [0] ObjectName } + + DeleteJournal-Response ::= NULL + + EntryContent ::= SEQUENCE { + occurrenceTime [0] IMPLICIT TimeOfDay, + entryForm CHOICE { + data [2] IMPLICIT SEQUENCE { + event [0] IMPLICIT SEQUENCE { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State } OPTIONAL, + listOfVariables [1] IMPLICIT SEQUENCE OF Journal-Variable OPTIONAL + }, + annotation [3] MMSString } + } + + END + + MMS-Environment-1 { iso standard 9506 part(2) mms-environment-version1(4)} +DEFINITIONS ::= BEGIN + +EXPORTS + ApplicationReference, + Authentication-value; + +IMPORTS + AP-title, + AP-invocation-identifier, + AE-qualifier, + AE-invocation-identifier, + Authentication-value + FROM ACSE-1 + { joint-iso-itu-t association-control(2) modules(0) apdus(0) version1(1)}; + + ApplicationReference ::= SEQUENCE { + ap-title [0] ACSE-1.AP-title OPTIONAL, + ap-invocation-id [1] ACSE-1.AP-invocation-identifier OPTIONAL, + ae-qualifier [2] ACSE-1.AE-qualifier OPTIONAL, + ae-invocation-id [3] ACSE-1.AE-invocation-identifier OPTIONAL + } + + END + + MMS-SCI-Module-1 { iso standard 9506 part(2) mms-file-record-version1(2) } +DEFINITIONS ::= BEGIN + + IMPORTS ApplicationReference + FROM MMS-Environment-1 { iso standard 9506 part(2) mms-environment-version1(4) } + AccessCondition, + AdditionalCBBOptions, + AdditionalSupportOptions, + Address, + AlarmAckRule, + Control-State, + DomainState, + EC-Class, + EC-State, + EE-Duration, + EE-Class, + LogicalStatus, + Modifier, + ParameterSupportOptions, + PhysicalStatus, + Priority, + ProgramInvocationState, + ServiceSupportOptions, + Severity, + Transitions, + TypeDescription + FROM MMS-Object-Module-1 { iso standard 9506 part(1) mms-object-model1(1) } + AlternateAccess, + ConfirmedServiceRequest, + AttachToEventCondition, + AttachToSemaphore, + Data, + EE-State, + Identifier, + Integer8, + Integer32, + MMSString, + MMS255String, + ObjectName, + TimeOfDay, + TypeSpecification, + Unsigned32, + Unsigned8 + FROM ISO-9506-MMS-1 { iso standard 9506 part(2) mms-abstract-syntax-version1(1) +}; + + SCI-Information ::= SEQUENCE { + partOne [0] IMPLICIT VMD-File, + partTwo [1] IMPLICIT Service-and-Parameter-CBBs + } + + VMD-File ::= SEQUENCE { + executiveFunction + [0] IMPLICIT ApplicationReference, + vendorName + [1] MMSString, + modelName + [2] MMSString, + revision + [3] MMSString, + abstractSyntaxes + [4] IMPLICIT OBJECT IDENTIFIER, + -- no TRANSACTIONs, + -- no APPLICATION-ASSOCIATIONs, + accessControl + [5] IMPLICIT Access-Control-List-instance, + logicalStatus + [6] IMPLICIT LogicalStatus, + capabilities + [7] IMPLICIT SEQUENCE OF MMSString, + physicalStatus + [8] IMPLICIT PhysicalStatus, + local-detail + [9] IMPLICIT BIT STRING, + accessControlLists + [10] IMPLICIT SEQUENCE OF Access-Control-List-instance, + domains + [11] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [12] IMPLICIT SEQUENCE OF Program-Invocation-instance, + unitControls + [13] IMPLICIT SEQUENCE OF Unit-Control-instance +IF (vadr) +, unnamedVariables + [14] IMPLICIT SEQUENCE OF Unnamed-Variable-instance +ELSE +, unnamedVariables + [14] IMPLICIT NULL +ENDIF +IF (vnam) +, namedVariables + [15] IMPLICIT SEQUENCE OF Named-Variable-instance +IF (vlis) +, namedVariableLists + [16] IMPLICIT SEQUENCE OF Named-Variable-List-instance +ELSE +, namedVariableLists + [16] IMPLICIT NULL +ENDIF +, namedTypes + [17] IMPLICIT SEQUENCE OF Named-Type-instance +ELSE +, namedVariables + [15] IMPLICIT NULL, + namedVariableLists + [16] IMPLICIT NULL, + namedTypes + [17] IMPLICIT NULL +ENDIF +, dataExchanges + [18] IMPLICIT SEQUENCE OF Data-Exchange-instance, + semaphores + [19] IMPLICIT SEQUENCE OF Semaphore-instance, + operatorStations + [20] IMPLICIT SEQUENCE OF Operator-Station-instance, + eventConditions + [21] IMPLICIT SEQUENCE OF Event-Condition-instance, + eventActions + [22] IMPLICIT SEQUENCE OF Event-Action-instance, + eventEnrollments + [23] IMPLICIT SEQUENCE OF Event-Enrollment-instance +IF (cspi) +, eventConditionLists + [24] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ELSE +, eventConditionLists + [24] IMPLICIT NULL +ENDIF +, journals + [25] IMPLICIT SEQUENCE OF Journal-instance, + ... +IF (csr) + , selected-Program-Invocation CHOICE { + selectedProgram + [26] IMPLICIT Program-Invocation-instance, + noneSelected + [27] IMPLICIT NULL } +ENDIF + } + + Access-Control-List-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + readAccessCondition + [4] AccessCondition OPTIONAL, + storeAccessCondition + [5] AccessCondition OPTIONAL, + writeAccessCondition + [6] AccessCondition OPTIONAL, + loadAccessCondition + [7] AccessCondition OPTIONAL, + executeAccessCondition + [8] AccessCondition OPTIONAL, + deleteAccessCondition + [9] AccessCondition OPTIONAL, + editAccessCondition + [10] AccessCondition OPTIONAL, + -- + -- The following fields are used to record lists of objects placed + -- under the control of this ACCESS-CONTROL-LIST object. + -- They will be referred to collectively as the Controlled Object Lists + -- + accessControlLists + [11] IMPLICIT SEQUENCE OF Access-Control-List-instance, + domains + [12] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [13] IMPLICIT SEQUENCE OF Program-Invocation-instance, + unitControls + [14] IMPLICIT SEQUENCE OF Unit-Control-instance +IF (vadr) +, unnamedVariables + [15] IMPLICIT SEQUENCE OF Unnamed-Variable-instance +ELSE +, unnamedVariables + [15] IMPLICIT NULL +ENDIF +IF (vnam) +, namedVariables + [16] IMPLICIT SEQUENCE OF Named-Variable-instance +IF (vlis) +, namedVariableLists + [17] IMPLICIT SEQUENCE OF Named-Variable-List-instance +ELSE +, namedVariableLists + [17] IMPLICIT NULL +ENDIF +, namedTypes + [18] IMPLICIT SEQUENCE OF Named-Type-instance +ELSE +, namedVariables + [16] IMPLICIT NULL, + namedVariableLists + [17] IMPLICIT NULL, + namedTypes + [18] IMPLICIT NULL +ENDIF +, dataExchanges + [19] IMPLICIT SEQUENCE OF Data-Exchange-instance, + semaphores + [20] IMPLICIT SEQUENCE OF Semaphore-instance, + operatorStations + [21] IMPLICIT SEQUENCE OF Operator-Station-instance, + eventConditions + [22] IMPLICIT SEQUENCE OF Event-Condition-instance, + eventActions + [23] IMPLICIT SEQUENCE OF Event-Action-instance, + eventEnrollments + [24] IMPLICIT SEQUENCE OF Event-Enrollment-instance, + journals + [25] IMPLICIT SEQUENCE OF Journal-instance, + ... +IF (cspi) +, eventConditionLists + [26] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ENDIF + } } } + + Domain-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + capabilities [3] IMPLICIT SEQUENCE OF MMSString, + state [4] IMPLICIT DomainState, + -- The aAssociation is not included + accessControl + [5] IMPLICIT Access-Control-List-instance, + sharable [6] IMPLICIT BOOLEAN, + programInvocations + [7] IMPLICIT SEQUENCE OF Program-Invocation-instance + -- uploadsInProgress is not included +IF (vnam) +, namedVariables + [8] IMPLICIT SEQUENCE OF Named-Variable-instance +IF (vlis) + , namedVariableLists + [9] IMPLICIT SEQUENCE OF Named-Variable-List-instance +ELSE +, namedVariableLists + [9] IMPLICIT NULL +ENDIF +, namedTypes + [10] IMPLICIT SEQUENCE OF Named-Type-instance +ELSE +, namedVariables + [8] IMPLICIT NULL, + namedVariableLists + [9] IMPLICIT NULL, + namedTypes + [10] IMPLICIT NULL +ENDIF +, eventConditions + [11] IMPLICIT SEQUENCE OF Event-Condition-instance, + eventActions + [12] IMPLICIT SEQUENCE OF Event-Action-instance, + eventEnrollments + [13] IMPLICIT SEQUENCE OF Event-Enrollment-instance +IF (cspi) +, eventConditionLists + [14] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ENDIF + } } } + + Program-Invocation-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + programInvocationState + [3] IMPLICIT ProgramInvocationState, + domains + [4] IMPLICIT SEQUENCE OF Domain-instance, + accessControl + [5] IMPLICIT SEQUENCE OF Access-Control-List-instance, + reusable + [6] IMPLICIT BOOLEAN, + monitor + [7] IMPLICIT BOOLEAN, + -- The following three fields shall all be present if the value of + -- monitor is true. + -- If present, the &name field of each object instance + -- shall have a value equal to the + -- &name field of this instance of the PROGRAM-INVOCATION. + eventCondition + [8] IMPLICIT SEQUENCE OF Event-Condition-instance OPTIONAL, + eventAction + [9] IMPLICIT SEQUENCE OF Event-Action-instance OPTIONAL, + eventEnrollment + [10] IMPLICIT SEQUENCE OF Event-Enrollment-instance OPTIONAL, + executionArgument + [11] MMSString, + ... +IF (csr) +, control + [12] IMPLICIT Control-State, + controlling-Program-Invocation + [13] IMPLICIT Program-Invocation-instance, + -- The following field shall be present + -- if and only if the value of the &control field is controlling. + controlled-Program-Invocations + [14] IMPLICIT SEQUENCE OF Program-Invocation-instance OPTIONAL +ENDIF + } } } + + Unit-Control-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + domains + [4] IMPLICIT SEQUENCE OF Domain-instance, + programInvocations + [5] IMPLICIT SEQUENCE OF Program-Invocation-instance + } } } + + Unnamed-Variable-instance ::= SEQUENCE { + address [0] Address, + accessControl [1] IMPLICIT Access-Control-List-instance, + typeDescription [2] TypeDescription + } + + Named-Variable-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + typeDescription [4] TypeDescription +IF ( vadr ) +, address [5] Address OPTIONAL +ELSE +, [5] NULL +ENDIF +IF ( sem ) +, meaning [6] IMPLICIT VisibleString OPTIONAL +ENDIF + } } } + + Named-Variable-List-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + listOfVariables + [4] IMPLICIT SEQUENCE OF Variable-List-Item-instance + } } } + + Variable-List-Item-instance ::= SEQUENCE { + -- one and only one of the following two lines shall appear +IF ( vadr ) + unnamedItem [0] IMPLICIT Unnamed-Variable-instance OPTIONAL +ELSE + unnamedItem [0] IMPLICIT NULL OPTIONAL +ENDIF +IF ( vnam ) +, namedItem [1] IMPLICIT Named-Variable-instance OPTIONAL +ELSE +, namedItem [1] IMPLICIT NULL OPTIONAL +ENDIF +IF (valt) + -- the following specification may be included +, alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL +ENDIF + } + + Named-Type-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + typeDescription [4] TypeDescription +IF (sem) +, meaning [5] IMPLICIT VisibleString OPTIONAL +ENDIF + } } } + + Data-Exchange-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + request [4] IMPLICIT SEQUENCE OF TypeDescription, + response [5] IMPLICIT SEQUENCE OF TypeDescription, + linked [6] IMPLICIT BOOLEAN, + -- The following attribute shall appear if an only if the value of &linked is true. + programInvocation [7] IMPLICIT Program-Invocation-instance OPTIONAL + } } } + + Semaphore-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + class [4] IMPLICIT ENUMERATED { + token, + pool }, +-- If the value of &class is token, the following field shall appear + numberOfTokens [5] IMPLICIT INTEGER OPTIONAL, +-- If the value of &class is pool, the following field shall appear + namedTokens [6] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + eventCondition [7] IMPLICIT Event-Condition-instance + } } } + + Operator-Station-instance ::= SEQUENCE { + name [0] IMPLICIT Identifier, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + stationType [4] IMPLICIT ENUMERATED { + entry, + display, + entry-display } + } } } + + Event-Condition-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + ecClass [4] IMPLICIT EC-Class, + ecState [5] IMPLICIT EC-State, + priority [6] IMPLICIT Priority, + severity [7] IMPLICIT Severity, + eventEnrollments [8] IMPLICIT SEQUENCE OF Event-Enrollment-instance, + -- The following fields shall be present + -- if and only if the value of &ecClass is monitored. + enabled [9] IMPLICIT BOOLEAN OPTIONAL, + alarmSummaryReports [10] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable CHOICE { + named [11] IMPLICIT Named-Variable-instance, + unnamed [12] IMPLICIT Unnamed-Variable-instance, + unspecified [13] IMPLICIT NULL } OPTIONAL, + evaluationInterval [14] IMPLICIT INTEGER OPTIONAL, + ... +IF (cspi) +, displayEnhancement CHOICE { +IF (des) + text [15] MMSString +ENDIF +IF (dei) +, number [16] IMPLICIT INTEGER +ENDIF +, none [17] IMPLICIT NULL + }, + group-Priority-Override CHOICE { + priority [18] IMPLICIT Priority, + undefined [19] IMPLICIT NULL + } OPTIONAL, + referencingEventConditionLists + [20] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ENDIF + } } } + + Event-Action-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + confirmedServiceRequest [4] ConfirmedServiceRequest, + modifiers [5] IMPLICIT SEQUENCE OF Modifier, + eventEnrollments + [6] IMPLICIT SEQUENCE OF Event-Enrollment-instance + } } } + + Event-Enrollment-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + eeClass [4] IMPLICIT EE-Class , + eventCondition [5] IMPLICIT Event-Condition-instance, + ecTransitions [6] IMPLICIT Transitions, + -- The following parameter is present if and only if the + -- value of &eeClass is modifier. + remainingDelay CHOICE { + time [7] IMPLICIT INTEGER, + forever [8] IMPLICIT NULL } OPTIONAL, + -- The remaining parameters are present if and only if the + -- value of &eeClass is notification. + eventAction [9] IMPLICIT Event-Action-instance OPTIONAL, + duration [10] IMPLICIT EE-Duration OPTIONAL, + clientApplication [11] IMPLICIT ApplicationReference OPTIONAL, + aaRule [12] IMPLICIT AlarmAckRule OPTIONAL, + ... +IF (cspi) +, displayEnhancement CHOICE { +IF (des) + text [13] MMSString + ENDIF +IF (dei) +, number [14] IMPLICIT INTEGER +ENDIF +, none [15] IMPLICIT NULL + } +ENDIF + } } } + + Event-Condition-List-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl + [3] IMPLICIT Access-Control-List-instance, + eventConditions + [4] IMPLICIT SEQUENCE OF Event-Condition-instance +IF (recl) + , eventConditionLists + [5] IMPLICIT SEQUENCE OF Event-Condition-List-instance, + referencingEventConditionLists + [6] IMPLICIT SEQUENCE OF Event-Condition-List-instance +ENDIF + } } } + + Journal-instance ::= SEQUENCE { + name [0] ObjectName, + definition CHOICE { + reference [1] IMPLICIT OBJECT IDENTIFIER, + details [2] IMPLICIT SEQUENCE { + accessControl [3] IMPLICIT Access-Control-List-instance, + entries [4] IMPLICIT SEQUENCE OF Journal-Entry-instance + } } } + + Journal-Entry-instance ::= SEQUENCE { + journal [0] IMPLICIT Journal-instance, + entry [1] IMPLICIT OCTET STRING, + clientApplication [2] IMPLICIT ApplicationReference, + timeStamp [3] IMPLICIT TimeOfDay, + orderOfReceipt [4] IMPLICIT INTEGER, + informationType [5] IMPLICIT ENUMERATED { + annotation, + event-data, + data }, + -- The following attribute shall appear if and only if the + -- value of &informationType is annotation. + textComment [6] MMS255String OPTIONAL, + --The following attribute shall appear if and only if the + -- value of &informationType is event-data. + eventTransitionRecord [7] IMPLICIT SEQUENCE { + name [8] ObjectName, + currentState [9] IMPLICIT EC-State + } OPTIONAL, + -- The following attribute shall appear if and only if the + -- value of &informationType is data or event-data. + journalVariables [10] IMPLICIT SEQUENCE OF SEQUENCE { + variableTag [11] MMS255String, + valueSpecification [12] Data + } OPTIONAL + } + + Service-and-Parameter-CBBs ::= SEQUENCE { + services-Client [0] IMPLICIT ServiceSupportOptions, + services-Server [1] IMPLICIT ServiceSupportOptions, + parameters [2] IMPLICIT ParameterSupportOptions, + nest [3] IMPLICIT INTEGER +IF (csr cspi) +, extendedServices-Client [4] IMPLICIT AdditionalSupportOptions, + extendedServices-Server [5] IMPLICIT AdditionalSupportOptions +ELSE +, extendedServices-Client [4] IMPLICIT NULL, + extendedServices-Server [5] IMPLICIT NULL +ENDIF +IF (cspi) +, extendedParameters [6] IMPLICIT AdditionalCBBOptions +ELSE +, extendedParameters [6] IMPLICIT NULL +ENDIF +, generalManagement [7] IMPLICIT GeneralManagementParameters, + vMDSupport [8] IMPLICIT VMDSupportParameters, + domainManagement [9] IMPLICIT DomainManagementParameters, + programInvocation [10] IMPLICIT ProgramInvocationManagementParameters, + variableAccess [11] IMPLICIT VariableAccessParameters, + dataParameters [12] IMPLICIT DataParameters, + semaphoreManagement [13] IMPLICIT SemaphoreManagementParameters, + operatorCommunication [14] IMPLICIT OperatorCommunicationParameters, + errors [15] IMPLICIT ErrorParameters, + fileManagement [16] IMPLICIT FileManagementParameters + } + + GeneralManagementParameters ::= SEQUENCE { + localDetail [0] MMSString, + supportForTime [1] IMPLICIT SEQUENCE { + timeOfDay [2] IMPLICIT BOOLEAN, + timeSequence [3] IMPLICIT BOOLEAN + }, + granularityOfTime [4] IMPLICIT INTEGER + } + + VMDSupportParameters ::= SEQUENCE { + localDetail [0] MMSString, + extendedDerivation [1] MMSString + -- method used to perform extended derivation + } + + DomainManagementParameters ::= SEQUENCE { + loadDataOctet [0] MMSString, + -- description of the format of Load Data if the octet string form is used + loadDataSyntax [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + -- identifier of the Abstract Syntaxes used + maxUploads [2] IMPLICIT INTEGER + } + + ProgramInvocationManagementParameters ::= SEQUENCE { + executionArgMaxSize [0] IMPLICIT INTEGER, + executionArgParseRules [1] MMSString, + executionArgSyntaxes [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + programLoction [3] MMSString, + -- syntax of the program Location notation + stepMode [4] IMPLICIT BOOLEAN + -- if true, step Mode is supported + } + + VariableAccessParameters ::= SEQUENCE { + uninterruptibleAccess [0] MMSString, + -- conditions under which it is guaranteed + singleMode [1] IMPLICIT BOOLEAN, + unnamedMode [2] IMPLICIT BOOLEAN + } + + DataParameters ::= SEQUENCE { + bit-string [0] IMPLICIT INTEGER OPTIONAL, + integer [1] IMPLICIT INTEGER OPTIONAL, + unsigned [2] IMPLICIT INTEGER OPTIONAL, + floating-point [3] IMPLICIT SEQUENCE { + total [4] IMPLICIT INTEGER, + exponent [5] IMPLICIT INTEGER } OPTIONAL, + octet-string [10] IMPLICIT INTEGER OPTIONAL, + visible-string [11] IMPLICIT INTEGER OPTIONAL, + binary-time [12] IMPLICIT BOOLEAN OPTIONAL, + bcd [13] IMPLICIT INTEGER OPTIONAL, + mmsString [14] IMPLICIT INTEGER OPTIONAL + } + + SemaphoreManagementParameters ::= SEQUENCE { + algorithm [0] IMPLICIT MMSString + -- method of processing the &priority field + } + + OperatorCommunicationParameters ::= SEQUENCE { + input-time-out [0] IMPLICIT INTEGER + } + + ErrorParameters ::= SEQUENCE { + additionalCode [0] MMSString, + additionalDetial [1] IMPLICIT SEQUENCE { + size [2] IMPLICIT INTEGER, + syntax [3] MMSString + } + } + + FileManagementParameters ::= SEQUENCE { + fileName [0] MMSString + } + + END + + ISO-9506-MMS-1A { iso standard 9506 part(2) mms-annex-version1(3) } +DEFINITIONS ::= BEGIN + +EXPORTS + ObtainFile-Request, + ObtainFile-Response, + ObtainFile-Error, + FileOpen-Request, + FileOpen-Response, + FileRead-Request, + FileRead-Response, + FileClose-Request, + FileClose-Response, + FileRename-Request, + FileRename-Response, + FileRename-Error, + FileDelete-Request, + FileDelete-Response, + FileDirectory-Request, + FileDirectory-Response, + ScatteredAccessDescription, + DefineScatteredAccess-Request, + DefineScatteredAccess-Response, + GetScatteredAccessAttributes-Request, + GetScatteredAccessAttributes-Response; + +IMPORTS + FileName, + ObjectName, + AlternateAccess, + VariableSpecification, + Identifier, + Integer32, + Unsigned32 FROM + ISO-9506-MMS-1 { iso standard 9506 part(2) mms-abstract-syntax-version1(1) } + ApplicationReference FROM + MMS-Environment-1 { iso standard 9506 part(2) mms-environment-version1 (4) }; + + ObtainFile-Request ::= SEQUENCE { +IF ( tpy ) + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, +ENDIF + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName + } + + ObtainFile-Response ::= NULL + + ObtainFile-Error ::= INTEGER { + source-file (0), + destination-file (1) + } (0..1) + + FileOpen-Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32 } + + FileOpen-Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes } + + FileRead-Request ::= Integer32 -- FRSM ID + + FileRead-Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE } + + FileClose-Request ::= Integer32 -- FRSM ID + + FileClose-Response ::= NULL + + FileRename-Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName } + + FileRename-Response ::= NULL + + FileRename-Error ::= INTEGER { + source-file (0), + destination-file (1) + } (0..1) + + FileDelete-Request ::= FileName + + FileDelete-Response ::= NULL + + FileDirectory-Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL } + + FileDirectory-Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE } + + DirectoryEntry ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes } + + FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, -- in octets + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL } + + ScatteredAccessDescription ::=SEQUENCE OF SEQUENCE { + componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification +IF ( valt ) +, alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL +ENDIF + } + + DefineScatteredAccess-Request ::= SEQUENCE { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription } + + DefineScatteredAccess-Response ::= NULL + + GetScatteredAccessAttributes-Request ::= ObjectName -- ScatteredAccessName + + GetScatteredAccessAttributes-Response ::= SEQUENCE { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription +IF ( aco ) +, accessControlList [2] IMPLICIT Identifier OPTIONAL + -- Shall not appear in minor version one or two +ENDIF + } + + END diff --git a/src/asn1/mms/more-asn1-files/mms-sisco.asn b/src/asn1/mms/more-asn1-files/mms-sisco.asn new file mode 100644 index 0000000..89a50c7 --- /dev/null +++ b/src/asn1/mms/more-asn1-files/mms-sisco.asn @@ -0,0 +1,2203 @@ +--Quelle: http://www.sisconet.com/downloads/mms_abstract_syntax.txt +--------------------------------------------------------------------- + +Corrections made July 2, 1994 + +--------------------------------------------------------------------- + + +MMS { iso standard 9506 part(2) mms-general-module-version(2) } + +DEFINITIONS ::= + +BEGIN + +EXPORTS MMSpdu; + +IMPORTS + AP-title, + AP-invocation-identifier, + AE-qualifier, + AE-invocation-identifier +FROM ISO-8650-ACSE-1 + + +MMSpdu ::= CHOICE + { + confirmed-RequestPDU [0] IMPLICIT Confirmed-RequestPDU, + confirmed-ResponsePDU [1] IMPLICIT Confirmed-ResponsePDU, + confirmed-ErrorPDU [2] IMPLICIT Confirmed-ErrorPDU, + unconfirmed-PDU [3] IMPLICIT Unconfirmed-PDU, + rejectPDU [4] IMPLICIT RejectPDU, + cancel-RequestPDU [5] IMPLICIT Cancel-RequestPDU, + cancel-ResponsePDU [6] IMPLICIT Cancel-ResponsePDU, + cancel-ErrorPDU [7] IMPLICIT Cancel-ErrorPDU, + initiate-RequestPDU [8] IMPLICIT Initiate-RequestPDU, + initiate-ResponsePDU [9] IMPLICIT Initiate-ResponsePDU, + initiate-ErrorPDU [10] IMPLICIT Initiate-ErrorPDU, + conclude-RequestPDU [11] IMPLICIT Conclude-RequestPDU, + conclude-ResponsePDU [12] IMPLICIT Conclude-ResponsePDU, + conclude-ErrorPDU [13] IMPLICIT Conclude-ErrorPDU + } + + +Confirmed-RequestPDU ::= SEQUENCE + { + invokeID Unsigned32, + listOfModifier SEQUENCE OF Modifier OPTIONAL, + ConfirmedServiceRequest, + [79] CS-Request-Detail OPTIONAL + } + + +Unconfirmed-PDU ::= SEQUENCE + { + UnconfirmedService, + [79] CS-Request-Detail OPTIONAL + } + + +Confirmed-ResponsePDU ::= SEQUENCE + { + invokeID Unsigned32, + ConfirmedServiceResponse, + [79] CS-Request-Detail OPTIONAL + } + + +Confirmed-ErrorPDU ::= SEQUENCE + { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError + } + + +UnconfirmedService ::= CHOICE + { + informationReport [0] IMPLICIT InformationReport, + unsolicitedStatus [1] IMPLICIT UnsolicitedStatus, + eventNotification [2] IMPLICIT EventNotification, + additionalService [3] AdditionalUnconfirmedService + } + + +Modifier ::= CHOICE + { + attach-To-Event-Condition [0] IMPLICIT AttachToEventCondition, + attach-To-Semaphore [1] IMPLICIT AttachToSemaphore + } + + +ConfirmedServiceRequest ::= CHOICE + { + status [0] IMPLICIT Status-Request, + getNameList [1] IMPLICIT GetNameList-Request, + identify [2] IMPLICIT Identify-Request, + rename [3] IMPLICIT Rename-Request, + read [4] IMPLICIT Read-Request, + write [5] IMPLICIT Write-Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes-Request, + defineNamedVariable [7] IMPLICIT DefineNamedVariable-Request, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess-Request, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes-Request, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess-Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Request, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes-Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Request, + defineNamedType [14] IMPLICIT DefineNamedType-Request, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes-Request, + deleteNamedType [16] IMPLICIT DeleteNamedType-Request, + input [17] IMPLICIT Input-Request, + output [18] IMPLICIT Output-Request, + takeControl [19] IMPLICIT TakeControl-Request, + relinquishControl [20] IMPLICIT RelinquishControl-Request, + defineSemaphore [21] IMPLICIT DefineSemaphore-Request, + deleteSemaphore [22] IMPLICIT DeleteSemaphore-Request, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus-Request, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus-Request, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus-Request, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence-Request, + downloadSegment [27] IMPLICIT DownloadSegment-Request, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence-Request, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence-Request, + uploadSegment [30] IMPLICIT UploadSegment-Request, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence-Request, + requestDomainDownload [32] IMPLICIT RequestDomainDownload-Request, + requestDomainUpload [33] IMPLICIT RequestDomainUpload-Request, + loadDomainContent [34] IMPLICIT LoadDomainContent-Request, + storeDomainContent [35] IMPLICIT StoreDomainContent-Request, + deleteDomain [36] IMPLICIT DeleteDomain-Request, + getDomainAttributes [37] IMPLICIT GetDomainAttributes-Request, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation-Request, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation-Request, + start [40] IMPLICIT Start-Request, + stop [41] IMPLICIT Stop-Request, + resume [42] IMPLICIT Resume-Request, + reset [43] IMPLICIT Reset-Request, + kill [44] IMPLICIT Kill-Request, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes-Request, + obtainFile [46] IMPLICIT ObtainFile-Request, + defineEventCondition [47] IMPLICIT DefineEventCondition-Request, + deleteEventCondition [48] DeleteEventCondition-Request, + getEventConditionAttributes [49] GetEventConditionAttributes-Request, + reportEventConditionStatus [50] ReportEventConditionStatus-Request, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring-Request, + triggerEvent [52] IMPLICIT TriggerEvent-Request, + defineEventAction [53] IMPLICIT DefineEventAction-Request, + deleteEventAction [54] DeleteEventAction-Request, + getEventActionAttributes [55] GetEventActionAttributes-Request, + reportEventActionStatus [56] ReportEventActionStatus-Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment-Request, + deleteEventEnrollment [58] DeleteEventEnrollment-Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment-Request, + reportEventEnrollmentStatus [60] ReportEventEnrollmentStatus-Request, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes-Request, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification-Request, + getAlarmSummary [63] IMPLICIT GetAlarmSummary-Request, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary-Request, + readJournal [65] IMPLICIT ReadJournal-Request, + writeJournal [66] IMPLICIT WriteJournal-Request, + initializeJournal [67] IMPLICIT InitializeJournal-Request, + reportJournalStatus [68] IMPLICIT ReportJournalStatus-Request, + createJournal [69] IMPLICIT CreateJournal-Request, + deleteJournal [70] IMPLICIT DeleteJournal-Request, + getCapabilityList [71] IMPLICIT GetCapabilityList-Request, + fileOpen [72] IMPLICIT FileOpen-Request, + fileRead [73] IMPLICIT FileRead-Request, + fileClose [74] IMPLICIT FileClose-Request, + fileRename [75] IMPLICIT FileRename-Request, + fileDelete [76] IMPLICIT FileDelete-Request, + fileDirectory [77] IMPLICIT FileDirectory-Request, + additionalService [78] AdditionalService-Request + } + +CS-Request-Detail ::= CHOICE { + -- see ISO 9506-2 + } + +ConfirmedServiceResponse ::= CHOICE + { + status [0] IMPLICIT Status-Response, + getNameList [1] IMPLICIT GetNameList-Response, + identify [2] IMPLICIT Identify-Response, + rename [3] IMPLICIT Rename-Response, + read [4] IMPLICIT Read-Response, + write [5] IMPLICIT Write-Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes-Response, + defineNamedVariable [7] IMPLICIT DefineNamedVariable-Response, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess-Response, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes-Response, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess-Response, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList-Response, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes-Response, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList-Response, + defineNamedType [14] IMPLICIT DefineNamedType-Response, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes-Response, + deleteNamedType [16] IMPLICIT DeleteNamedType-Response, + input [17] IMPLICIT Input-Response, + output [18] IMPLICIT Output-Response, + takeControl [19] TakeControl-Response, + relinquishControl [20] IMPLICIT RelinquishControl-Response, + defineSemaphore [21] IMPLICIT DefineSemaphore-Response, + deleteSemaphore [22] IMPLICIT DeleteSemaphore-Response, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus-Response, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus-Response, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus-Response, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence-Response, + downloadSegment [27] IMPLICIT DownloadSegment-Response, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence-Response, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence-Response, + uploadSegment [30] IMPLICIT UploadSegment-Response, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence-Response, + requestDomainDownLoad [32] IMPLICIT RequestDomainDownload-Response, + requestDomainUpload [33] IMPLICIT RequestDomainUpload-Response, + loadDomainContent [34] IMPLICIT LoadDomainContent-Response, + storeDomainContent [35] IMPLICIT StoreDomainContent-Response, + deleteDomain [36] IMPLICIT DeleteDomain-Response, + getDomainAttributes [37] IMPLICIT GetDomainAttributes-Response, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation-Response, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation-Response, + start [40] IMPLICIT Start-Response, + stop [41] IMPLICIT Stop-Response, + resume [42] IMPLICIT Resume-Response, + reset [43] IMPLICIT Reset-Response, + kill [44] IMPLICIT Kill-Response, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes-Response, + obtainFile [46] IMPLICIT ObtainFile-Response, + fileOpen [72] IMPLICIT FileOpen-Response, + defineEventCondition [47] IMPLICIT DefineEventCondition-Response, + deleteEventCondition [48] IMPLICIT DeleteEventCondition-Response, + getEventConditionAttributes [49] IMPLICIT GetEventConditionAttributes-Response, + reportEventConditionStatus [50] IMPLICIT ReportEventConditionStatus-Response, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring-Response, + triggerEvent [52] IMPLICIT TriggerEvent-Response, + defineEventAction [53] IMPLICIT DefineEventAction-Response, + deleteEventAction [54] IMPLICIT DeleteEventAction-Response, + getEventActionAttributes [55] IMPLICIT GetEventActionAttributes-Response, + reportActionStatus [56] IMPLICIT ReportEventActionStatus-Response, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment-Response, + deleteEventEnrollment [58] IMPLICIT DeleteEventEnrollment-Response, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment-Response, + reportEventEnrollmentStatus [60] IMPLICIT ReportEventEnrollmentStatus-Response, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes-Response, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification-Response, + getAlarmSummary [63] IMPLICIT GetAlarmSummary-Response, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary-Response, + readJournal [65] IMPLICIT ReadJournal-Response, + writeJournal [66] IMPLICIT WriteJournal-Response, + initializeJournal [67] IMPLICIT InitializeJournal-Response, + reportJournalStatus [68] IMPLICIT ReportJournalStatus-Response, + createJournal [69] IMPLICIT CreateJournal-Response, + deleteJournal [70] IMPLICIT DeleteJournal-Response, + getCapabilityList [71] IMPLICIT GetCapabilityList-Response, + fileRead [73] IMPLICIT FileRead-Response, + fileClose [74] IMPLICIT FileClose-Response, + fileRename [75] IMPLICIT FileRename-Response, + fileDelete [76] IMPLICIT FileDelete-Response, + fileDirectory [77] IMPLICIT FileDirectory-Response, + additionalService [78] AdditionalService-Response + } + +--********************************** COMMON MMS TYPES *********************************** + +FileName ::= SEQUENCE OF GraphicString + +TimeOfDay ::= OCTET STRING -- (SIZE (4 | 6)) + +Identifier ::= VisibleString + +Integer8 ::= INTEGER +Integer16 ::= INTEGER +Integer32 ::= INTEGER + + +Unsigned8 ::= INTEGER +Unsigned16 ::= INTEGER +Unsigned32 ::= INTEGER + + +ObjectName ::= CHOICE + { + vmd-specific [0] IMPLICIT Identifier, + domain-specific [1] IMPLICIT SEQUENCE + { + domainId Identifier, + itemId Identifier + }, + aa-specific [2] IMPLICIT Identifier + } + + +ApplicationReference ::= SEQUENCE + { + ap-title [0] ISO-8650-ACSE-1.AP-title OPTIONAL, + ap-invocation-id [1] ISO-8650-ACSE-1.AP-invocation-identifier OPTIONAL, + ae-qualifier [2] ISO-8650-ACSE-1.AE-qualifier OPTIONAL, + ae-invocation-id [3] ISO-8650-ACSE-1.AE-invocation-identifier OPTIONAL + } + + +Priority ::= Unsigned8 + +normalPriority Priority ::= 64 + + + + + +-- ************************************ GENERAL ************************************* + +Initiate-ErrorPDU ::= ServiceError + +Initiate-RequestPDU ::= SEQUENCE + { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitRequestDetail [4] IMPLICIT InitRequestDetail + } + +InitRequestDetail ::= SEQUENCE + { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions + } + +Initiate-ResponsePDU ::= SEQUENCE + { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negociatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negociatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negociatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitResponseDetail [4] IMPLICIT InitResponseDetail + } + +InitResponseDetail ::= SEQUENCE + { + negociatedVersionNumber [0] IMPLICIT Integer16, + negociatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions + } + + +ParameterSupportOptions ::= BIT STRING { + str1 (0), + str2 (1), + vnam (2), + valt (3), + vadr (4), + vsca (5), + tpy (6), + vlis (7), + real (8), + cei (10) + } + + +ServiceSupportOptions ::= BIT STRING + { + status (0), + getNameList (1), + identify (2), + rename (3), + read (4), + write (5), + getVariableAccessAttributes (6), + defineNamedVariable (7), + defineScatteredAccess (8), + getScatteredAccessAttributes (9), + deleteVariableAccess (10), + defineNamedVariableList (11), + getNamedVariableListAttributes (12), + deleteNamedVariableList (13), + defineNamedType (14), + getNamedTypeAttributes (15), + deleteNamedType (16), + input (17), + output (18), + takeControl (19), + relinquishControl (20), + defineSemaphore (21), + deleteSemaphore (22), + reportSemaphoreStatus (23), + reportPoolSemaphoreStatus (24), + reportSemaphoreEntryStatus (25), + initiateDownloadSequence (26), + downloadSegment (27), + terminateDownloadSequence (28), + initiateUploadSequence (29), + uploadSegment (30), + terminateUploadSequence (31), + requestDomainDownload (32), + requestDomainUpload (33), + loadDomainContent (34), + storeDomainContent (35), + deleteDomain (36), + getDomainAttributes (37), + createProgramInvocation (38), + deleteProgramInvocation (39), + start (40), + stop (41), + resume (42), + reset (43), + kill (44), + getProgramInvocationAttributes (45), + obtainFile (46), + defineEventCondition (47), + deleteEventCondition (48), + getEventConditionAttributes (49), + reportEventConditionStatus (50), + alterEventConditionMonitoring (51), + triggerEvent (52), + defineEventAction (53), + deleteEventAction (54), + getEventActionAttributes (55), + reportActionStatus (56), + defineEventEnrollment (57), + deleteEventEnrollment (58), + alterEventEnrollment (59), + reportEventEnrollmentStatus (60), + getEventEnrollmentAttributes (61), + acknowledgeEventNotification (62), + getAlarmSummary (63), + getAlarmEnrollmentSummary (64), + readJournal (65), + writeJournal (66), + initializeJournal (67), + reportJournalStatus (68), + createJournal (69), + deleteJournal (70), + getCapabilityList (71), + fileOpen (72), + fileRead (73), + fileClose (74), + fileRename (75), + fileDelete (76), + fileDirectory (77), + unsolicitedStatus (78), + informationReport (79), + eventNotification (80), + attachToEventCondition (81), + attachToSemaphore (82), + conclude (83), + cancel (84) + } + +---------------------------------- CONCLUDE -------------------------------- + +Conclude-RequestPDU ::= NULL + +Conclude-ResponsePDU ::= NULL + +Conclude-ErrorPDU ::= ServiceError + +---------------------------------- CANCEL -------------------------------- + +Cancel-RequestPDU ::= Unsigned32 -- originalInvokeID + +Cancel-ResponsePDU ::= Unsigned32 -- originalInvokeID + +Cancel-ErrorPDU ::= SEQUENCE + { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError + } + +------------------------------ Service-Error -------------------------------- + +ServiceError ::= SEQUENCE + { + errorClass [0] CHOICE + { + vmd-state [0] IMPLICIT INTEGER + { + other (0), + vmd-state-conflict (1), + vmd-operational-problem (2), + domain-transfer-problem (3), + state-machine-id-invalid (4) + }, + application-reference [1] IMPLICIT INTEGER + { + other (0), + aplication-unreachable (1), + connection-lost (2), + application-reference-invalid (3), + context-unsupported (4) + }, + definition [2] IMPLICIT INTEGER + { + other (0), + object-undefined (1), + invalid-address (2), + type-unsupported (3), + type-inconsistent (4), + object-exists (5), + object-attribute-inconsistent (6) + }, + resource [3] IMPLICIT INTEGER + { + other (0), + memory-unavailable (1), + processor-resource-unavailable (2), + mass-storage-unavailable (3), + capability-unavailable (4), + capability-unknown (5) + }, + service [4] IMPLICIT INTEGER + { + other (0), + primitives-out-of-sequence (1), + object-sate-conflict (2), + pdu-size (3), + continuation-invalid (4), + object-constraint-conflict (5) + }, + service-preempt [5] IMPLICIT INTEGER + { + other (0), + timeout (1), + deadlock (2), + cancel (3) + }, + time-resolution [6] IMPLICIT INTEGER + { + other (0), + unsupportable-time-resolution (1) + }, + access [7] IMPLICIT INTEGER + { + other (0), + object-access-unsupported (1), + object-non-existent (2), + object-access-denied (3), + object-invalidated (4) + }, + initiate [8] IMPLICIT INTEGER + { + other (0), + version-incompatible (1), + max-segment-insufficient (2), + max-services-outstanding-calling-insufficient (3), + max-services-outstanding-called-insufficient (4), + service-CBB-insufficient (5), + parameter-CBB-insufficient (6), + nesting-level-insufficient (7) + }, + conclude [9] IMPLICIT INTEGER + { + other (0), + further-communication-required (1) + }, + cancel [10] IMPLICIT INTEGER + { + other (0), + invoke-id-unknown (1), + cancel-not-possible (2) + }, + file [11] IMPLICIT INTEGER + { + other (0), + filename-ambiguous (1), + file-busy (2), + filename-syntax-error (3), + content-type-invalid (4), + position-invalid (5), + file-acces-denied (6), + file-non-existent (7), + duplicate-filename (8), + insufficient-space-in-filestore (9) + }, + others [12] IMPLICIT INTEGER + }, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInformation [3] CHOICE + { + obtainFile [0] IMPLICIT ObtainFile-Error, + start [1] IMPLICIT Start-Error, + stop [2] IMPLICIT Stop-Error, + resume [3] IMPLICIT Resume-Error, + reset [4] IMPLICIT Reset-Error, + deleteVariableAccess [5] IMPLICIT DeleteVariableAccess-Error, + deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList-Error, + deleteNamedType [7] IMPLICIT DeleteNamedType-Error, + defineEventEnrollment-Error [8] DefineEventEnrollment-Error, + fileRename [9] IMPLICIT FileRename-Error, + additionalService [10] AdditionalServiceError + } OPTIONAL + } + + +---------------------------------- REJECT -------------------------------- + +RejectPDU ::= SEQUENCE + { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE + { + confirmed-requestPDU [1] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + unrecognized-modifier (2), + invalid-invokeID (3), + invalid-argument (4), + invalid-modifier (5), + max-serv-outstanding-exceeded (6), + max-recursion-exceeded (8), + value-out-of-range (9) + }, + + confirmed-responsePDU [2] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-result (3), + max-recursion-exceeded (5), + value-out-of-range (6) + }, + + confirmed-errorPDU [3] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-serviceError (3), + value-out-of-range (4) + } , + + unconfirmedPDU [4] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-argument (2), + max-recursion-exceeded (3), + value-out-of-range (4) + }, + + pdu-error [5] IMPLICIT INTEGER + { + unknown-pdu-type (0), + invalid-pdu (1), + illegal-acse-mapping (2) + }, + + cancel-requestPDU [6] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1) + }, + + cancel-responsePDU [7] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1) + }, + + cancel-errorPDU [8] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1), + invalid-serviceError (2), + value-out-of-range (3) + }, + + conclude-requestPDU [9] IMPLICIT INTEGER + { + other (0), + invalid-argument (1) + }, + + conclude-responsePDU [10] IMPLICIT INTEGER + { + other (0), + invalid-result (1) + }, + + conclude-errorPDU [11] IMPLICIT INTEGER + { + other (0), + invalid-serviceError (1), + value-out-of-range (2) + } + } + } + + +-- *************************************** VMD ******************************************** + + +Status-Request ::= BOOLEAN + +Status-Response ::= SEQUENCE { + vmdLogicalStatus [0] IMPLICIT INTEGER { + state-changes-allowed (0), + no-state-changes-allowed (1), + limited-services-allowed (2), + support-services-allowed (3) + }, + vmdPhysicalStatus [1] IMPLICIT INTEGER { + operational (0), + partially-operational (1), + inoperable (2), + needs-commissioning (3) + }, + localDetail [2] IMPLICIT BIT STRING(SIZE(0..128)) OPTIONAL + + } + +------------------------------- UNSOLICITEDSTATUS -------------------------------- + +UnsolicitedStatus ::= Status-Response + +--------------------------------- GETNAMELIST -------------------------------- + +GetNameList-Request ::= SEQUENCE + { + extendedObjectClass [0] CHOICE + { + objectClass [0] IMPLICIT INTEGER + { + nammedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + }, + objectScope [1] CHOICE + { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL + } + +GetNameList-Response ::= SEQUENCE + { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +---------------------------------- IDENTIFY -------------------------------- + +Identify-Request ::= NULL + +Identify-Response ::= SEQUENCE { + vendorName [0] IMPLICIT VisibleString, + modelName [1] IMPLICIT VisibleString, + revision [2] IMPLICIT VisibleString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL + } + +---------------------------------- RENAME -------------------------------- + +Rename-Request ::= SEQUENCE + { + extendedObjectClass [0] CHOICE { + objectClass [0] IMPLICIT INTEGER + { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + + }, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier + } + +Rename-Response ::= NULL + +---------------------------------- GET CAPABILITY LIST -------------------------------- + +GetCapabilityList-Request ::= SEQUENCE { + continueAfter VisibleString OPTIONAL + } + +GetCapabilityList-Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + + + + +-- ************************************* DOMAIN **************************************** + +InitiateDownloadSequence-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString, + sharable [2] IMPLICIT BOOLEAN + } + +InitiateDownloadSequence-Response ::= NULL + +---------------------------------- DOWNLOAD SEGMENT ----------------------------------- + +DownloadSegment-Request ::= Identifier + +DownloadSegment-Response ::= SEQUENCE + { + loadData CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-------------------------------- TERMINATE DOWNLOAD ----------------------------------- + +TerminateDownloadSequence-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL + } + +TerminateDownloadSequence-Response ::= NULL + +-------------------------------- INITIATE UPLOAD ----------------------------------- + +InitiateUploadSequence-Request ::= Identifier -- Domain Name + +InitiateUploadSequence-Response ::= SEQUENCE + { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString + } + +---------------------------------- UPLOAD SEGMENT ----------------------------------- + +UploadSegment-Request ::= Integer32 -- ULSM Identifier + +UploadSegment-Response ::= SEQUENCE + { + loadData CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-------------------------------- TERMINATE UPLOAD ----------------------------------- + +TerminateUploadSequence-Request ::= Integer32 -- ULSM Identifer + +TerminateUploadSequence-Response ::= NULL + +----------------------------- REQUEST DOMAIN DOWNLOAD ----------------------------------- + +RequestDomainDownload-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName + } +RequestDomainDownload-Response ::= NULL + +----------------------------- REQUEST DOMAIN UPLOAD ----------------------------------- + +RequestDomainUpload-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName + } + +RequestDomainUpload-Response ::= NULL + +----------------------------- LOAD DOMAIN CONTENT ----------------------------------- + +LoadDomainContent-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName, + thirdParty [5] IMPLICIT ApplicationReference OPTIONAL + } + +LoadDomainContent-Response ::= NULL + +----------------------------- STORE DOMAIN CONTENT ----------------------------------- + +StoreDomainContent-Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + filenName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL + } + +StoreDomainContent-Response ::= NULL + +----------------------------- DELETE DOMAIN ----------------------------------- + +DeleteDomain-Request ::= Identifier -- Domain Name + +DeleteDomain-Response ::= NULL + +----------------------------- GET DOMAIN ATTRIBUTES ----------------------------------- + +GetDomainAttributes-Request ::= Identifier -- Domain Name + +GetDomainAttributes-Response ::= SEQUENCE + { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, -- PI Names + uploadInProgress [5] IMPLICIT Integer8 + } + + +DomainState ::= INTEGER + { + non-existent (0), + loading (1), + ready (2), + in-use (3), + complete (4), + incomplete (5), + d1 (7), + d2 (8), + d3 (9), + d4 (10), + d5 (11), + d6 (12), + d7 (13), + d8 (14), + d9 (15) + } + +-- ********************************* PROGRAM INVOCATION ********************************* + + +----------------------CREATE PROGRAM INVOCATION --------------------- + +CreateProgramInvocation-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainName [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring + -- FALSE indicates CURRENT monitoring + } + +CreateProgramInvocation-Response ::= NULL + +----------------------DELETE PROGRAM INVOCATION --------------------- + +DeleteProgramInvocation-Request ::= Identifier -- Program Invocation Name + +DeleteProgramInvocation-Response ::= NULL + +----------------------------- START ------------------------------------ + +Start-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + +Start-Response ::= NULL + +Start-Error ::= ProgramInvocationState + +----------------------------- STOP ------------------------------------ + +Stop-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Stop-Response ::= NULL + +Stop-Error ::= ProgramInvocationState + +---------------------------- RESUME ------------------------------------ + +Resume-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + +Resume-Response ::= NULL + +Resume-Error ::= ProgramInvocationState + +------------------------------ RESET ------------------------------------ + +Reset-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Reset-Response ::= NULL + +Reset-Error ::= ProgramInvocationState + +------------------------------ KILL ------------------------------------ + +Kill-Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Kill-Response ::= NULL + +--------------------------- GET PI ATTRIBUTES ------------------------------------ + +GetProgramInvocationAttributes-Request ::= Identifier -- Program Invocation Name + +GetProgramInvocationAttributes-Response ::= SEQUENCE + { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + startArgument [5] IMPLICIT VisibleString, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + + +ProgramInvocationState ::= INTEGER + { + non-existent (0), + unrunable (1), + idle (2), + running (3), + stopped (4), + starting (5), + stopping (6), + resuming (7), + resetting (8) + } + -- Companion Standard may add additional values + + +-- *********************************** VARIABLES **************************************** + + +TypeSpecification ::= CHOICE + { + typeName [0] ObjectName, + array [1] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification, + }, + structure [2] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + }, + + -- Simple Type -------- Size --------- + boolean [3] IMPLICIT NULL, + bit-string [4] IMPLICIT Integer32, + integer [5] IMPLICIT Unsigned8, + unsigned [6] IMPLICIT Unsigned8, + octet-string [9] IMPLICIT Integer32, + visible-string [10] IMPLICIT Integer32, + generalized-time [11] IMPLICIT NULL, + binary-time [12] IMPLICIT BOOLEAN, + bcd [13] IMPLICIT Unsigned8, + objId [15] IMPLICIT NULL + } + +AlternateAccess ::= SEQUENCE OF CHOICE + { + unnamed AlternateAccessSelection, + named [5] IMPLICIT SEQUENCE + { + componentName [0] IMPLICIT Identifier, + accesst AlternateAccessSelection + } + } + +AlternateAccessSelection ::= CHOICE + { + selectAccess CHOICE + { + component [1] IMPLICIT Identifier, + index [2] IMPLICIT Unsigned32, + indexRange [3] IMPLICIT SEQUENCE + { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [4] IMPLICIT NULL -- all array elements + } + } + + +-------------------------------- READ ------------------------------- + +Read-Request ::= SEQUENCE + { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecificatn [1] VariableAccessSpecification + } + + +Read-Response ::= SEQUENCE + { + variableAccessSpecificatn [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult + } + +-------------------------------- WRITE ------------------------------- + + + +Write-Request ::= SEQUENCE + { + variableAccessSpecificatn VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data + } + +Write-Response ::= SEQUENCE OF CHOICE + { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL + } + +---------------------------- INFORMATION REPORT -------------------------------- + +InformationReport ::= SEQUENCE + { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult + } + +------------------------- GET VARIABLE ACCESS ATTRIBUTES ------------------------ + +GetVariableAccessAttributes-Request ::= CHOICE + { + name [0] ObjectName, + address [1] Address + } + + +GetVariableAccessAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeSpecification [2] TypeSpecification + } +--------------------------- DEFINE NAMED VARIABLE -------------------------------- + +DefineNamedVariable-Request ::= SEQUENCE + { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL + } + +DefineNamedVariable-Response ::= NULL + +-------------------------- DEFINE SCATTERED ACCESS ------------------------------- + +DefineScatteredAccess-Request ::= SEQUENCE + { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription + } + + +DefineScatteredAccess-Response ::= NULL + +------------------------- GET SCATTERED ACCESS ATTRIBUTES ------------------------ + +GetScatteredAccessAttributes-Request ::= ObjectName -- ScatteredAccessName + + +GetScatteredAccessAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription + } + +----------------------------- DELETE VARIABLE ACCESS ------------------------------ + +DeleteVariableAccess-Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + +DeleteVariableAccess-Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + +DeleteVariableAccess-Error ::= Unsigned32 -- numberDeleted + +------------------------- DEFINE NAMED VAR. LIST ------------------------------- + +DefineNamedVariableList-Request ::= SEQUENCE + { + variableListName ObjectName, + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } + } + + +DefineNamedVariableList-Response ::= NULL + +------------------------- GET NAMED VAR. LIST ATTRIBUTES ------------------------ + +GetNamedVariableListAttributes-Request ::= ObjectName -- VariableListName + + +GetNamedVariableListAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } + } + +------------------------- DELETE NAMED VAR. LIST ------------------------------- + +DeleteNamedVariableList-Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + + +DeleteNamedVariableList-Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + +DeleteNamedVariableList-Error ::= Unsigned32 -- number Deleted + +------------------------- DEFINE NAMED TYPE ------------------------------- + +DefineNamedType-Request ::= SEQUENCE + { + typeName ObjectName, + typeSpecification TypeSpecification + } + + +DefineNamedType-Response ::= NULL + + +------------------------- GET NAMED TYPE ATTRIB. ------------------------------- + +GetNamedTypeAttributes-Request ::= ObjectName -- TypeName + +GetNamedTypeAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification + } + +------------------------- DELETE NAMED TYPE ------------------------------- + +DeleteNamedType-Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + +DeleteNamedType-Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + +DeleteNamedType-Error ::= Unsigned32 -- number Deleted + +---------------------------- SUPPORT DEFINITIONS ---------------------------- + +AccessResult ::= CHOICE + { + failure [0] IMPLICIT DataAccessError, + success Data + } + + +DataAccessError ::= INTEGER + { + object-invalidated (0), + hardware-fault (1), + temporarly-unavailable (2), + object-access-denied (3), + object-undefined (4), + invalid-address (5), + type-unsupported (6), + type-inconsistent (7), + object-attribute-inconsistent (8), + object-access-unsupported (9), + object-non-existent (10) + } + + + +Data ::= CHOICE + { + -- context tag 0 is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, + floating-point [7] IMPLICIT FloatingPoint, + real [8] IMPLICIT REAL, + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, + booleanArray [14] IMPLICIT BIT STRING + } + +FloatingPoint ::= OCTET STRING + + +VariableAccessSpecification ::= CHOICE + { + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + }, + variableListName [1] ObjectName + } + + +ScatteredAccessDescription ::= SEQUENCE OF SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification, + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL + } + + +VariableSpecification ::= CHOICE + { + name [0] ObjectName, + address [1] Address, + variableDescription [2] IMPLICIT SEQUENCE + { + address Address, + typeSpecification TypeSpecification + }, + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, + invalidated [4] IMPLICIT NULL + } + +Address ::= CHOICE + { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] IMPLICIT VisibleString, + unconstrainedAddress [2] IMPLICIT OCTET STRING + } + + +-- ********************************* SEMAPHORES ***************************************** + +TakeControl-Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE, + applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL + } + +TakeControl-Response ::= CHOICE + { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier + } + +-------------------------------- RELINQUISH CONTROL ----------------------------- + +RelinquishControl-Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL + } + +RelinquishControl-Response ::= NULL + +------------------------------- DEFINE SEMAPHORE -------------------------------- + +DefineSemaphore-Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + numbersOfTokens [1] IMPLICIT Unsigned16 + } + +DefineSemaphore-Response ::= NULL + +------------------------------- DELETE SEMAPHORE -------------------------------- + +DeleteSemaphore-Request ::= ObjectName -- Semaphore Name + +DeleteSemaphore-Response ::= NULL + +--------------------------- REPORT SEMAPHORE STATUS ----------------------------- + +ReportSemaphoreStatus-Request ::= ObjectName -- SemaphoreName + +ReportSemaphoreStatus-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER + { + token (0), + pool (1) + }, + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16 + } + +--------------------------- REPORT POOL SEMAPHORE STATUS ----------------------------- + +ReportPoolSemaphoreStatus-Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL + } + +ReportPoolSemaphoreStatus-Response ::= SEQUENCE + { + listOfNamedTokens [0] IMPLICIT SEQUENCE OF CHOICE + { + freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +--------------------------- REPORT SEMAPHORE ENTRY STATUS ----------------------------- + +ReportSemaphoreEntryStatus-Request ::=SEQUENCE + { + semaphoreName [0] ObjectName, + state [1] IMPLICIT INTEGER + { + queued (0), + owner (1), + hung (2) + } , + entryIdToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL + } + +ReportSemaphoreEntryStatus-Response ::= SEQUENCE + { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +AttachToSemaphore ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +SemaphoreEntry ::= SEQUENCE + { + entryId [0] IMPLICIT OCTET STRING, + entryClass [1] IMPLICIT INTEGER + { + simple (0), + modifier (1) + }, + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT 64, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE + } + +--******************************** OPERATOR COMMUNICATION ***************************** + + +------------------------------------------ INPUT ------------------------------------ + +Input-Request ::= SEQUENCE + { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, + listOfPromptData [2] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL + } + + +Input-Response ::= VisibleString -- Input String + +--------------------------------------- OUTPUT ------------------------------------- + +Output-Request ::= SEQUENCE + { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF VisibleString + } + + +Output-Response ::= NULL + + +-- ************************************ EVENTS ********************************************* + +DefineEventCondition-Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC-Class, + prio-rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL + } + +DefineEventCondition-Response ::= NULL + + +DeleteEventCondition-Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL + } + +DeleteEventCondition-Response ::= Unsigned32 -- Candidates Not Deleted + + +GetEventConditionAttributes-Request ::= ObjectName -- Event Condition Name + +GetEventConditionAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC-Class, + prio-rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable [6] CHOICE + { + variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL + } OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL + } + + +ReportEventConditionStatus-Request ::= ObjectName -- EventConditionName + +ReportEventConditionStatus-Response ::= SEQUENCE + { + currentState [0] IMPLICIT EC-State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL + } + + +AlterEventConditionMonitoring-Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL, + evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL + } + +AlterEventConditionMonitoring-Response ::= NULL + + +TriggerEvent-Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL + } + +TriggerEvent-Response ::= NULL + + +DefineEventAction-Request ::= SEQUENCE + { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL, + confirmed-Service-Request [2] DefineEventAction-ConfirmedServiceRequest + + } + + +DefineEventAction-Response ::= NULL + +DeleteEventAction-Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL + } + +DeleteEventAction-Response ::= Unsigned32 -- candidates not deleted + +GetEventActionAttributes-Request ::= ObjectName -- Event Action Name + + +GetEventActionAttributes-Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier, + confirmed-Service-Request [2] DefineEventAction-ConfirmedServiceRequest + } + +ReportEventActionStatus-Request ::= ObjectName -- EventActionName + +ReportEventActionStatus-Response ::= Unsigned32 -- Number of Event Enrollments + + +DefineEventEnrollment-Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransition [2] IMPLICIT Transitions, + alarmAcknowledgementRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL, + clientApplication [5] ApplicationReference OPTIONAL + } + +DefineEventEnrollment-Response ::= NULL + +DefineEventEnrollment-Error ::= ObjectName + + +DeleteEventEnrollment-Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName + } + +DeleteEventEnrollment-Response ::= Unsigned32 -- candidates not deleted + + +GetEventEnrollmentAttributes-Request ::= SEQUENCE + { + scopeOfRequest [0] IMPLICIT INTEGER + { + specific (0), + client (1), + ec (2), + ea (3) + } DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + clientApplication [2] ApplicationReference OPTIONAL, + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL + } + + +EventEnrollment ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE + { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + eventActionName [2] CHOICE + { + eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL + } OPTIONAL, + clientApplication [3] ApplicationReference OPTIONAL, + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE-Class, + duration [6] IMPLICIT EE-Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL + } + + +GetEventEnrollmentAttributes-Response ::= SEQUENCE + { + listOfEventEnrollment [0] IMPLICIT SEQUENCE OF EventEnrollment, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +ReportEventEnrollmentStatus-Request ::= ObjectName -- Event Enrollment Name + +ReportEventEnrollmentStatus-Response ::= SEQUENCE + { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE-Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE-State + } + +AlterEventEnrollment-Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL + } + +AlterEventEnrollment-Response ::= SEQUENCE + { + currentState [0] CHOICE + { + state [0] IMPLICIT EE-State, + undefined [1] IMPLICIT NULL + }, + transitionTime [1] EventTime + } + + +AcknowledgeEventNotification-Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC-State, + timeOfAcknowledgedTransition [3] EventTime + } + +AcknowledgeEventNotification-Response ::= NULL + + +GetAlarmSummary-Request ::= SEQUENCE + { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER + { + not-acked (0), + acked (1), + all (2) + } DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE + { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL + } + +GetAlarmSummary-Response ::= SEQUENCE + { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +AlarmSummary ::= SEQUENCE + { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC-State, + unacknowledgedState [3] IMPLICIT INTEGER + { + none (0), + active (1), + idle (2), + both (3) + }, + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL + } + + +GetAlarmEnrollmentSummary-Request ::= SEQUENCE + { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER + { + not-acked (0), + acked (1), + all (2) + } DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE + { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } DEFAULT {mostSevere 0, leastSevere 127}, + continueAfter [5] ObjectName OPTIONAL + } + +GetAlarmEnrollmentSummary-Response ::= SEQUENCE + { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +AlarmEnrollmentSummary ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + clientApplication [2] ApplicationReference OPTIONAL, + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC-State, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + enrollementState [8] IMPLICIT EE-State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL + } + + +EventNotification ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE + { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + severity [2] IMPLICIT Unsigned8, + currentState [3] IMPLICIT EC-State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult [8] IMPLICIT SEQUENCE + { + eventActioName ObjectName, + eventActionResult CHOICE + { + success [0] ConfirmedServiceResponse, + failure [1] IMPLICIT ServiceError + } + } OPTIONAL + } + + +AttachToEventCondition ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL + } + + +EventTime ::= CHOICE + { + timeOfDayT [0] IMPLICIT TimeOfDay, + timeSequenceIdentifier [1] IMPLICIT Unsigned32 + } + + +EC-Class ::= INTEGER + { + network-triggered (0), + monitored (1) + } + +EC-State ::= INTEGER + { + disabled (0), + idle (1), + active (2) + } + +EE-State ::= INTEGER + { + disabled (0), + idle (1), + active (2), + activeNoAckA (3), + idleNoAckI (4), + idleNoAckA (5), + idleAcked (6), + activeAcked (7) + } + +Transitions ::= BIT STRING + { + idle-to-disabled (0), + active-to-disabled (1), + disabled-to-idle (2), + active-to-idle (3), + disabled-to-active (4), + idle-to-active (5), + any-to-deleted (6) + } + +AlarmAckRule ::= INTEGER + { + none (0), + simple (1), + ack-active (2), + ack-all (3) + } + +EE-Class ::= INTEGER + { + modifier (0), + notification (1) + } + +EE-Duration ::= INTEGER + { + current (0), + permanent (1) + } + + +-- ********************************** JOURNAL ******************************************* + + +---------------------------------- READ JOURNAL ---------------------------------- + +ReadJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName, + rangeStartSpecification [1] CHOICE + { + startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING + } OPTIONAL, + rangeStopSpecification [2] CHOICE + { + endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32 + } OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter [5] IMPLICIT SEQUENCE + { + timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING + } + } + +ReadJournal-Response ::= SEQUENCE + { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +JournalEntry ::= SEQUENCE + { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent + } + +---------------------------------- WRITE JOURNAL ---------------------------------- + +WriteJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent + } + +WriteJournal-Response ::= NULL + +-------------------------------- INITIALIZE JOURNAL ---------------------------------- + +InitializeJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName, + limitSpecification [1] IMPLICIT SEQUENCE + { + limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL + } OPTIONAL + } + +InitializeJournal-Response ::= Unsigned32 -- entries deleted + +---------------------------------- REPORT JOURNAL STATUS ----------------------------- + +ReportJournalStatus-Request ::= ObjectName -- Journal Name + +ReportJournalStatus-Response ::= SEQUENCE + { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN + } + +---------------------------------- CREATE JOURNAL ---------------------------------- + +CreateJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName + } + +CreateJournal-Response ::= NULL + +---------------------------------- DELETE JOURNAL ---------------------------------- + +DeleteJournal-Request ::= SEQUENCE + { + journalName [0] ObjectName + } + +DeleteJournal-Response ::= NULL + + +-------------------------------- SUPPORTING PRODUCTIONS ---------------------------- + +EntryContent ::= SEQUENCE + { + occurenceTime [0] IMPLICIT TimeOfDay, + additionalDetail [1] JOU-Additional-Detail OPTIONAL, + -- additionalDetail shall be omitted + -- from abstract syntax defined in this standard + entryForm CHOICE + { + data [2] IMPLICIT SEQUENCE + { + event [0] IMPLICIT SEQUENCE + { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State + } OPTIONAL, + listOfVariables [1] IMPLICIT SEQUENCE OF SEQUENCE + { + variableTag [0] IMPLICIT VisibleString, + valueSpecification [1] Data + } OPTIONAL + }, + annotation [3] IMPLICIT VisibleString + } + } + + +JOU-Additional-Detail ::= NULL -- Defined by Companion Standard + + + +-- **************************************** FILES ********************************************* + +ObtainFile-Request ::= SEQUENCE { + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName + } + +ObtainFile-Response ::= NULL + +ObtainFile-Error ::= INTEGER { + source-file (0), + destination-file (1) + } + + +FileOpen-Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32 + } + +FileOpen-Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes + } + +FileRead-Request ::= Integer32 + +FileRead-Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +FileClose-Request ::= Integer32 + +FileClose-Response ::= NULL + + +FileRename-Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName + } + +FileRename-Response ::= NULL + +FileRename-Error ::= INTEGER { + source-file (0), + destination-file (1) + } + +FileDelete-Request ::= FileName + +FileDelete-Response ::= NULL + + +FileDirectory-Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL + } + +FileDirectory-Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + +DirectoryEntry ::= SEQUENCE { + filename [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes + } + + +FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL + } + + + +END + diff --git a/src/asn1/mms/more-asn1-files/mms-stefan.asn b/src/asn1/mms/more-asn1-files/mms-stefan.asn new file mode 100644 index 0000000..210090a --- /dev/null +++ b/src/asn1/mms/more-asn1-files/mms-stefan.asn @@ -0,0 +1,318 @@ +MMSDEF DEFINITIONS::= +BEGIN + +MMSpdu ::= CHOICE { +confirmed_RequestPDU [0] IMPLICIT Confirmed_RequestPDU, +confirmed_ResponsePDU [1] IMPLICIT Confirmed_ResponsePDU, +initiate_RequestPDU [8] IMPLICIT Initiate_RequestPDU, +initiate_ResponsePDU [9] IMPLICIT Initiate_ResponsePDU +} + +Initiate_RequestPDU ::= SEQUENCE { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initRequestDetail [4] IMPLICIT SEQUENCE { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions + } +} + +Initiate_ResponsePDU ::= SEQUENCE { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + initResponseDetail [4] IMPLICIT SEQUENCE { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions + } +} + +ParameterSupportOptions ::= BIT STRING { + + str1 (0), + str2 (1), + vnam (2), + valt (3), + vadr (4), + -- bit 5 is reserved + vsca (5), + tpy (6), + vlis (7), + -- bit 8 is reserved + -- bit 9 is reserved + cei (10), + aco (11), + sem (12), + csr (13), + csnc (14), + csplc (15), + cspi (16) +} + +ServiceSupportOptions ::= BIT STRING { + status (0), + getNameList (1), + identify (2), + rename (3), + read (4), + write (5), + getVariableAccessAttributes (6), + defineNamedVariable (7), + -- bit 8 is reserved for use of a service defined in annex E + defineScatteredAccess (8), + -- bit 9 is reserved for use of a service defined in annex E + getScatteredAccessAttributes (9), + deleteVariableAccess (10), + defineNamedVariableList (11), + getNamedVariableListAttributes (12), + deleteNamedVariableList (13), + defineNamedType (14), + getNamedTypeAttributes (15), + deleteNamedType (16), + input (17), + output (18), + takeControl (19), + relinquishControl (20), + defineSemaphore (21), + deleteSemaphore (22), + reportSemaphoreStatus (23), + reportPoolSemaphoreStatus (24), + reportSemaphoreEntryStatus (25), + initiateDownloadSequence (26), + downloadSegment (27), + terminateDownloadSequence (28), + initiateUploadSequence (29), + uploadSegment (30), + terminateUploadSequence (31), + requestDomainDownload (32), + requestDomainUpload (33), + loadDomainContent (34), + storeDomainContent (35), + deleteDomain (36), + getDomainAttributes (37), + createProgramInvocation (38), + deleteProgramInvocation (39), + start (40), + stop (41), + resume (42), + reset (43), + kill (44), + getProgramInvocationAttributes (45), + obtainFile (46), + defineEventCondition (47), + deleteEventCondition (48), + getEventConditionAttributes (49), + reportEventConditionStatus (50), + alterEventConditionMonitoring (51), + triggerEvent (52), + defineEventAction (53), + deleteEventAction (54), + getEventActionAttributes (55), + reportEventActionStatus (56), + defineEventEnrollment (57), + deleteEventEnrollment (58), + alterEventEnrollment (59), + reportEventEnrollmentStatus (60), + getEventEnrollmentAttributes (61), + acknowledgeEventNotification (62), + getAlarmSummary (63), + getAlarmEnrollmentSummary (64), + readJournal (65), + writeJournal (66), + initializeJournal (67), + reportJournalStatus (68), + createJournal (69), + deleteJournal (70), + getCapabilityList (71), + -- bit 72 is reserved for use of a service defined in annex D + fileOpen (72), + -- bit 73 is reserved for use of a service defined in annex D + fileRead (73), + -- bit 74 is reserved for use of a service defined in annex D + fileClose (74), + -- bit 75 is reserved for use of a service defined in annex D + fileRename (75), + -- bit 76 is reserved for use of a service defined in annex D + fileDelete (76), + -- bit 77 is reserved for use of a service defined in annex D + fileDirectory (77), + unsolicitedStatus (78), + informationReport (79), + eventNotification (80), + attachToEventCondition (81), + attachToSemaphore (82), + conclude (83), + cancel (84), + getDataExchangeAttributes (85), + -- Shall not appear in minor version one + exchangeData (86), + -- Shall not appear in minor version one + defineAccessControlList (87), + -- Shall not appear in minor version one or two + getAccessControlListAttributes (88), + -- Shall not appear in minor version one or two + reportAccessControlledObjects (89), + -- Shall not appear in minor version one or two + deleteAccessControlList (90), + -- Shall not appear in minor version one or two + alterAccessControl (91), + -- Shall not appear in minor version one or two + reconfigureProgramInvocation (92) +} + + + +Confirmed_RequestPDU ::= SEQUENCE { +invokeID Unsigned32, +service ConfirmedServiceRequest +} + +Confirmed_ResponsePDU ::= SEQUENCE { +invokeID Unsigned32, +service ConfirmedServiceResponse +} + +GetNameList_Response ::= SEQUENCE { +listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, +moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE +} + + + +Integer8 ::= INTEGER(-128..127) -- range -128 <= i <= 127 +Integer16 ::= INTEGER(-32768..32767) -- range -32,768 <= i <= 32,767 +Integer32 ::= INTEGER(-2147483648..2147483647) -- range -2**31 <= i < 2**31 +Unsigned8 ::= INTEGER + + Unsigned16 ::= INTEGER(0..32767) -- range 0 <= i <= 32767 + +Unsigned32 ::= INTEGER(0..2147483647) -- range 0 <= i <= 2**31 - 1 + +ConfirmedServiceRequest ::= CHOICE { + getNameList [1] IMPLICIT GetNameList_Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes_Request +} + +GetVariableAccessAttributes_Request ::= CHOICE +{ + name [0] ObjectName, + address [1] Address +} + +ObjectName ::= CHOICE + { + vmd_specific [0] IMPLICIT Identifier, + domain_specific [1] IMPLICIT SEQUENCE + { + domainId Identifier, + itemId Identifier + }, + aa_specific [2] IMPLICIT Identifier + } + + Address ::= CHOICE + { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] IMPLICIT VisibleString, + unconstrainedAddress [2] IMPLICIT OCTET STRING + } + + + +ConfirmedServiceResponse ::= CHOICE { + getNameList [1] IMPLICIT GetNameList_Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes_Response +} + +GetVariableAccessAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeSpecification [2] TypeSpecification + } + +TypeSpecification ::= CHOICE + { + typeName [0] ObjectName, + array [1] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification + }, + structure [2] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF StructComponent + }, + + -- Simple Type -------- Size --------- + tboolean [3] IMPLICIT NULL, + bit_string [4] IMPLICIT Integer32, + integer [5] IMPLICIT Unsigned8, + unsigned [6] IMPLICIT Unsigned8, + floating_point [7] IMPLICIT SEQUENCE { + + format_width Unsigned8, -- number of bits of + -- floating point value + -- including sign, exponent, + -- and fraction + exponent_width Unsigned8 -- size of exponent in bits + }, + octet_string [9] IMPLICIT Integer32, + visible_string [10] IMPLICIT Integer32, + generalized_time [11] IMPLICIT NULL, + binary_time [12] IMPLICIT BOOLEAN, + bcd [13] IMPLICIT Unsigned8, + objId [15] IMPLICIT NULL, + mMSString [16] Integer32, + -- added by stefan + timestamp [17] IMPLICIT NULL + } + +StructComponent ::= SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + + +GetNameList_Request ::= SEQUENCE { + objectClass [0] ObjectClass, + objectScope [1] CHOICE { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL +} + + + +Identifier ::= VisibleString + +ObjectClass ::= CHOICE { + +basicObjectClass [0] IMPLICIT INTEGER { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11), + dataExchange (12), -- Shall not appear in minor version 1 + accessControlList (13) -- Shall not appear in minor version 1 or 2 + } +} + +END \ No newline at end of file diff --git a/src/asn1/mms/more-asn1-files/mms-uniroma.asn b/src/asn1/mms/more-asn1-files/mms-uniroma.asn new file mode 100644 index 0000000..ef12923 --- /dev/null +++ b/src/asn1/mms/more-asn1-files/mms-uniroma.asn @@ -0,0 +1,2217 @@ +--Quelle: http://minerva.netgroup.uniroma2.it/svn/discreet/tfcproject/trunk/wireshark/asn1/mms/mms.asn +-- ASN definition from +-- http://www.sisconet.com/techinfo.htm +-- slightly modified +-- +-- +--Corrections made July 2, 1994 +-- +-- +-- Modified to pass asn2wrs + +MMS { iso standard 9506 part(2) mms-general-module-version(2) } + +DEFINITIONS ::= + +BEGIN + +EXPORTS MMSpdu; + +IMPORTS + EXTERNAL, + AP-title, + AP-invocation-identifier, + AE-qualifier, + AE-invocation-identifier +FROM ISO-8650-ACSE-1; + + +MMSpdu ::= CHOICE + { + confirmed_RequestPDU [0] IMPLICIT Confirmed_RequestPDU, + confirmed_ResponsePDU [1] IMPLICIT Confirmed_ResponsePDU, + confirmed_ErrorPDU [2] IMPLICIT Confirmed_ErrorPDU, + unconfirmed_PDU [3] IMPLICIT Unconfirmed_PDU, + rejectPDU [4] IMPLICIT RejectPDU, + cancel_RequestPDU [5] IMPLICIT Cancel_RequestPDU, + cancel_ResponsePDU [6] IMPLICIT Cancel_ResponsePDU, + cancel_ErrorPDU [7] IMPLICIT Cancel_ErrorPDU, + initiate_RequestPDU [8] IMPLICIT Initiate_RequestPDU, + initiate_ResponsePDU [9] IMPLICIT Initiate_ResponsePDU, + initiate_ErrorPDU [10] IMPLICIT Initiate_ErrorPDU, + conclude_RequestPDU [11] IMPLICIT Conclude_RequestPDU, + conclude_ResponsePDU [12] IMPLICIT Conclude_ResponsePDU, + conclude_ErrorPDU [13] IMPLICIT Conclude_ErrorPDU + } + + +Confirmed_RequestPDU ::= SEQUENCE + { + invokeID Unsigned32, + listOfModifier SEQUENCE OF Modifier OPTIONAL, + confirmedServiceRequest ConfirmedServiceRequest, + cs_Request-detail [79] CS_Request-Detail OPTIONAL + } + + +Unconfirmed_PDU ::= SEQUENCE + { + unconfirmedService UnconfirmedService, + cs_Request-detail [79] CS_Request-Detail OPTIONAL + } + + +Confirmed_ResponsePDU ::= SEQUENCE + { + invokeID Unsigned32, + confirmedServiceResponse ConfirmedServiceResponse, + cs_Request-detail [79] CS_Request-Detail OPTIONAL + } + + +Confirmed_ErrorPDU ::= SEQUENCE + { + invokeID [0] IMPLICIT Unsigned32, + modifierPosition [1] IMPLICIT Unsigned32 OPTIONAL, + serviceError [2] IMPLICIT ServiceError + } + + +UnconfirmedService ::= CHOICE + { + informationReport [0] IMPLICIT InformationReport, + unsolicitedStatus [1] IMPLICIT UnsolicitedStatus, + eventNotification [2] IMPLICIT EventNotification +-- XXX this one is neither in this ASN nor in the IMPORTS +-- additionalService [3] AdditionalUnconfirmedService + } + + +Modifier ::= CHOICE + { + attach-To-Event-Condition [0] IMPLICIT AttachToEventCondition, + attach-To-Semaphore [1] IMPLICIT AttachToSemaphore + } + + +ConfirmedServiceRequest ::= CHOICE + { + status [0] IMPLICIT Status_Request, + getNameList [1] IMPLICIT GetNameList_Request, + identify [2] IMPLICIT Identify_Request, + rename [3] IMPLICIT Rename_Request, + read [4] IMPLICIT Read_Request, + write [5] IMPLICIT Write_Request, + getVariableAccessAttributes [6] GetVariableAccessAttributes_Request, + defineNamedVariable [7] IMPLICIT DefineNamedVariable_Request, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess_Request, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes_Request, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess_Request, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList_Request, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes_Request, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList_Request, + defineNamedType [14] IMPLICIT DefineNamedType_Request, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes_Request, + deleteNamedType [16] IMPLICIT DeleteNamedType_Request, + input [17] IMPLICIT Input_Request, + output [18] IMPLICIT Output_Request, + takeControl [19] IMPLICIT TakeControl_Request, + relinquishControl [20] IMPLICIT RelinquishControl_Request, + defineSemaphore [21] IMPLICIT DefineSemaphore_Request, + deleteSemaphore [22] IMPLICIT DeleteSemaphore_Request, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus_Request, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus_Request, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus_Request, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence_Request, + downloadSegment [27] IMPLICIT DownloadSegment_Request, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence_Request, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence_Request, + uploadSegment [30] IMPLICIT UploadSegment_Request, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence_Request, + requestDomainDownload [32] IMPLICIT RequestDomainDownload_Request, + requestDomainUpload [33] IMPLICIT RequestDomainUpload_Request, + loadDomainContent [34] IMPLICIT LoadDomainContent_Request, + storeDomainContent [35] IMPLICIT StoreDomainContent_Request, + deleteDomain [36] IMPLICIT DeleteDomain_Request, + getDomainAttributes [37] IMPLICIT GetDomainAttributes_Request, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Request, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation_Request, + start [40] IMPLICIT Start_Request, + stop [41] IMPLICIT Stop_Request, + resume [42] IMPLICIT Resume_Request, + reset [43] IMPLICIT Reset_Request, + kill [44] IMPLICIT Kill_Request, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes_Request, + obtainFile [46] IMPLICIT ObtainFile_Request, + defineEventCondition [47] IMPLICIT DefineEventCondition_Request, + deleteEventCondition [48] DeleteEventCondition_Request, + getEventConditionAttributes [49] GetEventConditionAttributes_Request, + reportEventConditionStatus [50] ReportEventConditionStatus_Request, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Request, + triggerEvent [52] IMPLICIT TriggerEvent_Request, + defineEventAction [53] IMPLICIT DefineEventAction_Request, + deleteEventAction [54] DeleteEventAction_Request, + getEventActionAttributes [55] GetEventActionAttributes_Request, + reportEventActionStatus [56] ReportEventActionStatus_Request, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Request, + deleteEventEnrollment [58] DeleteEventEnrollment_Request, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Request, + reportEventEnrollmentStatus [60] ReportEventEnrollmentStatus_Request, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes_Request, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification_Request, + getAlarmSummary [63] IMPLICIT GetAlarmSummary_Request, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary_Request, + readJournal [65] IMPLICIT ReadJournal_Request, + writeJournal [66] IMPLICIT WriteJournal_Request, + initializeJournal [67] IMPLICIT InitializeJournal_Request, + reportJournalStatus [68] IMPLICIT ReportJournalStatus_Request, + createJournal [69] IMPLICIT CreateJournal_Request, + deleteJournal [70] IMPLICIT DeleteJournal_Request, + getCapabilityList [71] IMPLICIT GetCapabilityList_Request, + fileOpen [72] IMPLICIT FileOpen_Request, + fileRead [73] IMPLICIT FileRead_Request, + fileClose [74] IMPLICIT FileClose_Request, + fileRename [75] IMPLICIT FileRename_Request, + fileDelete [76] IMPLICIT FileDelete_Request, + fileDirectory [77] IMPLICIT FileDirectory_Request +-- XXX this one is neither in this ASN nor in the IMPORTS +-- additionalService [78] AdditionalService_Request + } + +CS_Request-Detail ::= CHOICE { +-- see ISO 9506-2 +-- XXX can not handle empty choice +-- XXX fix me later + foo INTEGER + } + +ConfirmedServiceResponse ::= CHOICE + { + status [0] IMPLICIT Status_Response, + getNameList [1] IMPLICIT GetNameList_Response, + identify [2] IMPLICIT Identify_Response, + rename [3] IMPLICIT Rename_Response, + read [4] IMPLICIT Read_Response, + write [5] IMPLICIT Write_Response, + getVariableAccessAttributes [6] IMPLICIT GetVariableAccessAttributes_Response, + defineNamedVariable [7] IMPLICIT DefineNamedVariable_Response, + defineScatteredAccess [8] IMPLICIT DefineScatteredAccess_Response, + getScatteredAccessAttributes [9] IMPLICIT GetScatteredAccessAttributes_Response, + deleteVariableAccess [10] IMPLICIT DeleteVariableAccess_Response, + defineNamedVariableList [11] IMPLICIT DefineNamedVariableList_Response, + getNamedVariableListAttributes [12] IMPLICIT GetNamedVariableListAttributes_Response, + deleteNamedVariableList [13] IMPLICIT DeleteNamedVariableList_Response, + defineNamedType [14] IMPLICIT DefineNamedType_Response, + getNamedTypeAttributes [15] IMPLICIT GetNamedTypeAttributes_Response, + deleteNamedType [16] IMPLICIT DeleteNamedType_Response, + input [17] IMPLICIT Input_Response, + output [18] IMPLICIT Output_Response, + takeControl [19] TakeControl_Response, + relinquishControl [20] IMPLICIT RelinquishControl_Response, + defineSemaphore [21] IMPLICIT DefineSemaphore_Response, + deleteSemaphore [22] IMPLICIT DeleteSemaphore_Response, + reportSemaphoreStatus [23] IMPLICIT ReportSemaphoreStatus_Response, + reportPoolSemaphoreStatus [24] IMPLICIT ReportPoolSemaphoreStatus_Response, + reportSemaphoreEntryStatus [25] IMPLICIT ReportSemaphoreEntryStatus_Response, + initiateDownloadSequence [26] IMPLICIT InitiateDownloadSequence_Response, + downloadSegment [27] IMPLICIT DownloadSegment_Response, + terminateDownloadSequence [28] IMPLICIT TerminateDownloadSequence_Response, + initiateUploadSequence [29] IMPLICIT InitiateUploadSequence_Response, + uploadSegment [30] IMPLICIT UploadSegment_Response, + terminateUploadSequence [31] IMPLICIT TerminateUploadSequence_Response, + requestDomainDownLoad [32] IMPLICIT RequestDomainDownload_Response, + requestDomainUpload [33] IMPLICIT RequestDomainUpload_Response, + loadDomainContent [34] IMPLICIT LoadDomainContent_Response, + storeDomainContent [35] IMPLICIT StoreDomainContent_Response, + deleteDomain [36] IMPLICIT DeleteDomain_Response, + getDomainAttributes [37] IMPLICIT GetDomainAttributes_Response, + createProgramInvocation [38] IMPLICIT CreateProgramInvocation_Response, + deleteProgramInvocation [39] IMPLICIT DeleteProgramInvocation_Response, + start [40] IMPLICIT Start_Response, + stop [41] IMPLICIT Stop_Response, + resume [42] IMPLICIT Resume_Response, + reset [43] IMPLICIT Reset_Response, + kill [44] IMPLICIT Kill_Response, + getProgramInvocationAttributes [45] IMPLICIT GetProgramInvocationAttributes_Response, + obtainFile [46] IMPLICIT ObtainFile_Response, + fileOpen [72] IMPLICIT FileOpen_Response, + defineEventCondition [47] IMPLICIT DefineEventCondition_Response, + deleteEventCondition [48] IMPLICIT DeleteEventCondition_Response, + getEventConditionAttributes [49] IMPLICIT GetEventConditionAttributes_Response, + reportEventConditionStatus [50] IMPLICIT ReportEventConditionStatus_Response, + alterEventConditionMonitoring [51] IMPLICIT AlterEventConditionMonitoring_Response, + triggerEvent [52] IMPLICIT TriggerEvent_Response, + defineEventAction [53] IMPLICIT DefineEventAction_Response, + deleteEventAction [54] IMPLICIT DeleteEventAction_Response, + getEventActionAttributes [55] IMPLICIT GetEventActionAttributes_Response, + reportActionStatus [56] IMPLICIT ReportEventActionStatus_Response, + defineEventEnrollment [57] IMPLICIT DefineEventEnrollment_Response, + deleteEventEnrollment [58] IMPLICIT DeleteEventEnrollment_Response, + alterEventEnrollment [59] IMPLICIT AlterEventEnrollment_Response, + reportEventEnrollmentStatus [60] IMPLICIT ReportEventEnrollmentStatus_Response, + getEventEnrollmentAttributes [61] IMPLICIT GetEventEnrollmentAttributes_Response, + acknowledgeEventNotification [62] IMPLICIT AcknowledgeEventNotification_Response, + getAlarmSummary [63] IMPLICIT GetAlarmSummary_Response, + getAlarmEnrollmentSummary [64] IMPLICIT GetAlarmEnrollmentSummary_Response, + readJournal [65] IMPLICIT ReadJournal_Response, + writeJournal [66] IMPLICIT WriteJournal_Response, + initializeJournal [67] IMPLICIT InitializeJournal_Response, + reportJournalStatus [68] IMPLICIT ReportJournalStatus_Response, + createJournal [69] IMPLICIT CreateJournal_Response, + deleteJournal [70] IMPLICIT DeleteJournal_Response, + getCapabilityList [71] IMPLICIT GetCapabilityList_Response, + fileRead [73] IMPLICIT FileRead_Response, + fileClose [74] IMPLICIT FileClose_Response, + fileRename [75] IMPLICIT FileRename_Response, + fileDelete [76] IMPLICIT FileDelete_Response, + fileDirectory [77] IMPLICIT FileDirectory_Response +-- XXX this one is neither in this ASN nor in the IMPORTS +-- additionalService [78] AdditionalService_Response + } + +--********************************** COMMON MMS TYPES *********************************** + +FileName ::= SEQUENCE OF GraphicString + +TimeOfDay ::= OCTET STRING -- (SIZE (4 | 6)) + +Identifier ::= VisibleString + +Integer8 ::= INTEGER +Integer16 ::= INTEGER +Integer32 ::= INTEGER + + +Unsigned8 ::= INTEGER +Unsigned16 ::= INTEGER +Unsigned32 ::= INTEGER + + +ObjectName ::= CHOICE + { + vmd-specific [0] IMPLICIT Identifier, + domain-specific [1] IMPLICIT SEQUENCE + { + domainId Identifier, + itemId Identifier + }, + aa-specific [2] IMPLICIT Identifier + } + + +ApplicationReference ::= SEQUENCE + { + ap-title [0] AP-title OPTIONAL, + ap-invocation-id [1] AP-invocation-identifier OPTIONAL, + ae-qualifier [2] AE-qualifier OPTIONAL, + ae-invocation-id [3] AE-invocation-identifier OPTIONAL + } + + +Priority ::= Unsigned8 + +normalPriority Priority ::= 64 + + + + + +-- ************************************ GENERAL ************************************* + +Initiate_ErrorPDU ::= ServiceError + +Initiate_RequestPDU ::= SEQUENCE + { + localDetailCalling [0] IMPLICIT Integer32 OPTIONAL, + proposedMaxServOutstandingCalling [1] IMPLICIT Integer16, + proposedMaxServOutstandingCalled [2] IMPLICIT Integer16, + proposedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitRequestDetail [4] IMPLICIT InitRequestDetail + } + +InitRequestDetail ::= SEQUENCE + { + proposedVersionNumber [0] IMPLICIT Integer16, + proposedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalling [2] IMPLICIT ServiceSupportOptions + } + +Initiate_ResponsePDU ::= SEQUENCE + { + localDetailCalled [0] IMPLICIT Integer32 OPTIONAL, + negotiatedMaxServOutstandingCalling [1] IMPLICIT Integer16, + negotiatedMaxServOutstandingCalled [2] IMPLICIT Integer16, + negotiatedDataStructureNestingLevel [3] IMPLICIT Integer8 OPTIONAL, + mmsInitResponseDetail [4] IMPLICIT InitResponseDetail + } + +InitResponseDetail ::= SEQUENCE + { + negotiatedVersionNumber [0] IMPLICIT Integer16, + negotiatedParameterCBB [1] IMPLICIT ParameterSupportOptions, + servicesSupportedCalled [2] IMPLICIT ServiceSupportOptions + } + + +ParameterSupportOptions ::= BIT STRING { + str1 (0), + str2 (1), + vnam (2), + valt (3), + vadr (4), + vsca (5), + tpy (6), + vlis (7), + real (8), + cei (10) + } + + +ServiceSupportOptions ::= BIT STRING + { + status (0), + getNameList (1), + identify (2), + rename (3), + read (4), + write (5), + getVariableAccessAttributes (6), + defineNamedVariable (7), + defineScatteredAccess (8), + getScatteredAccessAttributes (9), + deleteVariableAccess (10), + defineNamedVariableList (11), + getNamedVariableListAttributes (12), + deleteNamedVariableList (13), + defineNamedType (14), + getNamedTypeAttributes (15), + deleteNamedType (16), + input (17), + output (18), + takeControl (19), + relinquishControl (20), + defineSemaphore (21), + deleteSemaphore (22), + reportSemaphoreStatus (23), + reportPoolSemaphoreStatus (24), + reportSemaphoreEntryStatus (25), + initiateDownloadSequence (26), + downloadSegment (27), + terminateDownloadSequence (28), + initiateUploadSequence (29), + uploadSegment (30), + terminateUploadSequence (31), + requestDomainDownload (32), + requestDomainUpload (33), + loadDomainContent (34), + storeDomainContent (35), + deleteDomain (36), + getDomainAttributes (37), + createProgramInvocation (38), + deleteProgramInvocation (39), + start (40), + stop (41), + resume (42), + reset (43), + kill (44), + getProgramInvocationAttributes (45), + obtainFile (46), + defineEventCondition (47), + deleteEventCondition (48), + getEventConditionAttributes (49), + reportEventConditionStatus (50), + alterEventConditionMonitoring (51), + triggerEvent (52), + defineEventAction (53), + deleteEventAction (54), + getEventActionAttributes (55), + reportActionStatus (56), + defineEventEnrollment (57), + deleteEventEnrollment (58), + alterEventEnrollment (59), + reportEventEnrollmentStatus (60), + getEventEnrollmentAttributes (61), + acknowledgeEventNotification (62), + getAlarmSummary (63), + getAlarmEnrollmentSummary (64), + readJournal (65), + writeJournal (66), + initializeJournal (67), + reportJournalStatus (68), + createJournal (69), + deleteJournal (70), + getCapabilityList (71), + fileOpen (72), + fileRead (73), + fileClose (74), + fileRename (75), + fileDelete (76), + fileDirectory (77), + unsolicitedStatus (78), + informationReport (79), + eventNotification (80), + attachToEventCondition (81), + attachToSemaphore (82), + conclude (83), + cancel (84) + } + +---------------------------------- CONCLUDE -------------------------------- + +Conclude_RequestPDU ::= NULL + +Conclude_ResponsePDU ::= NULL + +Conclude_ErrorPDU ::= ServiceError + +---------------------------------- CANCEL -------------------------------- + +Cancel_RequestPDU ::= Unsigned32 -- originalInvokeID + +Cancel_ResponsePDU ::= Unsigned32 -- originalInvokeID + +Cancel_ErrorPDU ::= SEQUENCE + { + originalInvokeID [0] IMPLICIT Unsigned32, + serviceError [1] IMPLICIT ServiceError + } + +------------------------------ Service_Error -------------------------------- + +ServiceError ::= SEQUENCE + { + errorClass [0] CHOICE + { + vmd-state [0] IMPLICIT INTEGER + { + other (0), + vmd-state-conflict (1), + vmd-operational-problem (2), + domain-transfer-problem (3), + state-machine-id-invalid (4) + }, + application-reference [1] IMPLICIT INTEGER + { + other (0), + aplication-unreachable (1), + connection-lost (2), + application-reference-invalid (3), + context-unsupported (4) + }, + definition [2] IMPLICIT INTEGER + { + other (0), + object-undefined (1), + invalid-address (2), + type-unsupported (3), + type-inconsistent (4), + object-exists (5), + object-attribute-inconsistent (6) + }, + resource [3] IMPLICIT INTEGER + { + other (0), + memory-unavailable (1), + processor-resource-unavailable (2), + mass-storage-unavailable (3), + capability-unavailable (4), + capability-unknown (5) + }, + service [4] IMPLICIT INTEGER + { + other (0), + primitives-out-of-sequence (1), + object-sate-conflict (2), + pdu-size (3), + continuation-invalid (4), + object-constraint-conflict (5) + }, + service-preempt [5] IMPLICIT INTEGER + { + other (0), + timeout (1), + deadlock (2), + cancel (3) + }, + time-resolution [6] IMPLICIT INTEGER + { + other (0), + unsupportable-time-resolution (1) + }, + access [7] IMPLICIT INTEGER + { + other (0), + object-access-unsupported (1), + object-non-existent (2), + object-access-denied (3), + object-invalidated (4) + }, + initiate [8] IMPLICIT INTEGER + { + other (0), + version-incompatible (1), + max-segment-insufficient (2), + max-services-outstanding-calling-insufficient (3), + max-services-outstanding-called-insufficient (4), + service-CBB-insufficient (5), + parameter-CBB-insufficient (6), + nesting-level-insufficient (7) + }, + conclude [9] IMPLICIT INTEGER + { + other (0), + further-communication-required (1) + }, + cancel [10] IMPLICIT INTEGER + { + other (0), + invoke-id-unknown (1), + cancel-not-possible (2) + }, + file [11] IMPLICIT INTEGER + { + other (0), + filename-ambiguous (1), + file-busy (2), + filename-syntax_Error (3), + content-type-invalid (4), + position-invalid (5), + file-acces-denied (6), + file-non-existent (7), + duplicate-filename (8), + insufficient-space-in-filestore (9) + }, + others [12] IMPLICIT INTEGER + }, + additionalCode [1] IMPLICIT INTEGER OPTIONAL, + additionalDescription [2] IMPLICIT VisibleString OPTIONAL, + serviceSpecificInformation [3] CHOICE + { + obtainFile [0] IMPLICIT ObtainFile_Error, + start [1] IMPLICIT Start_Error, + stop [2] IMPLICIT Stop_Error, + resume [3] IMPLICIT Resume_Error, + reset [4] IMPLICIT Reset_Error, + deleteVariableAccess [5] IMPLICIT DeleteVariableAccess_Error, + deleteNamedVariableList [6] IMPLICIT DeleteNamedVariableList_Error, + deleteNamedType [7] IMPLICIT DeleteNamedType_Error, + defineEventEnrollment_Error [8] DefineEventEnrollment_Error, + fileRename [9] IMPLICIT FileRename_Error +-- XXX this one is neither in this ASN nor in the IMPORTS +-- additionalService [10] AdditionalServiceError + } OPTIONAL + } + + +---------------------------------- REJECT -------------------------------- + +RejectPDU ::= SEQUENCE + { + originalInvokeID [0] IMPLICIT Unsigned32 OPTIONAL, + rejectReason CHOICE + { + confirmed_RequestPDU [1] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + unrecognized-modifier (2), + invalid-invokeID (3), + invalid-argument (4), + invalid-modifier (5), + max-serv-outstanding-exceeded (6), + max-recursion-exceeded (8), + value-out-of-range (9) + }, + + confirmed_ResponsePDU [2] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-result (3), + max-recursion-exceeded (5), + value-out-of-range (6) + }, + + confirmed_ErrorPDU [3] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-invokeID (2), + invalid-serviceError (3), + value-out-of-range (4) + } , + + unconfirmedPDU [4] IMPLICIT INTEGER + { + other (0), + unrecognized-service (1), + invalid-argument (2), + max-recursion-exceeded (3), + value-out-of-range (4) + }, + + pdu_Error [5] IMPLICIT INTEGER + { + unknown_PDU-type (0), + invalid_PDU (1), + illegal-acse-mapping (2) + }, + + cancel_RequestPDU [6] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1) + }, + + cancel_ResponsePDU [7] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1) + }, + + cancel_ErrorPDU [8] IMPLICIT INTEGER + { + other (0), + invalid-invokeID (1), + invalid-serviceError (2), + value-out-of-range (3) + }, + + conclude_RequestPDU [9] IMPLICIT INTEGER + { + other (0), + invalid-argument (1) + }, + + conclude_ResponsePDU [10] IMPLICIT INTEGER + { + other (0), + invalid-result (1) + }, + + conclude_ErrorPDU [11] IMPLICIT INTEGER + { + other (0), + invalid-serviceError (1), + value-out-of-range (2) + } + } + } + + +-- *************************************** VMD ******************************************** + + +Status_Request ::= BOOLEAN + +Status_Response ::= SEQUENCE { + vmdLogicalStatus [0] IMPLICIT INTEGER { + state-changes-allowed (0), + no-state-changes-allowed (1), + limited-services-allowed (2), + support-services-allowed (3) + }, + vmdPhysicalStatus [1] IMPLICIT INTEGER { + operational (0), + partially-operational (1), + inoperable (2), + needs-commissioning (3) + }, + localDetail [2] IMPLICIT BIT STRING(SIZE(0..128)) OPTIONAL + + } + +-- UNSOLICITEDSTATUS + +UnsolicitedStatus ::= Status_Response + +-- GETNAMELIST + +GetNameList_Request ::= SEQUENCE + { + extendedObjectClass [0] CHOICE + { + objectClass [0] IMPLICIT INTEGER + { + nammedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + }, + objectScope [1] CHOICE + { + vmdSpecific [0] IMPLICIT NULL, + domainSpecific [1] IMPLICIT Identifier, + aaSpecific [2] IMPLICIT NULL + }, + continueAfter [2] IMPLICIT Identifier OPTIONAL + } + +GetNameList_Response ::= SEQUENCE + { + listOfIdentifier [0] IMPLICIT SEQUENCE OF Identifier, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +---------------------------------- IDENTIFY -------------------------------- + +Identify_Request ::= NULL + +Identify_Response ::= SEQUENCE { + vendorName [0] IMPLICIT VisibleString, + modelName [1] IMPLICIT VisibleString, + revision [2] IMPLICIT VisibleString, + listOfAbstractSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL + } + +---------------------------------- RENAME -------------------------------- + +Rename_Request ::= SEQUENCE + { + extendedObjectClass [0] CHOICE { + objectClass [0] IMPLICIT INTEGER + { + namedVariable (0), + scatteredAccess (1), + namedVariableList (2), + namedType (3), + semaphore (4), + eventCondition (5), + eventAction (6), + eventEnrollment (7), + journal (8), + domain (9), + programInvocation (10), + operatorStation (11) + } + + }, + currentName [1] ObjectName, + newIdentifier [2] IMPLICIT Identifier + } + +Rename_Response ::= NULL + +---------------------------------- GET CAPABILITY LIST -------------------------------- + +GetCapabilityList_Request ::= SEQUENCE { + continueAfter VisibleString OPTIONAL + } + +GetCapabilityList_Response ::= SEQUENCE { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + + + + +-- ************************************* DOMAIN **************************************** + +InitiateDownloadSequence_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString, + sharable [2] IMPLICIT BOOLEAN + } + +InitiateDownloadSequence_Response ::= NULL + +-- DOWNLOAD SEGMENT + +DownloadSegment_Request ::= Identifier + +DownloadSegment_Response ::= SEQUENCE + { + loadData CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-- TERMINATE DOWNLOAD + +TerminateDownloadSequence_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + discard [1] IMPLICIT ServiceError OPTIONAL + } + +TerminateDownloadSequence_Response ::= NULL + +-- INITIATE UPLOAD + +InitiateUploadSequence_Request ::= Identifier -- Domain Name + +InitiateUploadSequence_Response ::= SEQUENCE + { + ulsmID [0] IMPLICIT Integer32, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString + } + +-- UPLOAD SEGMENT + +UploadSegment_Request ::= Integer32 -- ULSM Identifier + +UploadSegment_Response ::= SEQUENCE + { + loadData CHOICE { + non-coded [0] IMPLICIT OCTET STRING, + coded EXTERNAL + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-- TERMINATE UPLOAD + +TerminateUploadSequence_Request ::= Integer32 -- ULSM Identifer + +TerminateUploadSequence_Response ::= NULL + +-- REQUEST DOMAIN DOWNLOAD + +RequestDomainDownload_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName + } +RequestDomainDownload_Response ::= NULL + +-- REQUEST DOMAIN UPLOAD + +RequestDomainUpload_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + fileName [1] IMPLICIT FileName + } + +RequestDomainUpload_Response ::= NULL + +-- LOAD DOMAIN CONTENT + +LoadDomainContent_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + listOfCapabilities [1] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + sharable [2] IMPLICIT BOOLEAN, + fileName [4] IMPLICIT FileName, + thirdParty [5] IMPLICIT ApplicationReference OPTIONAL + } + +LoadDomainContent_Response ::= NULL + +-- STORE DOMAIN CONTENT + +StoreDomainContent_Request ::= SEQUENCE + { + domainName [0] IMPLICIT Identifier, + filenName [1] IMPLICIT FileName, + thirdParty [2] IMPLICIT ApplicationReference OPTIONAL + } + +StoreDomainContent_Response ::= NULL + +-- DELETE DOMAIN + +DeleteDomain_Request ::= Identifier -- Domain Name + +DeleteDomain_Response ::= NULL + +-- GET DOMAIN ATTRIBUTES + +GetDomainAttributes_Request ::= Identifier -- Domain Name + +GetDomainAttributes_Response ::= SEQUENCE + { + listOfCapabilities [0] IMPLICIT SEQUENCE OF VisibleString, + state [1] IMPLICIT DomainState, + mmsDeletable [2] IMPLICIT BOOLEAN, + sharable [3] IMPLICIT BOOLEAN, + listOfProgramInvocations [4] IMPLICIT SEQUENCE OF Identifier, -- PI Names + uploadInProgress [5] IMPLICIT Integer8 + } + + +DomainState ::= INTEGER + { + non-existent (0), + loading (1), + ready (2), + in-use (3), + complete (4), + incomplete (5), + d1 (7), + d2 (8), + d3 (9), + d4 (10), + d5 (11), + d6 (12), + d7 (13), + d8 (14), + d9 (15) + } + +-- ********************************* PROGRAM INVOCATION ********************************* + + +-- CREATE PROGRAM INVOCATION + +CreateProgramInvocation_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + listOfDomainName [1] IMPLICIT SEQUENCE OF Identifier, + reusable [2] IMPLICIT BOOLEAN DEFAULT TRUE, + monitorType [3] IMPLICIT BOOLEAN OPTIONAL + -- TRUE indicates PERMANENT monitoring + -- FALSE indicates CURRENT monitoring + } + +CreateProgramInvocation_Response ::= NULL + +-- DELETE PROGRAM INVOCATION + +DeleteProgramInvocation_Request ::= Identifier -- Program Invocation Name + +DeleteProgramInvocation_Response ::= NULL + +-- START + +Start_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + +Start_Response ::= NULL + +Start_Error ::= ProgramInvocationState + +-- STOP + +Stop_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Stop_Response ::= NULL + +Stop_Error ::= ProgramInvocationState + +-- RESUME + +Resume_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + +Resume_Response ::= NULL + +Resume_Error ::= ProgramInvocationState + +-- RESET + +Reset_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Reset_Response ::= NULL + +Reset_Error ::= ProgramInvocationState + +-- KILL + +Kill_Request ::= SEQUENCE + { + programInvocationName [0] IMPLICIT Identifier + } + +Kill_Response ::= NULL + +-- GET PI ATTRIBUTES + +GetProgramInvocationAttributes_Request ::= Identifier -- Program Invocation Name + +GetProgramInvocationAttributes_Response ::= SEQUENCE + { + state [0] IMPLICIT ProgramInvocationState, + listOfDomainNames [1] IMPLICIT SEQUENCE OF Identifier, + mmsDeletable [2] IMPLICIT BOOLEAN, + reusable [3] IMPLICIT BOOLEAN, + monitor [4] IMPLICIT BOOLEAN, + startArgument [5] IMPLICIT VisibleString, + executionArgument CHOICE { + simpleString [1] IMPLICIT VisibleString, + encodedString EXTERNAL + } OPTIONAL + } + + +ProgramInvocationState ::= INTEGER + { + non-existent (0), + unrunable (1), + idle (2), + running (3), + stopped (4), + starting (5), + stopping (6), + resuming (7), + resetting (8) + } + -- Companion Standard may add additional values + + +-- *********************************** VARIABLES **************************************** + + +TypeSpecification ::= CHOICE + { + typeName [0] ObjectName, + array [1] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + numberOfElements [1] IMPLICIT Unsigned32, + elementType [2] TypeSpecification + }, + structure [2] IMPLICIT SEQUENCE + { + packed [0] IMPLICIT BOOLEAN DEFAULT FALSE, + components [1] IMPLICIT SEQUENCE OF SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + componentType [1] TypeSpecification + } + }, + + -- Simple Type + boolean [3] IMPLICIT NULL, + bit-string [4] IMPLICIT Integer32, + integer [5] IMPLICIT Unsigned8, + unsigned [6] IMPLICIT Unsigned8, + octet-string [9] IMPLICIT Integer32, + visible-string [10] IMPLICIT Integer32, + generalized-time [11] IMPLICIT NULL, + binary-time [12] IMPLICIT BOOLEAN, + bcd [13] IMPLICIT Unsigned8, + objId [15] IMPLICIT NULL + } + +AlternateAccess ::= SEQUENCE OF CHOICE + { + unnamed AlternateAccessSelection, + named [5] IMPLICIT SEQUENCE + { + componentName [0] IMPLICIT Identifier, + accesst AlternateAccessSelection + } + } + +AlternateAccessSelection ::= CHOICE + { + selectAccess CHOICE + { + component [1] IMPLICIT Identifier, + index [2] IMPLICIT Unsigned32, + indexRange [3] IMPLICIT SEQUENCE + { + lowIndex [0] IMPLICIT Unsigned32, + numberOfElements [1] IMPLICIT Unsigned32 + }, + allElements [4] IMPLICIT NULL -- all array elements + } + } + + +-- READ + +Read_Request ::= SEQUENCE + { + specificationWithResult [0] IMPLICIT BOOLEAN DEFAULT FALSE, + variableAccessSpecification [1] VariableAccessSpecification + } + + +Read_Response ::= SEQUENCE + { + variableAccessSpecification [0] VariableAccessSpecification OPTIONAL, + listOfAccessResult [1] IMPLICIT SEQUENCE OF AccessResult + } + +-- WRITE + + + +Write_Request ::= SEQUENCE + { + variableAccessSpecification VariableAccessSpecification, + listOfData [0] IMPLICIT SEQUENCE OF Data + } + +Write_Response ::= SEQUENCE OF CHOICE + { + failure [0] IMPLICIT DataAccessError, + success [1] IMPLICIT NULL + } + +-- INFORMATION REPORT + +InformationReport ::= SEQUENCE + { + variableAccessSpecification VariableAccessSpecification, + listOfAccessResult [0] IMPLICIT SEQUENCE OF AccessResult + } + +-- GET VARIABLE ACCESS ATTRIBUTES + +GetVariableAccessAttributes_Request ::= CHOICE + { + name [0] ObjectName, + address [1] Address + } + + +GetVariableAccessAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + address [1] Address OPTIONAL, + typeSpecification [2] TypeSpecification + } +-- DEFINE NAMED VARIABLE + +DefineNamedVariable_Request ::= SEQUENCE + { + variableName [0] ObjectName, + address [1] Address, + typeSpecification [2] TypeSpecification OPTIONAL + } + +DefineNamedVariable_Response ::= NULL + +-- DEFINE SCATTERED ACCESS + +DefineScatteredAccess_Request ::= SEQUENCE + { + scatteredAccessName [0] ObjectName, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription + } + + +DefineScatteredAccess_Response ::= NULL + +-- GET SCATTERED ACCESS ATTRIBUTES + +GetScatteredAccessAttributes_Request ::= ObjectName -- ScatteredAccessName + + +GetScatteredAccessAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + scatteredAccessDescription [1] IMPLICIT ScatteredAccessDescription + } + +-- DELETE VARIABLE ACCESS + +DeleteVariableAccess_Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + +DeleteVariableAccess_Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + +DeleteVariableAccess_Error ::= Unsigned32 -- numberDeleted + +-- DEFINE NAMED VAR. LIST + +DefineNamedVariableList_Request ::= SEQUENCE + { + variableListName ObjectName, + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } + } + + +DefineNamedVariableList_Response ::= NULL + +-- GET NAMED VAR. LIST ATTRIBUTES + +GetNamedVariableListAttributes_Request ::= ObjectName -- VariableListName + + +GetNamedVariableListAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + listOfVariable [1] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + } + } + +-- DELETE NAMED VAR. LIST + +DeleteNamedVariableList_Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfVariableListName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + + +DeleteNamedVariableList_Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + + +DeleteNamedVariableList_Error ::= Unsigned32 -- number Deleted + +-- DEFINE NAMED TYPE + +DefineNamedType_Request ::= SEQUENCE + { + typeName ObjectName, + typeSpecification TypeSpecification + } + + +DefineNamedType_Response ::= NULL + + +-- GET NAMED TYPE ATTRIB. + +GetNamedTypeAttributes_Request ::= ObjectName -- TypeName + +GetNamedTypeAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + typeSpecification TypeSpecification + } + +-- DELETE NAMED TYPE + +DeleteNamedType_Request ::= SEQUENCE + { + scopeOfDelete [0] IMPLICIT INTEGER + { + specific (0), + aa-specific (1), + domain (2), + vmd (3) + } DEFAULT specific, + listOfTypeName [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + domainName [2] IMPLICIT Identifier OPTIONAL + } + +DeleteNamedType_Response ::= SEQUENCE + { + numberMatched [0] IMPLICIT Unsigned32, + numberDeleted [1] IMPLICIT Unsigned32 + } + +DeleteNamedType_Error ::= Unsigned32 -- number Deleted + +-- SUPPORT DEFINITIONS + +AccessResult ::= CHOICE + { + failure [0] IMPLICIT DataAccessError, + success Data + } + + +DataAccessError ::= INTEGER + { + object-invalidated (0), + hardware-fault (1), + temporarily-unavailable (2), + object-access-denied (3), + object-undefined (4), + invalid-address (5), + type-unsupported (6), + type-inconsistent (7), + object-attribute-inconsistent (8), + object-access-unsupported (9), + object-non-existent (10) + } + + + +Data ::= CHOICE + { + -- context tag 0 is reserved for AccessResult + array [1] IMPLICIT SEQUENCE OF Data, + structure [2] IMPLICIT SEQUENCE OF Data, + boolean [3] IMPLICIT BOOLEAN, + bit-string [4] IMPLICIT BIT STRING, + integer [5] IMPLICIT INTEGER, + unsigned [6] IMPLICIT INTEGER, + floating-point [7] IMPLICIT FloatingPoint, +-- XXX asn2wrs and packet-ber can not handle REAL yet +-- real [8] IMPLICIT REAL, + octet-string [9] IMPLICIT OCTET STRING, + visible-string [10] IMPLICIT VisibleString, + binary-time [12] IMPLICIT TimeOfDay, + bcd [13] IMPLICIT INTEGER, + booleanArray [14] IMPLICIT BIT STRING + } + +FloatingPoint ::= OCTET STRING + + +VariableAccessSpecification ::= CHOICE + { + listOfVariable [0] IMPLICIT SEQUENCE OF SEQUENCE + { + variableSpecification VariableSpecification, + alternateAccess [5] IMPLICIT AlternateAccess OPTIONAL + }, + variableListName [1] ObjectName + } + + +ScatteredAccessDescription ::= SEQUENCE OF SEQUENCE + { + componentName [0] IMPLICIT Identifier OPTIONAL, + variableSpecification [1] VariableSpecification, + alternateAccess [2] IMPLICIT AlternateAccess OPTIONAL + } + + +VariableSpecification ::= CHOICE + { + name [0] ObjectName, + address [1] Address, + variableDescription [2] IMPLICIT SEQUENCE + { + address Address, + typeSpecification TypeSpecification + }, + scatteredAccessDescription [3] IMPLICIT ScatteredAccessDescription, + invalidated [4] IMPLICIT NULL + } + +Address ::= CHOICE + { + numericAddress [0] IMPLICIT Unsigned32, + symbolicAddress [1] IMPLICIT VisibleString, + unconstrainedAddress [2] IMPLICIT OCTET STRING + } + + +-- ********************************* SEMAPHORES ***************************************** + +TakeControl_Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE, + applicationToPreempt [7] IMPLICIT ApplicationReference OPTIONAL + } + +TakeControl_Response ::= CHOICE + { + noResult [0] IMPLICIT NULL, + namedToken [1] IMPLICIT Identifier + } + +-- RELINQUISH CONTROL + +RelinquishControl_Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL + } + +RelinquishControl_Response ::= NULL + +-- DEFINE SEMAPHORE + +DefineSemaphore_Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + numbersOfTokens [1] IMPLICIT Unsigned16 + } + +DefineSemaphore_Response ::= NULL + +-- DELETE SEMAPHORE + +DeleteSemaphore_Request ::= ObjectName -- Semaphore Name + +DeleteSemaphore_Response ::= NULL + +-- REPORT SEMAPHORE STATUS + +ReportSemaphoreStatus_Request ::= ObjectName -- SemaphoreName + +ReportSemaphoreStatus_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN, + class [1] IMPLICIT INTEGER + { + token (0), + pool (1) + }, + numberOfTokens [2] IMPLICIT Unsigned16, + numberOfOwnedTokens [3] IMPLICIT Unsigned16, + numberOfHungTokens [4] IMPLICIT Unsigned16 + } + +-- REPORT POOL SEMAPHORE STATUS + +ReportPoolSemaphoreStatus_Request ::= SEQUENCE + { + semaphoreName [0] ObjectName, + nameToStartAfter [1] IMPLICIT Identifier OPTIONAL + } + +ReportPoolSemaphoreStatus_Response ::= SEQUENCE + { + listOfNamedTokens [0] IMPLICIT SEQUENCE OF CHOICE + { + freeNamedToken [0] IMPLICIT Identifier, + ownedNamedToken [1] IMPLICIT Identifier, + hungNamedToken [2] IMPLICIT Identifier + }, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +-- REPORT SEMAPHORE ENTRY STATUS + +ReportSemaphoreEntryStatus_Request ::=SEQUENCE + { + semaphoreName [0] ObjectName, + state [1] IMPLICIT INTEGER + { + queued (0), + owner (1), + hung (2) + } , + entryIdToStartAfter [2] IMPLICIT OCTET STRING OPTIONAL + } + +ReportSemaphoreEntryStatus_Response ::= SEQUENCE + { + listOfSemaphoreEntry [0] IMPLICIT SEQUENCE OF SemaphoreEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +AttachToSemaphore ::= SEQUENCE + { + semaphoreName [0] ObjectName, + namedToken [1] IMPLICIT Identifier OPTIONAL, + priority [2] IMPLICIT Priority DEFAULT 64, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL, + controlTimeOut [4] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [5] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [6] IMPLICIT BOOLEAN DEFAULT TRUE + } + + +SemaphoreEntry ::= SEQUENCE + { + entryId [0] IMPLICIT OCTET STRING, + entryClass [1] IMPLICIT INTEGER + { + simple (0), + modifier (1) + }, + applicationReference [2] ApplicationReference, + namedToken [3] IMPLICIT Identifier OPTIONAL, + priority [4] IMPLICIT Priority DEFAULT 64, + remainingTimeOut [5] IMPLICIT Unsigned32 OPTIONAL, + abortOnTimeOut [6] IMPLICIT BOOLEAN OPTIONAL, + relinquishIfConnectionLost [7] IMPLICIT BOOLEAN DEFAULT TRUE + } + +--******************************** OPERATOR COMMUNICATION ***************************** + + +-- INPUT + +Input_Request ::= SEQUENCE + { + operatorStationName [0] IMPLICIT Identifier, + echo [1] IMPLICIT BOOLEAN DEFAULT TRUE, + listOfPromptData [2] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + inputTimeOut [3] IMPLICIT Unsigned32 OPTIONAL + } + + +Input_Response ::= VisibleString -- Input String + +-- OUTPUT + +Output_Request ::= SEQUENCE + { + operatorStationName [0] IMPLICIT Identifier, + listOfOutputData [1] IMPLICIT SEQUENCE OF VisibleString + } + + +Output_Response ::= NULL + + +-- ************************************ EVENTS ********************************************* + +DefineEventCondition_Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + class [1] IMPLICIT EC-Class, + prio-rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN OPTIONAL, + monitoredVariable [6] VariableSpecification OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL + } + +DefineEventCondition_Response ::= NULL + + +DeleteEventCondition_Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [2] IMPLICIT Identifier, + vmd [3] IMPLICIT NULL + } + +DeleteEventCondition_Response ::= Unsigned32 -- Candidates Not Deleted + + +GetEventConditionAttributes_Request ::= ObjectName -- Event Condition Name + +GetEventConditionAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + class [1] IMPLICIT EC-Class, + prio-rity [2] IMPLICIT Priority DEFAULT 64, + severity [3] IMPLICIT Unsigned8 DEFAULT 64, + alarmSummaryReports [4] IMPLICIT BOOLEAN DEFAULT FALSE, + monitoredVariable [6] CHOICE + { + variableReference [0] VariableSpecification, + undefined [1] IMPLICIT NULL + } OPTIONAL, + evaluationInterval [7] IMPLICIT Unsigned32 OPTIONAL + } + + +ReportEventConditionStatus_Request ::= ObjectName -- EventConditionName + +ReportEventConditionStatus_Response ::= SEQUENCE + { + currentState [0] IMPLICIT EC-State, + numberOfEventEnrollments [1] IMPLICIT Unsigned32, + enabled [2] IMPLICIT BOOLEAN OPTIONAL, + timeOfLastTransitionToActive [3] EventTime OPTIONAL, + timeOfLastTransitionToIdle [4] EventTime OPTIONAL + } + + +AlterEventConditionMonitoring_Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + enabled [1] IMPLICIT BOOLEAN OPTIONAL, + priority [2] IMPLICIT Priority OPTIONAL, + alarmSummaryReports [3] IMPLICIT BOOLEAN OPTIONAL, + evaluationInterval [4] IMPLICIT Unsigned32 OPTIONAL + } + +AlterEventConditionMonitoring_Response ::= NULL + + +TriggerEvent_Request ::= SEQUENCE + { + eventConditionName [0] ObjectName, + priority [1] IMPLICIT Priority OPTIONAL + } + +TriggerEvent_Response ::= NULL + + +DefineEventAction_Request ::= SEQUENCE + { + eventActionName [0] ObjectName, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier OPTIONAL +-- XXX this one is neither in this ASN nor in the IMPORTS +-- confirmed-Service_Request [2] DefineEventAction-ConfirmedServiceRequest + + } + + +DefineEventAction_Response ::= NULL + +DeleteEventAction_Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + aa-specific [1] IMPLICIT NULL, + domain [3] IMPLICIT Identifier, + vmd [4] IMPLICIT NULL + } + +DeleteEventAction_Response ::= Unsigned32 -- candidates not deleted + +GetEventActionAttributes_Request ::= ObjectName -- Event Action Name + + +GetEventActionAttributes_Response ::= SEQUENCE + { + mmsDeletable [0] IMPLICIT BOOLEAN DEFAULT FALSE, + listOfModifier [1] IMPLICIT SEQUENCE OF Modifier +-- XXX this one is neither in this ASN nor in the IMPORTS +-- confirmed-Service_Request [2] DefineEventAction-ConfirmedServiceRequest + } + +ReportEventActionStatus_Request ::= ObjectName -- EventActionName + +ReportEventActionStatus_Response ::= Unsigned32 -- Number of Event Enrollments + + +DefineEventEnrollment_Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + eventConditionTransition [2] IMPLICIT Transitions, + alarmAcknowledgementRule [3] IMPLICIT AlarmAckRule, + eventActionName [4] ObjectName OPTIONAL, + clientApplication [5] ApplicationReference OPTIONAL + } + +DefineEventEnrollment_Response ::= NULL + +DefineEventEnrollment_Error ::= ObjectName + + +DeleteEventEnrollment_Request ::= CHOICE + { + specific [0] IMPLICIT SEQUENCE OF ObjectName, + ec [1] ObjectName, + ea [2] ObjectName + } + +DeleteEventEnrollment_Response ::= Unsigned32 -- candidates not deleted + + +GetEventEnrollmentAttributes_Request ::= SEQUENCE + { + scopeOfRequest [0] IMPLICIT INTEGER + { + specific (0), + client (1), + ec (2), + ea (3) + } DEFAULT client, + eventEnrollmentNames [1] IMPLICIT SEQUENCE OF ObjectName OPTIONAL, + clientApplication [2] ApplicationReference OPTIONAL, + eventConditionName [3] ObjectName OPTIONAL, + eventActionName [4] ObjectName OPTIONAL, + continueAfter [5] ObjectName OPTIONAL + } + + +EventEnrollment ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE + { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + eventActionName [2] CHOICE + { + eventAction [0] ObjectName, + undefined [1] IMPLICIT NULL + } OPTIONAL, + clientApplication [3] ApplicationReference OPTIONAL, + mmsDeletable [4] IMPLICIT BOOLEAN DEFAULT FALSE, + enrollmentClass [5] IMPLICIT EE-Class, + duration [6] IMPLICIT EE-Duration DEFAULT current, + invokeID [7] IMPLICIT Unsigned32, + remainingAcceptableDelay [8] IMPLICIT Unsigned32 OPTIONAL + } + + +GetEventEnrollmentAttributes_Response ::= SEQUENCE + { + listOfEventEnrollment [0] IMPLICIT SEQUENCE OF EventEnrollment, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +ReportEventEnrollmentStatus_Request ::= ObjectName -- Event Enrollment Name + +ReportEventEnrollmentStatus_Response ::= SEQUENCE + { + eventConditionTransitions [0] IMPLICIT Transitions, + notificationLost [1] IMPLICIT BOOLEAN DEFAULT FALSE, + duration [2] IMPLICIT EE-Duration, + alarmAcknowledgmentRule [3] IMPLICIT AlarmAckRule OPTIONAL, + currentState [4] IMPLICIT EE-State + } + +AlterEventEnrollment_Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionTransitions [1] IMPLICIT Transitions OPTIONAL, + alarmAcknowledgmentRule [2] IMPLICIT AlarmAckRule OPTIONAL + } + +AlterEventEnrollment_Response ::= SEQUENCE + { + currentState [0] CHOICE + { + state [0] IMPLICIT EE-State, + undefined [1] IMPLICIT NULL + }, + transitionTime [1] EventTime + } + + +AcknowledgeEventNotification_Request ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + acknowledgedState [2] IMPLICIT EC-State, + timeOfAcknowledgedTransition [3] EventTime + } + +AcknowledgeEventNotification_Response ::= NULL + + +GetAlarmSummary_Request ::= SEQUENCE + { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER + { + not-acked (0), + acked (1), + all (2) + } DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE + { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } OPTIONAL, + continueAfter [5] ObjectName OPTIONAL + } + +GetAlarmSummary_Response ::= SEQUENCE + { + listOfAlarmSummary [0] IMPLICIT SEQUENCE OF AlarmSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +AlarmSummary ::= SEQUENCE + { + eventConditionName [0] ObjectName, + severity [1] IMPLICIT Unsigned8, + currentState [2] IMPLICIT EC-State, + unacknowledgedState [3] IMPLICIT INTEGER + { + none (0), + active (1), + idle (2), + both (3) + }, + timeOfLastTransitionToActive [5] EventTime OPTIONAL, + timeOfLastTransitionToIdle [6] EventTime OPTIONAL + } + + +GetAlarmEnrollmentSummary_Request ::= SEQUENCE + { + enrollmentsOnly [0] IMPLICIT BOOLEAN DEFAULT TRUE, + activeAlarmsOnly [1] IMPLICIT BOOLEAN DEFAULT TRUE, + acknowledgmentFilter [2] IMPLICIT INTEGER + { + not-acked (0), + acked (1), + all (2) + } DEFAULT not-acked, + severityFilter [3] IMPLICIT SEQUENCE + { + mostSevere [0] IMPLICIT Unsigned8, + leastSevere [1] IMPLICIT Unsigned8 + } OPTIONAL, + continueAfter [5] ObjectName OPTIONAL + } + +GetAlarmEnrollmentSummary_Response ::= SEQUENCE + { + listOfAlarmEnrollmentSummary [0] IMPLICIT SEQUENCE OF AlarmEnrollmentSummary, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +AlarmEnrollmentSummary ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + clientApplication [2] ApplicationReference OPTIONAL, + severity [3] IMPLICIT Unsigned8, + currentState [4] IMPLICIT EC-State, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + enrollementState [8] IMPLICIT EE-State OPTIONAL, + timeOfLastTransitionToActive [9] EventTime OPTIONAL, + timeActiveAcknowledged [10] EventTime OPTIONAL, + timeOfLastTransitionToIdle [11] EventTime OPTIONAL, + timeIdleAcknowledged [12] EventTime OPTIONAL + } + + +EventNotification ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] CHOICE + { + eventCondition [0] ObjectName, + undefined [1] IMPLICIT NULL + }, + severity [2] IMPLICIT Unsigned8, + currentState [3] IMPLICIT EC-State OPTIONAL, + transitionTime [4] EventTime, + notificationLost [6] IMPLICIT BOOLEAN DEFAULT FALSE, + alarmAcknowledgmentRule [7] IMPLICIT AlarmAckRule OPTIONAL, + actionResult [8] IMPLICIT SEQUENCE + { + eventActioName ObjectName, + eventActionResult CHOICE + { + success [0] ConfirmedServiceResponse, + failure [1] IMPLICIT ServiceError + } + } OPTIONAL + } + + +AttachToEventCondition ::= SEQUENCE + { + eventEnrollmentName [0] ObjectName, + eventConditionName [1] ObjectName, + causingTransitions [2] IMPLICIT Transitions, + acceptableDelay [3] IMPLICIT Unsigned32 OPTIONAL + } + + +EventTime ::= CHOICE + { + timeOfDayT [0] IMPLICIT TimeOfDay, + timeSequenceIdentifier [1] IMPLICIT Unsigned32 + } + + +EC-Class ::= INTEGER + { + network-triggered (0), + monitored (1) + } + +EC-State ::= INTEGER + { + disabled (0), + idle (1), + active (2) + } + +EE-State ::= INTEGER + { + disabled (0), + idle (1), + active (2), + activeNoAckA (3), + idleNoAckI (4), + idleNoAckA (5), + idleAcked (6), + activeAcked (7) + } + +Transitions ::= BIT STRING + { + idle-to-disabled (0), + active-to-disabled (1), + disabled-to-idle (2), + active-to-idle (3), + disabled-to-active (4), + idle-to-active (5), + any-to-deleted (6) + } + +AlarmAckRule ::= INTEGER + { + none (0), + simple (1), + ack-active (2), + ack-all (3) + } + +EE-Class ::= INTEGER + { + modifier (0), + notification (1) + } + +EE-Duration ::= INTEGER + { + current (0), + permanent (1) + } + + +-- ********************************** JOURNAL ******************************************* + + +-- READ JOURNAL + +ReadJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName, + rangeStartSpecification [1] CHOICE + { + startingTime [0] IMPLICIT TimeOfDay, + startingEntry [1] IMPLICIT OCTET STRING + } OPTIONAL, + rangeStopSpecification [2] CHOICE + { + endingTime [0] IMPLICIT TimeOfDay, + numberOfEntries [1] IMPLICIT Integer32 + } OPTIONAL, + listOfVariables [4] IMPLICIT SEQUENCE OF VisibleString OPTIONAL, + entryToStartAfter [5] IMPLICIT SEQUENCE + { + timeSpecification [0] IMPLICIT TimeOfDay, + entrySpecification [1] IMPLICIT OCTET STRING + } + } + +ReadJournal_Response ::= SEQUENCE + { + listOfJournalEntry [0] IMPLICIT SEQUENCE OF JournalEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + + +JournalEntry ::= SEQUENCE + { + entryIdentifier [0] IMPLICIT OCTET STRING, + originatingApplication [1] ApplicationReference, + entryContent [2] IMPLICIT EntryContent + } + +-- WRITE JOURNAL + +WriteJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName, + listOfJournalEntry [1] IMPLICIT SEQUENCE OF EntryContent + } + +WriteJournal_Response ::= NULL + +-- INITIALIZE JOURNAL + +InitializeJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName, + limitSpecification [1] IMPLICIT SEQUENCE + { + limitingTime [0] IMPLICIT TimeOfDay, + limitingEntry [1] IMPLICIT OCTET STRING OPTIONAL + } OPTIONAL + } + +InitializeJournal_Response ::= Unsigned32 -- entries deleted + +-- REPORT JOURNAL STATUS + +ReportJournalStatus_Request ::= ObjectName -- Journal Name + +ReportJournalStatus_Response ::= SEQUENCE + { + currentEntries [0] IMPLICIT Unsigned32, + mmsDeletable [1] IMPLICIT BOOLEAN + } + +-- CREATE JOURNAL + +CreateJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName + } + +CreateJournal_Response ::= NULL + +-- DELETE JOURNAL + +DeleteJournal_Request ::= SEQUENCE + { + journalName [0] ObjectName + } + +DeleteJournal_Response ::= NULL + + +-- SUPPORTING PRODUCTIONS + +EntryContent ::= SEQUENCE + { + occurenceTime [0] IMPLICIT TimeOfDay, + additionalDetail [1] JOU-Additional-Detail OPTIONAL, + -- additionalDetail shall be omitted + -- from abstract syntax defined in this standard + entryForm CHOICE + { + data [2] IMPLICIT SEQUENCE + { + event [0] IMPLICIT SEQUENCE + { + eventConditionName [0] ObjectName, + currentState [1] IMPLICIT EC-State + } OPTIONAL, + listOfVariables [1] IMPLICIT SEQUENCE OF SEQUENCE + { + variableTag [0] IMPLICIT VisibleString, + valueSpecification [1] Data + } OPTIONAL + }, + annotation [3] IMPLICIT VisibleString + } + } + + +JOU-Additional-Detail ::= NULL -- Defined by Companion Standard + + + +-- **************************************** FILES ********************************************* + +ObtainFile_Request ::= SEQUENCE { + sourceFileServer [0] IMPLICIT ApplicationReference OPTIONAL, + sourceFile [1] IMPLICIT FileName, + destinationFile [2] IMPLICIT FileName + } + +ObtainFile_Response ::= NULL + +ObtainFile_Error ::= INTEGER { + source-file (0), + destination-file (1) + } + + +FileOpen_Request ::= SEQUENCE { + fileName [0] IMPLICIT FileName, + initialPosition [1] IMPLICIT Unsigned32 + } + +FileOpen_Response ::= SEQUENCE { + frsmID [0] IMPLICIT Integer32, + fileAttributes [1] IMPLICIT FileAttributes + } + +FileRead_Request ::= Integer32 + +FileRead_Response ::= SEQUENCE { + fileData [0] IMPLICIT OCTET STRING, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +FileClose_Request ::= Integer32 + +FileClose_Response ::= NULL + + +FileRename_Request ::= SEQUENCE { + currentFileName [0] IMPLICIT FileName, + newFileName [1] IMPLICIT FileName + } + +FileRename_Response ::= NULL + +FileRename_Error ::= INTEGER { + source-file (0), + destination-file (1) + } + +FileDelete_Request ::= FileName + +FileDelete_Response ::= NULL + + +FileDirectory_Request ::= SEQUENCE { + fileSpecification [0] IMPLICIT FileName OPTIONAL, + continueAfter [1] IMPLICIT FileName OPTIONAL + } + +FileDirectory_Response ::= SEQUENCE { + listOfDirectoryEntry [0] SEQUENCE OF DirectoryEntry, + moreFollows [1] IMPLICIT BOOLEAN DEFAULT FALSE + } + +DirectoryEntry ::= SEQUENCE { + filename [0] IMPLICIT FileName, + fileAttributes [1] IMPLICIT FileAttributes + } + + +FileAttributes ::= SEQUENCE { + sizeOfFile [0] IMPLICIT Unsigned32, + lastModified [1] IMPLICIT GeneralizedTime OPTIONAL + } + + + +END + diff --git a/src/build.gradle b/src/build.gradle new file mode 100644 index 0000000..8465357 --- /dev/null +++ b/src/build.gradle @@ -0,0 +1,297 @@ +buildscript { + repositories { + maven { + url "https://plugins.gradle.org/m2/" + } + } + dependencies { + classpath "net.saliman:gradle-cobertura-plugin:2.2.8" + classpath group: "org.asciidoctor", name: "asciidoctorj-pdf", version: "1.5.0-alpha.11" + classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:3.0.0" + } +} + +plugins { + id "org.sonarqube" version "1.0" + id "org.asciidoctor.convert" version "1.5.3" +} + +apply plugin: "org.asciidoctor.convert" +apply from: "configuration.gradle" + +asciidoctor { + backends = ["pdf", "html5"] + attributes "stylesheet": "openmuc-asciidoc.css", + "toc2": "left", + "sampleSrc": file("src/sample/java"), + "source-highlighter" : "coderay", + "pdf-stylesdir": "./", + "pdf-style": "pdf" + + resources { + from("$sourceDir") { + include "images/**" + } + } +} + +configure(allprojects) { + version = cfgVersion +} + +configure(javaProjects) { + + apply plugin: "java" + apply plugin: "eclipse" + apply plugin: "osgi" + apply plugin: "maven" + apply plugin: "signing" + apply plugin: "net.saliman.cobertura" + apply plugin: "biz.aQute.bnd.builder" + + uploadArchives.enabled = false + + group = cfgGroup + + if (!project.properties.containsKey("cfgJavaVersion")) { + project.ext { + cfgJavaVersion = "1.7" + } + } + + sourceCompatibility = cfgJavaVersion + targetCompatibility = cfgJavaVersion + + repositories { + mavenCentral() + mavenLocal() + } + + sourceSets { + sample + itest { + compileClasspath += sourceSets.main.runtimeClasspath + } + } + + dependencies { + testCompile group: "junit", name: "junit", version: "4.12" + itestCompile group: "junit", name: "junit", version: "4.12" + } + + jar { + manifest { + version = project.version.replace("-","."); + } + } + + cobertura { + + dependencies { + testCompile "org.slf4j:slf4j-simple:1.6.1" + } + coverageFormats = ["html", "xml"] + coverageIgnoreTrivial = true + coverageIgnores = ["org.slf4j.Logger.*"] + coverageReportDir = new File("$buildDir/reports/cobertura") + coverageTestTasks { + project.tasks.withType(Test).matching {it.name == "test"} + } + + } + + sonarqube { + properties { + property "sonar.exclusions", "src/main/java-gen/**/*,**/app/**/*" + property "sonar.java.coveragePlugin", "cobertura" + property "sonar.cobertura.reportPath", "build/reports/cobertura/coverage.xml" + } + } + + task jarAll(type: Copy) { + dependsOn(configurations.default.getAllArtifacts().getBuildDependencies()) + + //only the jar file created: + from configurations.default.getAllArtifacts().getFiles() + + if (cfgCopyDependencies) { + if (cfgCopyToRoot) { + into rootDir.getPath() + "/build/libs-all" + } + else { + into "build/libs-all" + } + //includes all the dependencies: + from configurations.default + } + else { + if (cfgCopyToRoot) { + into rootDir.getPath() + "/build/libs-all" + } + else { + into "build/libs-all" + } + } + } + + build.dependsOn {asciidoctor} + build.dependsOn {jarAll} + + eclipse.pathVariables([GRADLE_USER_HOME:file(gradle.gradleUserHomeDir)]) + tasks.eclipse.dependsOn(cleanEclipse) + + + task sourcesJar(type: Jar, dependsOn: classes) { + classifier = "sources" + from sourceSets.main.allSource + } + + task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = "javadoc" + from javadoc.destinationDir + } + + artifacts { + archives sourcesJar + archives javadocJar + } + + javadoc { + exclude "**/internal/**" + exclude "**/java-gen/**" + exclude "**/app/**" + } + +} + + +configure(repositoryProjects) { + + uploadArchives.enabled = true + + if (cfgSignPom) { + signing { + if ( project.hasProperty("signing.keyId") ) { + sign configurations.archives + } + } + } + + uploadArchives { + repositories { + mavenDeployer { + + if (cfgSignPom) { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + } + + repository(url: cfgRepository) { + authentication(userName: cfgRepositoryUser, password: cfgRepositoryPass) + if (cfgRepository != null && System.getProperty("https.proxyHost") != null && ((System.getProperty("https.nonProxyHosts") == null) || !cfgRepository.contains(System.getProperty("https.nonProxyHosts")))) { + proxy(host: System.getProperty("https.proxyHost"), port: Integer.parseInt(System.getProperty("https.proxyPort")), type: "https") + } + } + snapshotRepository(url: cfgSnapshotRepository) { + authentication(userName: cfgRepositoryUser, password: cfgRepositoryPass) + if (cfgSnapshotRepository != null && System.getProperty("https.proxyHost") != null && ((System.getProperty("https.nonProxyHosts") == null) || !cfgSnapshotRepository.contains(System.getProperty("https.nonProxyHosts")))) { + proxy(host: System.getProperty("https.proxyHost"), port: Integer.parseInt(System.getProperty("https.proxyPort")), type: "https") + } + } + + pom.project { + + //additional pom information can be found in subproject build.gradle files + + packaging "jar" + url "http://www.openmuc.org/" + + scm { + url "none" + connection "none" + } + + developers { + developer { + id "openmuc" + name "OpenMUC Team" + } + } + } + } + } + } +} + +task javadocAll(type: Javadoc) { + + source docProjects.collect { + project -> project.sourceSets.main.allJava + } + + exclude "**/internal/**" + exclude "**/java-gen/**" + exclude "**/app/**" + + destinationDir = new File(buildDir, "docs/javadoc-all") + + classpath = files(distributionProjects.collect { project -> + project.sourceSets.main.compileClasspath }) + + classpath += files(distributionProjects.collect { project -> + project.sourceSets.main.output }) +} + + +task writeSettings { + doLast { + Writer out = new OutputStreamWriter(new FileOutputStream("build/settings.gradle")); + out.write("include "); + boolean first = true; + for (Project myproject: distributionProjects) { + if (!myproject.getProjectDir().equals(getProjectDir())) { + if (first == true) { + first = false; + } + else { + out.write ", "; + } + out.write '"' + myproject.name + '"' + } + } + out .write "\n\n"; + + for (Project myproject: distributionProjects) { + if (!myproject.getProjectDir().equals(getProjectDir())) { + println myproject.name + out.write 'project(":' + myproject.name + '").projectDir = file("' + myproject.getProjectDir().toString().substring((int)(getProjectDir().toString().size() + 1)) + '")\n'; + } + } + + out.close(); + } +} + +task buildDistProjects { + dependsOn(distributionProjects.build) +} + +tasks.withType(Tar) { + + dependsOn(writeSettings) + dependsOn(distributionProjects.build) + dependsOn(javadocAll) + dependsOn(asciidoctor) + + compression = Compression.GZIP + + destinationDir = file("build/distributions/") +} + +task (tar, type: Tar) { + archiveName = project.name + "-" + project.version + ".tgz" +} + +task (tarFull, type: Tar) { + dependsOn(tar) + archiveName = project.name + "-" + project.version + "_full.tgz" +} diff --git a/src/configuration.gradle b/src/configuration.gradle new file mode 100644 index 0000000..fc7477e --- /dev/null +++ b/src/configuration.gradle @@ -0,0 +1,125 @@ + +project.ext { + + cfgVersion = "1.4.1-SNAPSHOT" + + cfgGroup = "org.openmuc" + + cfgCopyDependencies = true + + cfgCopyToRoot = false + + cfgSignPom = true + + cfgRepository = project.properties.sonatypeRepository + + cfgSnapshotRepository = project.properties.sonatypeSnapshotRepository + + cfgRepositoryUser = project.properties.sonatypeUser + + cfgRepositoryPass = project.properties.sonatypePass + + javaProjects = allprojects + + distributionProjects = javaProjects + + docProjects = javaProjects + + repositoryProjects = javaProjects +} + +tasks.withType(Tar) { + + into(project.name) { + from("./") { + include "build.gradle" + include "configuration.gradle" + include "license/**" + include "doc/CHANGELOG.txt" + include "run-scripts/**" + include "gradle/wrapper/**" + include "gradlew" + include "gradlew.bat" + include "build/libs-all/**" + include "src/**" + + include "asn1/**" + } + + if (name.equals("tar") ){ + exclude "**/dependencies/**/src" + } + + } + + into(project.name + "/doc/user-guide/") { + from("./build/asciidoc/html5/") { + include "**" + } + from("./build/asciidoc/pdf/") { + include "*.pdf" + } + } + + into(project.name + "/doc/") { + from("./build/docs/") { + include "javadoc/**" + } + } + +} + + + +//------------------project specific configurations-------------------- + +apply plugin: "java" +apply plugin: "eclipse" +apply plugin: "osgi" +apply plugin: "maven" +apply plugin: "signing" + +def projectName = 'OpenIEC61850' + +dependencies { + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' + compile group: 'org.openmuc', name: 'jasn1', version: '1.8.0' + compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' + compile group: 'com.toedter', name: 'jcalendar', version: '1.4' +} + +jar { + manifest { + name = projectName + instruction 'Export-Package', '!*.internal.*,*' + instruction 'Import-Package', 'org.openmuc.jasn1.*,javax.net,*;resolution:=optional' + } +} + +sourceSets { + main { + java.srcDirs = ['src/main/java', 'src/main/java-gen'] + } +} + +uploadArchives { + repositories { + mavenDeployer { + pom.project { + name projectName + packaging 'jar' + description 'OpenIEC61850 is a library implementing the IEC 61850 MMS communication standard (client and server).' + url 'http://www.openmuc.org/' + + licenses { + license { + name 'Apache License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0' + distribution 'repo' + } + } + + } + } + } +} diff --git a/src/doc/CHANGELOG.txt b/src/doc/CHANGELOG.txt new file mode 100644 index 0000000..4f3a7ba --- /dev/null +++ b/src/doc/CHANGELOG.txt @@ -0,0 +1,242 @@ +v1.4.0 30-May-2017 +------------------ + +- extended toString() method of all model node classes to print its + complete submodel tree. + +- merged all projects openiec61850, jositransport, josistack, + openiec61850-clientgui, and openiec61850-sample into a single + project "openiec61850". + +- removed all slf4j logging for client part. Thus if library is only + used on client side slf4j is no longer needed. + +- replaced sample client and server by console applications + +- fixed setting functional constraint correctly for all BRCB + elements. Thanks to Stefan Goldmann. + +- fixed client side processing of reports when inclusion bit string is + not padded with zeros, thanks to Thomas Schönle from Bachmann + +- fixed ServerSAP.stop() to close timer threads correctly + +- made several imports in OSGi MANIFEST file optional because they are + not necessarily required + +- library now depends on jASN1 1.8.0 + + +v1.3.3 09-Mar-2017 +------------------ + +- fixes bug introduced in 1.3.2: report control block instance names + should start at 01 instead of 00 + +- library now depends on jASN1 1.7.1 + +v1.3.2 01-Mar-2017 +------------------ + +- fixes object reference of child attributes of array elements: old: + LD/LN.DO.Array(1)child, new LD/LN.DO.Array(1).child + +- fixes setting of RptEna DA in server to true when reports are enabled. + +- fixes reading report control blocks with "max" attribute greater 1 + from SCL file + +- added check whether received BitString has correct size before setting it + in model + +v1.3.1 24-Feb-2017 +------------------ + +- fixed TapCommand data attribute default value + +- types based on BdaBitString now check in setValue(byte[] value) + whether passed byte array has correct length + + +v1.3.0 17-Jan-2017 +------------------ + +- fixed bug that urcb reservation was not canceled after connection + was closed + +- fixed support for reserving buffered report control blocks on the + client side thanks to Bo Orsted Andresen + +- fixed support for receiving buffered and unbuffered reports when the + data set reference is not part of the report thanks to Bo Orsted + Andresen + +- fixed bug in parsing scl file, in some cases predefined values were + not set, thanks to Wu Yongming + +- added support for parsing ObjRef in SCL file + +- added support for multiple report control block instances by + specifying RptEnabled max attribute in SCL file + +v1.2.0 20-Mar-2016 +------------------ +- changed license from LGPL to Apache 2.0 +- added methods to ServerModel class to retrieve BRCBs on the client + side, thanks to Thomas Saabye from EURISCO +- added support for parsing "Val" elements inside "DA" elements of SCL + file +- several minor bug fixes + +v1.1.1 11-Dec-2014 +------------------ +- set default max TPDU size to 1024 +- fix: server stops sending reports when client closed association +- fix in sample model to enable general interrogation + +v1.1.0 17-Oct-2014 +------------------ +- fixed ServerSap.stop() +- added possibility change more settings in ClientSap +- setDataSetValues will now only call a single call back function of a + server application. The syntax of the call back function had to be + changed for that. +- fixed doclint errors and warnings. doclint is used by Java8 + +v1.0 31-Jul-2014 +---------------- +- added support for reporting on server side. +- minor bug fixes +- improvements to logging messages +- added maxtpdu size to all Transport Layer Connection Requests + (thanks to Michael Volz) +- client can now receive reports via callback method +- improved documentation +- fixed build file for newest gradle +- improved documentation + +v0.17.1 27-Jan-2014 +------------------- +- extracted jOSIStack lib from openiec61850 lib so it can be used + separately (e.g. for the TASE.2 protocol) +- fixed bugs in client Report functionality +- readded ClientReportingSample application +- fixed copying of arrays +- support for decoding authentication value, though the authentication + value is NOT being checked at the moment +- added full server side support for nonpersistent DataSets +- fixed bug in runSampleServer.bat script +- jars are now uploaded to the central maven repository + +v0.16.0 03-Sep-2013 +------------------- +- renamed many functions and classes +- added Client GUI project to easily browse the device model of an IEC + 61850 IED. +- openiec61850-client, -server, -common and jmms where combined into a + single openiec61850 library. The split was of no real use and caused + split package problems in OSGi environments. +- client ACSI functions now throw two types of exceptions: IOException + (fatal exception, client needs to reconnect to server) and + ServiceError for Errors that did not affect the active + assocition/connection. +- The way the server library works was completely changed: DataSources + no longer exist and there is no need for property files anymore. The + readValue() callback method in the DataSource is no longer needed + because GetDataValues requests are handled by the server library + without consulting the server application. Instead the server + application now has to fill the internal model of the server library + with up to date values. This change was necessary in order to be + able to efficiently implement reporting and controling services in + the future. +- Basic control services are now part of the library and no longer + have to be handled by the server application. +- Several bug fixes in the SCL-parser +- fix so that FunctionalConstraints such as GS that are not supported + by openIEC61850 yet do not cause a null pointer exception when they + are part of a DataSet + +v0.14.4 30-Oct-2012 +------------------- +- fixed another bug when decoding Float64 +- getDataDefinition of all kinds of DataObjects and DataAttributes now + possible +- modified toString() function of most DataAttributes to print more + valuable information + +v0.14.3 18-Sep-2012 +------------------- +- fixed decoding of Float32 and Float64 +- fixed getChildren(fc) Function in LogicalNode + +v0.14.2 23-Aug-2012 +------------------- +- major refactoring to make code more efficient and easier to + maintain. Many classes have been renamed and/or relocated. +- the ability to use different SCSM was completely removed because + only one mapping existed so far: the MMS mapping. No other Mapping + seems to have a chance against MMS simply because MMS is already in + use and works. +- note that the syntax of the properties file for the StandaloneServer + changed a little, see the sampeServer for details + +v0.12.0 31-Jul-2012 +------------------- +- changed from LGPLv3 to LGPLv2.1 +- replaced OCTET_STRING64, OCTET_STRING8 and so on with a general + OCTET_STRING class +- the same was done for UNICODE_STRING and VISIBLE_STRING +- client no longer hangs when receiving ApplError Reports + +v0.11.0 02-Jul-2012 +------------------- +- new jASN1 version that can decode empty Object Identifiers +- added mms authentication capability +- fixed multi thread issues in TSAPConnection of MMS mapping +- added FLOAT64 from IEC61400-2 +- added SampleReportClient to demonstrate how to use reporting with the client +- some improvements to client receiver thread +- some other small bug fixes + +v0.10.0 14-Mai-2012 +------------------- +- restructuring: code moved to src folder +- new jASN1 version which fixes bug in decoding empty bitstrings +- receving "Check" data does not cause errors anymore +- ASN.1 buffers are automatically resized in the client + +v0.9.9 29-Mar-2012 +------------------ +- added DataSet Services for client and server +- added getReport methods and processReport for the client -> they + will get a report from the queue and return a report object with the + updated data +- fixed getDataValues for array structures +- disabled sending SpecificationWithResult in read request because + some clients cannot cope with it +- fixed bug in RFC 1006 part +- added receiver thread in client so that reports can be received at any time +- added VisibleString65 to be compatible with some version1.0 servers +- avoid srcRef == 0 because some servers cannot cope with it + +v0.9.8 22-Feb-2012 +------------------ +- fixed path in runSampleServer.sh and runSampleClient.sh + +0.9.7 21-Feb-2012 +----------------- +- small bug fix in T-Sel encoding/decoding in TConnection.java - + thanks to Johannes Schmidt from University of Leipzig + +v0.9.6 20-Feb-2012 +------------------ +- when importing Eclipse projects: GRADLE_HOME was replaced by GRADLE_USER_HOME +- removed duplicate entries from tar distribution file +- Remote TSAPs can now be addressed using a T-Selector. The client can + set the T-Selector like this: + MmsScsmClientSAP clientSAP = new MmsScsmClientSAP(); + clientSAP.acseSAP.tSAP.tSelRemote = new byte[] { 0, 1 }; + +v0.9.5 06-Feb-2012 +------------------ +- first version diff --git a/src/docs/asciidoc/common-settings.txt b/src/docs/asciidoc/common-settings.txt new file mode 100644 index 0000000..5dabf65 --- /dev/null +++ b/src/docs/asciidoc/common-settings.txt @@ -0,0 +1,33 @@ +ifndef::imagesdir[:imagesdir: images] +ifdef::backend-pdf[] +Fraunhofer Institute for Solar Energy Systems ISE +openmuc.org +//:doctype: book +// Settings: +:compat-mode: +:experimental: +:icons: font +:listing-caption: Listing +:sectnums: +:toc: +:toclevels: 3 +:title-logo-image: image:banner.png[pdfwidth=90%,align=center] +:frame: none + +:width100: 750 +:width80: 600 +:width60: 450 +:width40: 300 +:width20: 150 + +endif::[] + +ifndef::backend-pdf[] + +:width100: "100%" +:width80: "80%" +:width60: "60%" +:width40: "40%" +:width20: "20%" + +endif::[] diff --git a/src/docs/asciidoc/images/banner.png b/src/docs/asciidoc/images/banner.png new file mode 100644 index 0000000000000000000000000000000000000000..0a89cb1eb53c02b719835b859c0cdaabc1adc777 GIT binary patch literal 75043 zcmZs@2RPOL`#-LFH{J=Aj1rp2PDWX$RFql7v5&H|_jWWS36+p}LXPZ}b&R8g>~S3X zn2CeqSjRXx{?FIZ=kxviuIqoUtIid#=e*bBe%$w~&-Xn*=PtXGCY2fQ$=X(Zj3=EbvVWS-E>XcC}=E`qrA1WdJ{@rdcHV* z;B)+q4s0m0Y%CR4OEvv+=gmL&gU;PNS=-vq-O6ySc6i_YXa9(=Y~F+IERbEutvhW= zH&i}tjyR=05cmh|`|roF<07x$DynL2&~6vk#G2oh-c4jAksMS$H2r>LWHe+RYO%cG zgT`_o2jlZ_3cQ}fDTC(jqiz2?br8Ewk|m~ly%mQ&#;=*EA7v{mNRfCDawpR|Gml4%!mlI|ZD?cH za_4&wzjkJi_DzoqONK66TG&l^Bz8gePcm;T(juvDnpN#R=XHMencLSBhePu5Du!PG8Cb+DD8RMFbI zOG{3)40yFXG_CQKxc|M@d)2}?HhzTM>A=mf44F$f_niPes;be{W;98a(A&G_e<3dM zeug$oC<3K{)*jX5i-PU6G-8)7=AVORqx|~c%^LPv#N}}gTs^6I7RG}{qopbTnqnl8 zI;Z3nQ1`0NKjl9eI{Id|tY#|t-Te%N#-*rfTxQSun;q*9nLS<~ntpcFETL!(>aGSDTgX(Wp$Ca21c?iHzccz+pQt`#2kiAfkqfVf;sQX-Ij=xHxcH4GnIMgf{S#t zD$UmAM<#4H47Q~fdl1Z8yT<>&yJi%yjti{8kSj;2?ZF9-HJRqqGd69*{)*U*H2%O( z826>_(q_r(Z_`;cT@TClEc5ouQB4=Yj`c6R_b=4n{d`?~lXrJpYqvHU+H--z|8w1E znBg+eO^cdfdX`#o9mZ$R@HlE^zytN-)%kSFMg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fu+vXWYnOXN7)vN0j@Aa59n0Ag&-$u39Ouq%OZu^UqtSejeJ8 z!xtkd7>F&!PijL(kU38pN6rfSp^SSc(94NP^*CUeg|%0Af+Hm zh>20b_NHJGFJ%@i50rF~k)2^M_^zRgE;^)cRa+tQO=v(!N1y}#?WC&xojx&5t)%e+ zu+cIBE1y2@_mi|C0pkLn4a8rp;DIi%O|)YAF}6lQR5rfrvFYbN*`0JmIL(1I8QLX6 zWM1EL%f6fxv%ysdQkHq?v4Rq4P>v3xjDl0 z4uaI|m{hQ1*{&CfKTM(vLhbs@=kRYo9a!|&1@`Mdc8S^R{i*C+%7t9Yo)ZxNF?8iL zude?#xw4>(>_WP=M8IiS|JNI9ug{zt16`3W;%A01a5n41{}BSwjsK6l89kItgjq_p z15<84(JluAQkF+JXZoVXmiSF%7ilNlt^u(j{jX)8fu3S4y~g%w4zl}v4yNG8t7g;w z+pj>nNt59w5j>BmMM6YfOI?HJ)+KNe-F>R!f`Vf#^xE~4|GnH_^dFUodj?RSH}UgX z+tNgG`-(*bkZn11fzh4EMCf5%OBpJlpy7}x6xNoh*#lv&l_dafHZ~czuItAJshqm z{81c#ts?3Dl=p5^nsBlI`!2c>-^QsDx7j5r0wm!%PCt*C)ZB4t(U=bzZ|}WvZC}ZQ+$wY z3maH#Zs ZW0iD`^q&5*$OnI|h@gZ(0iVX#{{cF7qnrQ$ literal 0 HcmV?d00001 diff --git a/src/docs/asciidoc/openiec61850-doc.adoc b/src/docs/asciidoc/openiec61850-doc.adoc new file mode 100644 index 0000000..8b2be4e --- /dev/null +++ b/src/docs/asciidoc/openiec61850-doc.adoc @@ -0,0 +1,438 @@ += OpenIEC61850 User Guide +include::common-settings.txt[] + +:numbered: + +== Intro + +OpenIEC61850 is a library implementing the IEC 61850 standard based on +the MMS mapping for client and server communication. It is licensed +under the Apache 2.0 license. OpenIEC61850 includes a console client +and server as well as a gui client. + +=== Distribution + +After extracting the distribution tar file the OpenIEC61850 library +can be found in the build/libs-all folder. For license information +check the _license_ directory in the distribution. + +==== Dependencies + +Besides the OpenIEC61850 library the folder _build/libs-all/_ contains the +following external libraries: + +* *jasn1* - a library from the jASN1 project doing BER + encoding/decoding, Copyright 2011-17 Fraunhofer ISE, Author: Stefan + Feuerhahn, License: LGPLv2.1 or later, http://www.openmuc.org + +* *slf4j-api* - a popular logging API. It is only needed if + openiec61850 is used to implement a server. The client part does + not log anything. License: MIT, http://www.slf4j.org + +* *logback-core/logback-classic* - an actual logger implementation of + the slf4-api. It is used by the console server application to + output log information. It can be replaced by a logger of your + choice that supports the slf4j API. Like slf4j it is only needed + for server implementations. License: EPLv1.0 and LGPLv2.1, + http://logback.qos.ch + +* *jcalendar* - a calendar library needed by the client GUI. You don't + need this dependency if you don't use the client gui. (C) + 1999-2011 Kai Toedter, License: LGPLv3, + http://toedter.com/jcalendar/ + + +=== Console & GUI Applications + +You can execute the console client and server through the scripts +found in the folder _run-scripts_. Executing the scripts without any +parameters will print help information to the screen. Note that under +Unix/Linux you need root privilages if you want the server to listen +on any port lower than 1000. + +Instead of running the applications from the terminal you can create +Eclipse project files as explained in our +link:https://www.openmuc.org/faq/gradle_getting_started/[FAQs] and run +them from within Eclipse. + + +=== OSI Stack + +The OpenIEC61850 library includes an OSI stack implementation as it is +needed by the IEC 61850 MMS mapping. The API of the OSI stack and the +OSI transport layers are made public so that they can be used by other +projects. + +* *josistack* - implements the Application Control Service Element + (ACSE) protocol as defined by ISO 8650 or ITU X.217/X.227, the + lower ISO Presentation Layer as defined by ISO 8823/ITU X226, and + the ISO Session Layer as defined by 8327/ITU X.225. + +* *jositransport* - implements RFC 1006 and the OSI Transport Service + Layer. + + +== Using OpenIEC61850 + +The easiest way to learn how OpenIEC61850 works is by running and +analyzing the console client and server applications. You might want +to look at the source code of the console applications to get an +understanding of how they work. They can be used as a basis for you to +code your individual client or server applications. + +An IEC 61850 device that is to be controlled or monitored is called an +IEC 61850 server. An IEC 61850 server normally listens on port 102 for +incoming connection requests by IEC 61850 clients. + +=== Client + +If you want to connect to an IEC 61850 server, you should first create +an instance of ClientSap (SAP = Service Access Point) and configure it +to your needs. Then you build up the association to the server using +the associate() method. + +=== Server + +First get a List of ServerSaps using the method +ServerSap.getSapsFromSclFile(). This method reads in the SAP from the +given ICD file. Take the ServerSap you want to run and configure it to +your needs (e.g. set the port to listen on). The ServerSap includes +the complete device model defined in the ICD file. Retrieve a copy of +it using the method getModelCopy(). Tell the ServerSap to start +to listen on the configured port using startListening(). This is a +non-blocking function. + +=== Data Model + +An IEC 61850 server contains a treelike data model that contains at +its leafs the data (integers, boolean, strings etc) that can be +accessed by clients. Clients can also retrieve the whole data model +from the server. + +The upper most model node ist called "server". In OpenIEC61850 it is +an object of type ServerModel. The server node contains 1..n logical +devices (LD). A logical device may contain 1..n logical nodes (LN). A +logical node may contain 1..n data objects. In OpenIEC61850 the +logical nodes do not contain complete data objects but instead contain +so called functionally constraint data objects (FCDO). An FCDO is a +data object that is split up by functional constraint. An FCDO can +contain a combination of other FCDOs, arrays, constructed data +attributes and/or basic data attributes. + +All nodes of the server model in OpenIEC61850 are of one of the +following seven types: + +* ServerModel +* LogicalDevice +* LogicalNode +* FcDataObject +* Array +* ConstructedDataAttribute +* BasicDataAttribute + +They all implement the ModelNode interface. The nodes FcDataObject, +Array, ConstructedDataAttribute and BasicDataAttribute also implement +the interface called FcModelNode because they are considered +functionally constraint data in the standard. Many of the services of +IEC 61850 can only be applied to functionally constraint data +(e.g. GetDataValues and SetDataValues). + +When programming a client you get a copy of the server model either +through ClientAssociation.retrieveModel() or +ClientAssociation.getModelFromSclFile(). When programming a server you +get a copy of the server model through the ServerSap.getModelCopy() +function. + +You can then navigate through the model using several functions: + +* ServerModel.findModelNode(ObjectReference objectReference, Fc fc) + will search for the subnode with the given reference and functional + constraint. + +* ModelNode.getChild(String name, Fc fc) will return the child node + with the given name and functional constraint. + +* ModelNode.getBasicDataAttributes() will return a list of all leaf + nodes (basic data attributes) of the model node. + + + +== Modifying and Compiling OpenIEC61850 + +We use the Gradle build automation tool. The distribution contains a +fully functional gradle build file (_build.gradle_). Thus if you +changed code and want to rebuild a library you can do it easily with +Gradle. Also if you want to import our software into Eclipse you can +easily create Eclipse project files using Gradle. Just follow the +instructions on our +link:https://www.openmuc.org/faq/gradle_getting_started/[FAQ site]. + +== IEC 61850 Concepts + +=== Data Sets + +Data sets (DS) form a group/set of data. Data sets can be used to read +or write several data objects/data attributes at once using a single +request/response message exchange. The service used for this are +GetDataSetValues and SetDataSetValues. Besides the data set +services the reporting, logging, GOOSE and sampled value services also +use the data set concept. + +The data attributes or data objects that are part of a data set are +called the members of a data set. Only functionally constraint data +may be a member of a data set. + +The IEC 61850 standard defines five ASCI services related to data sets: + +* *GetDataSetValues* to get the value of all members of the data set. + +* *SetDataSetValues* to set the value of all members of the data set. + +* *CreateDataSet* to create a new data set dynamically. + +* *DeleteDataSet* to delete a data set that was created. + +* *GetDataSetDirectory* to get the list of all existing data sets in + the server + +Two types of data sets exist: + +* *Persistent data sets* - they have a reference of the format + LDName/LNName.DataSetName . They are visible to all + clients. Persistent data sets can be preconfigured in the SCL + file. In this case they cannot be deleted. Persistent data sets can + also be dynamicall created by clients. In this case they may be + deleted again later. Dynamically created data sets will be + automatically deleted once the server stops. + +* *Non-persistent data sets* - they have a reference of the format + @datasetname . They are only visible to the client that created it + through the CreateDataSet service. These data sets only exist as + long as the association is open. + + +=== Reporting + +Reporting allows a server to send data based on events and without +explict request by the client. What data is sent and the events that +cause reports are configured through so called report control blocks +(RCB). + +The standard distinguishes between two types of reporting: buffered +reporting and unbuffered reporting. With buffered reporting reports +are buffered by the server in case a connection to the client is +interrupted. This way reports can be sent after the client has +connected again. Buffered reporting is configured through buffered +report control blocks (BRCB). Unbuffered reporting is configured +through unbuffered report control blocks (URCB). + +RCBs are located within logical nodes of the server's data model +(i.e. the server's ICD/SCL file). They are fixed and cannot be deleted +or added at runtime. An RCB is blocked once a client has registered to +receive reports (by enabling it). That means a single RCB cannot send +reports to several clients in parallel. + +RCBs are always associated with a specific <<_data_sets,data set>> +that must be located in the same logical node as the RCB. A subset of +the data set's members will be reported if any of the configured +events occures. The associated data set of the RCB can be +dynamically changed by a client at run-time. + +RCBs are located in logical nodes in the server's model tree. Therefor +the reference of an RCB is of the form +LogicalDeviceName/LogicalNodeName.RCBName . Even though RCBs can only +reference data sets located in the same logical node as the RCB +itself, they can still monitor data from other logical nodes because +the data set's members can be located in other logical nodes. + +The following events can cause a server to send a report: + +. The client issues a general interrogation. + +. A data attribute that is part of the associated data set changes or +is updated. + +. Periodic sending of reports has been enabled by setting the +integrity period of an RCB. + +Whether one of these events really causes a report to be sent is +configured through the RCB. + +A report control block contains the following fields: + +* Configuration fields. They can only be written if the RCB has not + been enabled nor reserved by another client: + +** *RptID* - The report ID identifies the RCB. If not set, it equals + the RCB reference. The RptID will be sent with every report so that + the client can identify the RCB responsible for the report. + +** *DatSet* - The reference of the data set associated with this RCB. It + must be located in the same logical node as the RCB. Members of + this data set will be reported whenever the configured events + occure. + +** *OptFlds* - A bitstring where each bit indicates whether an + optional field is included in the reports caused by this RCB. The + following optional fields exist: sequence-number, report- + timestamp, reason-for-inclusion, data-set-name, data-reference, + buffer-overflow, entryID, segmentation, and conf-revision. For + URCBs the values of buffer-overflow and entryID are ignored. + +** *BufTm* - In case of an event that causes a report the server will + wait for _BufTm_ ms for other events. All data that is to be + reported because of events in this time span is sent in a single + report. + +** *TrgOps* - Specifies which events will trigger reports. Possible + events are: + +*** data change (dchg) + +*** quality change (qchg) + +*** data update (dupd) + +*** integrity - if enabled the server will send periodic integrity + reports to the client. Integrity reports will contain the current + values of all members of the referenced data set. + +*** general interrogation (GI). + +** *IntgPd* - The integrity period specifies an interval in ms for the + periodic sending of intergrity reports. + +** *PurgeBuf* (only part of BRCBs not URCBs) - + +** *EntryID* (only part of BRCBs not URCBs) - + +* Information fields: can only be read: + +** *SqNum* - the current sequence number of the RCB. After sending a + report the RCB will increment the sequence number by one. + +** *ConfRev* - The configuration revision is a counter representing the number of + times the referenced data set was changed. + +** *Owner* - Shall be equal to the IP of the client that reserved the + RCB. Shall be NULL (i.e. the empty string) if the RCB is not + reserved. + +** *TimeOfEntry* (only part of BRCBs not URCBs) + +* Functional fields: The following fields of the RCB can be read or +written to execute functions: + +** *Resv* (only part of URCBs not BRCBs) - Before doing anything with + an RCB a client should reserve it by setting this field to + true. If the setting was successful the RCB will be reserved + exclusively for this client. Enabling an RCB that has not been + reserved implicitly reserves it. + +** *ResvTms* (only part of BRCBs not URCBs) - This attribute of BRCBs + is optional. If not present the control block is reserved by + simply enabling it. A ResvTms value of -1 indicates that the + control block was reserved by configuration for a certain set of + clients. A value of 0 indicates that the BRCB is not reserved. A + client can reserve the control block by writing a value largen + than 0. The value represents the number of seconds that the + reservation shall be maintained after the association was closed + or interrupted. + +** *RptEna* - By setting this variable to true reporting will be + enabled. Note that changing/writing and configuration fields of + the RCB will fail as long as reporting is enabled. + +** *GI* - General Interrogation. Setting this parameter to true will + initiate a report to be sent to the client. This report will + contain all the data of the associated data set. The GI parameter + will be reset to false automatically by the server once the report + has been sent. + + +A report always contains the following information fields: + +* *RptID* - The report ID identifies the RCB that has caused the + generation of the report. It equals the RptID field of the RCB. + +* *OptFlds* - It is equal to the OptFlds field of the corresponding + RCB. + +* *SqNum* (optional, included if OptFlds.SequenceNumber is true) - The + sequence number of the report. It is equal to the SqNum field of + the corresponding RCB by the time it was sent. + +* *TimeOfEntry* (optional, included if OptFlds.report-timestamp is + true) - specifies the time when the Entry ID was created. + +* *DatSet* (optional, included if OptFlds.dataset-name is true) - The + reference of the data set whose data is sent in this report. + +* *BufOvfl* (optional, only included if it is a buffered report and + OptFlds.buffer-overflow is true) - Indicates the server lost report + entries due to a buffer overflow. Only applies to buffered + reporting. + +* *EntryID* (optional, only included if it is a buffered report and + OptFlds.entryID is true) - Entry identification ToDo + +* *ConfRev* (optional, only included if OptFlds.conf-rev is true) - It + is equal to the ConfRev field of the corresponding RCB. + +* *SubSqNum* (optional, included if OptFlds.segmentation is true) - In + case that a long report does not fit into one message, a single + report shall be divided into subreports. Each subreport shall have + the same sequence number and a unique SubSqNum. + +* *MoreSegmentsFollow* (optional, included if OptFlds.segmentation is + true) - indicates that more subreports with the same SqNum follow. + +* *Inclusion Bitstring* - A bit string whose length equals the number + of data members of the referenced data set. Each bit indicates + whether the corresponding data member is included in the report or + not. + +* *Data-references* (optional, included if OptFlds.data-reference is + true) - The references of the reported data set members. + +* *Values* - The values of the reported data set members. + +* *Reason Codes* (optional, included if OptFlds.reason-for-inclusion + is true) - The reason codes indicate for each reported value, the + reason why it was reported. Possible reasons are data change, + quality change, data update, integrity, general interrogation, + and application trigger. Several reasons can be true for a single + reported value. + +A client that wants to receive reports from a certain RCB would +usually first attempt to reserve the RCB. If successful he would then +configure the RCB as he wishes. Finally he would enable reporting. + + +== Terminology + +* *BRCB* - Buffered Report Control Block + +* *DS* - Data Set + +* *LD* - Logical Device + +* *LN* - Logical Node + +* *SAP* - Service Access Point + +* *URCB* - Unbuffered Report Control Block + +== Authors + +Developers: + +* Stefan Feuerhahn + +Former developers: + +* Claus Brunzema +* Bertram Lückehe +* Chau Do +* Tobias Weidelt +* Michael Zillgith diff --git a/src/docs/asciidoc/openmuc-asciidoc.css b/src/docs/asciidoc/openmuc-asciidoc.css new file mode 100644 index 0000000..4951b69 --- /dev/null +++ b/src/docs/asciidoc/openmuc-asciidoc.css @@ -0,0 +1,398 @@ +/* + * AsciiDoc 'volnitsky' theme for xhtml11 and html5 backends. + * Based on css from http://volnitsky.com, which was in turn based on default + * theme from AsciiDoc + * + * FIXME: The styling is still a bit rough in places. + * + */ + +/* Default font. */ +body { + font-family: Helvetica, sans-serif; + max-width:62.5em; + margin: auto; +} + +/* Title font. */ + +h1, h2, h3, h4, h5, h6 { + clear: both; + font-family: Helvetica, serif; + line-height: 1.3; +} + +a { + border-bottom: 1px dotted #999999; + color: #378f03 !important; + text-decoration: none !important; +} +a:hover { + border-bottom: 1px solid #378f03; + color: #378f03 !important; + text-decoration: none !important; +} + +em { + font-style: italic; + color: #4E4E4E; +} + +strong { + font-weight: bold; + color: #000000; +} + + +div.sectionbody { +/* margin-left: 0;*/ +} + +hr { + border: 1px solid #575757; +} + + +pre { + padding: 0; + margin: 0; +} + +#author { + color: #575757; + font-weight: bold; + font-size: 1.1em; +} + +#footer { + font-size: small; + padding-top: 0.5em; + margin-top: 4.0em; +} + +#footer-text { + float: left; + padding-bottom: 0.5em; +} + +#footer-badges { + float: right; + padding-bottom: 0.5em; +} + +#preamble { + margin-top: 1.5em; + margin-bottom: 1.5em; +} + +div.tableblock, div.imageblock, div.exampleblock, div.verseblock, +div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, +div.admonitionblock { + margin-top: 1.5em; + margin-bottom: 1.5em; +} + +div.admonitionblock { + margin-top: 2.5em; + margin-bottom: 2.5em; +} + +div.content { /* Block element content. */ + padding: 0; +} + +/* Block element titles. */ +div.title, caption.title { + color: #575757; + font-weight: bold; + text-align: left; + margin-top: 1.0em; + margin-bottom: 0.5em; +} +div.title + * { + margin-top: 0; +} + +td div.title:first-child { + margin-top: 0.0em; +} +div.content div.title:first-child { + margin-top: 0.0em; +} +div.content + div.title { + margin-top: 0.0em; +} + +div.sidebarblock > div.content { + background: #ffffee; + border: 1px solid silver; + padding: 0.5em; +} + +div.listingblock > div.content { + border: 1px solid silver; + background: #f4f4f4; + padding: 0.5em; +} + +div.quoteblock { + padding-left: 2.0em; + margin-right: 10%; +} +div.quoteblock > div.attribution { + padding-top: 0.5em; + text-align: right; +} + +div.verseblock { + padding-left: 2.0em; + margin-right: 10%; +} +div.verseblock > pre.content { + font-family: inherit; +} +div.verseblock > div.attribution { + padding-top: 0.75em; + text-align: left; +} +/* DEPRECATED: Pre version 8.2.7 verse style literal block. */ +div.verseblock + div.attribution { + text-align: left; +} + +div.admonitionblock .icon { + vertical-align: top; + font-size: 1.1em; + font-weight: bold; + text-decoration: underline; + color: #575757; + padding-right: 0.5em; +} +div.admonitionblock td.content { + padding-left: 0.5em; + border-left: 2px solid silver; +} + +div.exampleblock > div.content { + border-left: 2px solid silver; + padding: 0.5em; +} + +div.imageblock div.content { padding-left: 0; } +span.image img { border-style: none; } +a.image:visited { color: white; } + +dl { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +dt { + margin-top: 0.5em; + margin-bottom: 0; + font-style: normal; + color: #575757; +} +dd > *:first-child { + margin-top: 0.1em; +} + +ul, ol { + list-style-position: outside; +} +ol.arabic { + list-style-type: decimal; +} +ol.loweralpha { + list-style-type: lower-alpha; +} +ol.upperalpha { + list-style-type: upper-alpha; +} +ol.lowerroman { + list-style-type: lower-roman; +} +ol.upperroman { + list-style-type: upper-roman; +} + +div.compact ul, div.compact ol, +div.compact p, div.compact p, +div.compact div, div.compact div { + margin-top: 0.1em; + margin-bottom: 0.1em; +} + +div.tableblock > table { + border: 3px solid #575757; +} +thead { + font-weight: bold; + color: #575757; +} +tfoot { + font-weight: bold; +} +td > div.verse { + white-space: pre; +} +p.table { + margin-top: 0; +} +/* Because the table frame attribute is overriden by CSS in most browsers. */ +div.tableblock > table[frame="void"] { + border-style: none; +} +div.tableblock > table[frame="hsides"] { + border-left-style: none; + border-right-style: none; +} +div.tableblock > table[frame="vsides"] { + border-top-style: none; + border-bottom-style: none; +} + + +div.hdlist { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +div.hdlist tr { + padding-bottom: 15px; +} +dt.hdlist1.strong, td.hdlist1.strong { + font-weight: bold; +} +td.hdlist1 { + vertical-align: top; + font-style: normal; + padding-right: 0.8em; + color: #575757; +} +td.hdlist2 { + vertical-align: top; +} +div.hdlist.compact tr { + margin: 0; + padding-bottom: 0; +} + +.comment { + background: yellow; +} + +@media print { + #footer-badges { display: none; } +} + +#toctitle { + color: #575757; + font-size: 1.2em; + font-weight: bold; + margin-top: 1.0em; + margin-bottom: 0.1em; +} + +div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { margin-top: 0; margin-bottom: 0; } +div.toclevel1 { margin-top: 0.3em; margin-left: 0; font-size: 1.0em; } +div.toclevel2 { margin-top: 0.25em; margin-left: 2em; font-size: 0.9em; } +div.toclevel3 { margin-left: 4em; font-size: 0.8em; } +div.toclevel4 { margin-left: 6em; font-size: 0.8em; } + + + +.monospaced, tt, div.listingblock > div.content { + font-family: Consolas, "Andale Mono", "Courier New", monospace; + color: #004400; + background: #f4f4f4; + max-width: 80em; + line-height: 1.2em; +} + +.paragraph p { + line-height: 1.5em; + margin-top: 1em; +} + +/*.paragraph p, li, dd, .content { max-width: 85em; } +.admonitionblock { max-width: 35em; }*/ + +div.sectionbody div.ulist > ul > li { + list-style-type: square; + color: #aaa; +} + div.sectionbody div.ulist > ul > li > * { + color: black; + /*font-size: 50%;*/ + } + + +div.sectionbody div.ulist > ul > li div.ulist > ul > li { + color: #ccd ; +} + div.sectionbody div.ulist > ul > li div.ulist > ul > li > * { + color: black ; + } + +/* + * html5 specific + * + * */ + +table.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +thead, p.tableblock.header { + font-weight: bold; + color: #575757; +} +p.tableblock { + margin-top: 0; +} +table.tableblock { + border-width: 3px; + border-spacing: 0px; + border-style: solid; + border-color: #575757; + border-collapse: collapse; +} +th.tableblock, td.tableblock { + border-width: 1px; + padding: 4px; + border-style: solid; + border-color: #575757; +} + +table.tableblock.frame-topbot { + border-left-style: hidden; + border-right-style: hidden; +} +table.tableblock.frame-sides { + border-top-style: hidden; + border-bottom-style: hidden; +} +table.tableblock.frame-none { + border-style: hidden; +} + +th.tableblock.halign-left, td.tableblock.halign-left { + text-align: left; +} +th.tableblock.halign-center, td.tableblock.halign-center { + text-align: center; +} +th.tableblock.halign-right, td.tableblock.halign-right { + text-align: right; +} + +th.tableblock.valign-top, td.tableblock.valign-top { + vertical-align: top; +} +th.tableblock.valign-middle, td.tableblock.valign-middle { + vertical-align: middle; +} +th.tableblock.valign-bottom, td.tableblock.valign-bottom { + vertical-align: bottom; +} + + diff --git a/src/docs/asciidoc/pdf-theme.yml b/src/docs/asciidoc/pdf-theme.yml new file mode 100644 index 0000000..d6f579a --- /dev/null +++ b/src/docs/asciidoc/pdf-theme.yml @@ -0,0 +1,54 @@ +title_page: + align: right + +page: + layout: portrait +# margin: [0.75in, 1in, 0.75in, 1in] + size: A4 + +base: + font_family: Times-Roman + font_color: #333333 + font_size: 11 + line_height_length: 17 + line_height: $base_line_height_length / $base_font_size + +vertical_rhythm: $base_line_height_length + +heading: + font_color: #0000 + font_size: 14 + font_style: bold + line_height: 1.2 + margin_bottom: $vertical_rhythm + +link: + font_color: #939393 + +outline_list: + indent: $base_font_size * 1.5 + +header: + height: 0.75in + line_height: 1 + recto_content: + center: '{document-title}' + verso_content: + center: '{document-title}' + +footer: + height: 0.75in + line_height: 1 + recto_content: + right: '*{page-number}*' + verso_content: + left: '*{page-number}*' + +caption: + align: left + font_color: #000000 + font_size: 9 + +code: + border_color: #cccccc + \ No newline at end of file diff --git a/src/gradle/wrapper/gradle-wrapper.jar b/src/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..0fd97755906869d5d08fbf9677d0e3c5338b296a GIT binary patch literal 54783 zcmafaW0WS*vSoGIwr!)!wr%4p+g6utqszAKsxI5MZBNhK_h#nax$n)7$jp^1Vx1G2 zC(qu2RFDP%MFj$agaiTt68tMbK*0a&2m}Q6_be-_B1k7GC&mB*r0`FQu26lR{C^cx z{>oqT|Dz}?C?_cuFbIhy@Hlls4PVE#kL z%+b)q8t~t$qWrU}o1>w6dSEU{WQ11MaYRHV`^W006GEHNkKbo3<`>slS- z^Iau?J5(A*RcG;?9caykA`<#qy1~O zV;;PYMn6SI$q}ds#zKhlt{2DkLyA|tPj@5nHw|TfoB{R9AOtjRH|~!gjc7>@`h6hQ zNQ|Ch4lR}rT_GI4eQoy|sMheUuhTnv@_rRPV^^6SNCY zJt~}LH52Y+RK{G^aZh@qG*^+5XM={Yu0CS=<}foB$I}fd5f&atxdLYMbAT-oGoKoE zEX@l(|ILgqD&rTwS4@T(du@BzN3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QUqA~3L?0}ybq)R_Gx!p4$ePn09?(qufci531&|XE7x^bZz(p|A;7`# z7r0IIe}n_n*VxX`-d-Bu18!*bANPfq@cIkKskVToM1cJxLEtCD6yQ<%MQs5})E18R z0QnbDQwu`@eSH9fjINcg@qZ%#Epc1X1T?rjpuzvzIpXnuNg!sY3ozkS0!T%QTU#1R zTU(nu+Wfj{8bfssa-o5MC;>GE?7jL^;UfA6Xca)m0~mh(=zG7$-91#bF9o120S*Ar zp9%@!7yP14B>vOuevOw=hH*0kXk%7@y~bbh;Awx2XJzl8Yhm%<`Y^a9ekv~DNj(G% zCIo+~9pDjR`6s+z*RH^ozC{^ugMa|v4uCuIr{X34OEhU~nZ-b>V%rZYcL5exwm>Hm60|IvcxCEyQ$AHD2H`C&8jvseQF z|J1%elG0vY{L*yh=f#`~p|6;2A685EV`%l;f>wkj%bClsF=1bY&pO}@7|AhI+ z7TW(dGQJe({fV0D^c$%EU9R_K^E ze981u2JR=5iSKVP{gx=)OU{>KUOzd}0)B(@pQOEBQoU3K`ANkd@f%eCpb_$t>81L@ zPbSU}zrplJcM$lc7Q;)bms#&Wsc2$v`O}#D?~&$@+w$vd!IxAo)3bh3VQ2gX z)&Fd(mw7rr@$IsH1OK11c3%FNmuU?@$*ObzH`%WzSufY0e`0FX{|)nB&GGlu=$G|; z8TZI?*Z|aFu>me0sTLv Cq4>K1 literal 0 HcmV?d00001 diff --git a/src/gradle/wrapper/gradle-wrapper.properties b/src/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..8167ed1 --- /dev/null +++ b/src/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Apr 25 13:05:33 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip diff --git a/src/gradlew b/src/gradlew new file mode 100755 index 0000000..4453cce --- /dev/null +++ b/src/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save ( ) { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/src/gradlew.bat b/src/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/src/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/license/NOTICE b/src/license/NOTICE new file mode 100644 index 0000000..488429e --- /dev/null +++ b/src/license/NOTICE @@ -0,0 +1,16 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ diff --git a/src/license/apache-license-2.0.txt b/src/license/apache-license-2.0.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/src/license/apache-license-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AAREApdu.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AAREApdu.java new file mode 100644 index 0000000..0646726 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AAREApdu.java @@ -0,0 +1,606 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class AAREApdu implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.APPLICATION_CLASS, BerTag.CONSTRUCTED, 1); + + public byte[] code = null; + private BerBitString protocolVersion = null; + private BerObjectIdentifier applicationContextName = null; + private AssociateResult result = null; + private AssociateSourceDiagnostic resultSourceDiagnostic = null; + private APTitle respondingAPTitle = null; + private AEQualifier respondingAEQualifier = null; + private APInvocationIdentifier respondingAPInvocationIdentifier = null; + private AEInvocationIdentifier respondingAEInvocationIdentifier = null; + private ACSERequirements responderAcseRequirements = null; + private MechanismName mechanismName = null; + private AuthenticationValue respondingAuthenticationValue = null; + private ApplicationContextNameList applicationContextNameList = null; + private ImplementationData implementationInformation = null; + private AssociationInformation userInformation = null; + + public AAREApdu() { + } + + public AAREApdu(byte[] code) { + this.code = code; + } + + public void setProtocolVersion(BerBitString protocolVersion) { + this.protocolVersion = protocolVersion; + } + + public BerBitString getProtocolVersion() { + return protocolVersion; + } + + public void setApplicationContextName(BerObjectIdentifier applicationContextName) { + this.applicationContextName = applicationContextName; + } + + public BerObjectIdentifier getApplicationContextName() { + return applicationContextName; + } + + public void setResult(AssociateResult result) { + this.result = result; + } + + public AssociateResult getResult() { + return result; + } + + public void setResultSourceDiagnostic(AssociateSourceDiagnostic resultSourceDiagnostic) { + this.resultSourceDiagnostic = resultSourceDiagnostic; + } + + public AssociateSourceDiagnostic getResultSourceDiagnostic() { + return resultSourceDiagnostic; + } + + public void setRespondingAPTitle(APTitle respondingAPTitle) { + this.respondingAPTitle = respondingAPTitle; + } + + public APTitle getRespondingAPTitle() { + return respondingAPTitle; + } + + public void setRespondingAEQualifier(AEQualifier respondingAEQualifier) { + this.respondingAEQualifier = respondingAEQualifier; + } + + public AEQualifier getRespondingAEQualifier() { + return respondingAEQualifier; + } + + public void setRespondingAPInvocationIdentifier(APInvocationIdentifier respondingAPInvocationIdentifier) { + this.respondingAPInvocationIdentifier = respondingAPInvocationIdentifier; + } + + public APInvocationIdentifier getRespondingAPInvocationIdentifier() { + return respondingAPInvocationIdentifier; + } + + public void setRespondingAEInvocationIdentifier(AEInvocationIdentifier respondingAEInvocationIdentifier) { + this.respondingAEInvocationIdentifier = respondingAEInvocationIdentifier; + } + + public AEInvocationIdentifier getRespondingAEInvocationIdentifier() { + return respondingAEInvocationIdentifier; + } + + public void setResponderAcseRequirements(ACSERequirements responderAcseRequirements) { + this.responderAcseRequirements = responderAcseRequirements; + } + + public ACSERequirements getResponderAcseRequirements() { + return responderAcseRequirements; + } + + public void setMechanismName(MechanismName mechanismName) { + this.mechanismName = mechanismName; + } + + public MechanismName getMechanismName() { + return mechanismName; + } + + public void setRespondingAuthenticationValue(AuthenticationValue respondingAuthenticationValue) { + this.respondingAuthenticationValue = respondingAuthenticationValue; + } + + public AuthenticationValue getRespondingAuthenticationValue() { + return respondingAuthenticationValue; + } + + public void setApplicationContextNameList(ApplicationContextNameList applicationContextNameList) { + this.applicationContextNameList = applicationContextNameList; + } + + public ApplicationContextNameList getApplicationContextNameList() { + return applicationContextNameList; + } + + public void setImplementationInformation(ImplementationData implementationInformation) { + this.implementationInformation = implementationInformation; + } + + public ImplementationData getImplementationInformation() { + return implementationInformation; + } + + public void setUserInformation(AssociationInformation userInformation) { + this.userInformation = userInformation; + } + + public AssociationInformation getUserInformation() { + return userInformation; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (userInformation != null) { + codeLength += userInformation.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 30 + os.write(0xBE); + codeLength += 1; + } + + if (implementationInformation != null) { + codeLength += implementationInformation.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 29 + os.write(0x9D); + codeLength += 1; + } + + if (applicationContextNameList != null) { + codeLength += applicationContextNameList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 11 + os.write(0xAB); + codeLength += 1; + } + + if (respondingAuthenticationValue != null) { + sublength = respondingAuthenticationValue.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 10 + os.write(0xAA); + codeLength += 1; + } + + if (mechanismName != null) { + codeLength += mechanismName.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 9 + os.write(0x89); + codeLength += 1; + } + + if (responderAcseRequirements != null) { + codeLength += responderAcseRequirements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 8 + os.write(0x88); + codeLength += 1; + } + + if (respondingAEInvocationIdentifier != null) { + sublength = respondingAEInvocationIdentifier.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 7 + os.write(0xA7); + codeLength += 1; + } + + if (respondingAPInvocationIdentifier != null) { + sublength = respondingAPInvocationIdentifier.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 6 + os.write(0xA6); + codeLength += 1; + } + + if (respondingAEQualifier != null) { + sublength = respondingAEQualifier.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 5 + os.write(0xA5); + codeLength += 1; + } + + if (respondingAPTitle != null) { + sublength = respondingAPTitle.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 + os.write(0xA4); + codeLength += 1; + } + + sublength = resultSourceDiagnostic.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 3 + os.write(0xA3); + codeLength += 1; + + sublength = result.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + + sublength = applicationContextName.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + + if (protocolVersion != null) { + codeLength += protocolVersion.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + protocolVersion = new BerBitString(); + subCodeLength += protocolVersion.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + subCodeLength += length.decode(is); + applicationContextName = new BerObjectIdentifier(); + subCodeLength += applicationContextName.decode(is, true); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + subCodeLength += length.decode(is); + result = new AssociateResult(); + subCodeLength += result.decode(is, true); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) { + subCodeLength += length.decode(is); + resultSourceDiagnostic = new AssociateSourceDiagnostic(); + subCodeLength += resultSourceDiagnostic.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { + subCodeLength += length.decode(is); + respondingAPTitle = new APTitle(); + subCodeLength += respondingAPTitle.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) { + subCodeLength += length.decode(is); + respondingAEQualifier = new AEQualifier(); + subCodeLength += respondingAEQualifier.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) { + subCodeLength += length.decode(is); + respondingAPInvocationIdentifier = new APInvocationIdentifier(); + subCodeLength += respondingAPInvocationIdentifier.decode(is, true); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 7)) { + subCodeLength += length.decode(is); + respondingAEInvocationIdentifier = new AEInvocationIdentifier(); + subCodeLength += respondingAEInvocationIdentifier.decode(is, true); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 8)) { + responderAcseRequirements = new ACSERequirements(); + subCodeLength += responderAcseRequirements.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) { + mechanismName = new MechanismName(); + subCodeLength += mechanismName.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 10)) { + subCodeLength += length.decode(is); + respondingAuthenticationValue = new AuthenticationValue(); + subCodeLength += respondingAuthenticationValue.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 11)) { + applicationContextNameList = new ApplicationContextNameList(); + subCodeLength += applicationContextNameList.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 29)) { + implementationInformation = new ImplementationData(); + subCodeLength += implementationInformation.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 30)) { + userInformation = new AssociationInformation(); + subCodeLength += userInformation.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (protocolVersion != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("protocolVersion: ").append(protocolVersion); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (applicationContextName != null) { + sb.append("applicationContextName: ").append(applicationContextName); + } + else { + sb.append("applicationContextName: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (result != null) { + sb.append("result: ").append(result); + } + else { + sb.append("result: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (resultSourceDiagnostic != null) { + sb.append("resultSourceDiagnostic: "); + resultSourceDiagnostic.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("resultSourceDiagnostic: "); + } + + if (respondingAPTitle != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("respondingAPTitle: "); + respondingAPTitle.appendAsString(sb, indentLevel + 1); + } + + if (respondingAEQualifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("respondingAEQualifier: "); + respondingAEQualifier.appendAsString(sb, indentLevel + 1); + } + + if (respondingAPInvocationIdentifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("respondingAPInvocationIdentifier: ").append(respondingAPInvocationIdentifier); + } + + if (respondingAEInvocationIdentifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("respondingAEInvocationIdentifier: ").append(respondingAEInvocationIdentifier); + } + + if (responderAcseRequirements != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("responderAcseRequirements: ").append(responderAcseRequirements); + } + + if (mechanismName != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("mechanismName: ").append(mechanismName); + } + + if (respondingAuthenticationValue != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("respondingAuthenticationValue: "); + respondingAuthenticationValue.appendAsString(sb, indentLevel + 1); + } + + if (applicationContextNameList != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("applicationContextNameList: "); + applicationContextNameList.appendAsString(sb, indentLevel + 1); + } + + if (implementationInformation != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("implementationInformation: ").append(implementationInformation); + } + + if (userInformation != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("userInformation: "); + userInformation.appendAsString(sb, indentLevel + 1); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AARQApdu.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AARQApdu.java new file mode 100644 index 0000000..cb38109 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AARQApdu.java @@ -0,0 +1,677 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class AARQApdu implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.APPLICATION_CLASS, BerTag.CONSTRUCTED, 0); + + public byte[] code = null; + private BerBitString protocolVersion = null; + private BerObjectIdentifier applicationContextName = null; + private APTitle calledAPTitle = null; + private AEQualifier calledAEQualifier = null; + private APInvocationIdentifier calledAPInvocationIdentifier = null; + private AEInvocationIdentifier calledAEInvocationIdentifier = null; + private APTitle callingAPTitle = null; + private AEQualifier callingAEQualifier = null; + private APInvocationIdentifier callingAPInvocationIdentifier = null; + private AEInvocationIdentifier callingAEInvocationIdentifier = null; + private ACSERequirements senderAcseRequirements = null; + private MechanismName mechanismName = null; + private AuthenticationValue callingAuthenticationValue = null; + private ApplicationContextNameList applicationContextNameList = null; + private ImplementationData implementationInformation = null; + private AssociationInformation userInformation = null; + + public AARQApdu() { + } + + public AARQApdu(byte[] code) { + this.code = code; + } + + public void setProtocolVersion(BerBitString protocolVersion) { + this.protocolVersion = protocolVersion; + } + + public BerBitString getProtocolVersion() { + return protocolVersion; + } + + public void setApplicationContextName(BerObjectIdentifier applicationContextName) { + this.applicationContextName = applicationContextName; + } + + public BerObjectIdentifier getApplicationContextName() { + return applicationContextName; + } + + public void setCalledAPTitle(APTitle calledAPTitle) { + this.calledAPTitle = calledAPTitle; + } + + public APTitle getCalledAPTitle() { + return calledAPTitle; + } + + public void setCalledAEQualifier(AEQualifier calledAEQualifier) { + this.calledAEQualifier = calledAEQualifier; + } + + public AEQualifier getCalledAEQualifier() { + return calledAEQualifier; + } + + public void setCalledAPInvocationIdentifier(APInvocationIdentifier calledAPInvocationIdentifier) { + this.calledAPInvocationIdentifier = calledAPInvocationIdentifier; + } + + public APInvocationIdentifier getCalledAPInvocationIdentifier() { + return calledAPInvocationIdentifier; + } + + public void setCalledAEInvocationIdentifier(AEInvocationIdentifier calledAEInvocationIdentifier) { + this.calledAEInvocationIdentifier = calledAEInvocationIdentifier; + } + + public AEInvocationIdentifier getCalledAEInvocationIdentifier() { + return calledAEInvocationIdentifier; + } + + public void setCallingAPTitle(APTitle callingAPTitle) { + this.callingAPTitle = callingAPTitle; + } + + public APTitle getCallingAPTitle() { + return callingAPTitle; + } + + public void setCallingAEQualifier(AEQualifier callingAEQualifier) { + this.callingAEQualifier = callingAEQualifier; + } + + public AEQualifier getCallingAEQualifier() { + return callingAEQualifier; + } + + public void setCallingAPInvocationIdentifier(APInvocationIdentifier callingAPInvocationIdentifier) { + this.callingAPInvocationIdentifier = callingAPInvocationIdentifier; + } + + public APInvocationIdentifier getCallingAPInvocationIdentifier() { + return callingAPInvocationIdentifier; + } + + public void setCallingAEInvocationIdentifier(AEInvocationIdentifier callingAEInvocationIdentifier) { + this.callingAEInvocationIdentifier = callingAEInvocationIdentifier; + } + + public AEInvocationIdentifier getCallingAEInvocationIdentifier() { + return callingAEInvocationIdentifier; + } + + public void setSenderAcseRequirements(ACSERequirements senderAcseRequirements) { + this.senderAcseRequirements = senderAcseRequirements; + } + + public ACSERequirements getSenderAcseRequirements() { + return senderAcseRequirements; + } + + public void setMechanismName(MechanismName mechanismName) { + this.mechanismName = mechanismName; + } + + public MechanismName getMechanismName() { + return mechanismName; + } + + public void setCallingAuthenticationValue(AuthenticationValue callingAuthenticationValue) { + this.callingAuthenticationValue = callingAuthenticationValue; + } + + public AuthenticationValue getCallingAuthenticationValue() { + return callingAuthenticationValue; + } + + public void setApplicationContextNameList(ApplicationContextNameList applicationContextNameList) { + this.applicationContextNameList = applicationContextNameList; + } + + public ApplicationContextNameList getApplicationContextNameList() { + return applicationContextNameList; + } + + public void setImplementationInformation(ImplementationData implementationInformation) { + this.implementationInformation = implementationInformation; + } + + public ImplementationData getImplementationInformation() { + return implementationInformation; + } + + public void setUserInformation(AssociationInformation userInformation) { + this.userInformation = userInformation; + } + + public AssociationInformation getUserInformation() { + return userInformation; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (userInformation != null) { + codeLength += userInformation.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 30 + os.write(0xBE); + codeLength += 1; + } + + if (implementationInformation != null) { + codeLength += implementationInformation.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 29 + os.write(0x9D); + codeLength += 1; + } + + if (applicationContextNameList != null) { + codeLength += applicationContextNameList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 13 + os.write(0xAD); + codeLength += 1; + } + + if (callingAuthenticationValue != null) { + sublength = callingAuthenticationValue.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 12 + os.write(0xAC); + codeLength += 1; + } + + if (mechanismName != null) { + codeLength += mechanismName.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 11 + os.write(0x8B); + codeLength += 1; + } + + if (senderAcseRequirements != null) { + codeLength += senderAcseRequirements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 10 + os.write(0x8A); + codeLength += 1; + } + + if (callingAEInvocationIdentifier != null) { + sublength = callingAEInvocationIdentifier.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 9 + os.write(0xA9); + codeLength += 1; + } + + if (callingAPInvocationIdentifier != null) { + sublength = callingAPInvocationIdentifier.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 8 + os.write(0xA8); + codeLength += 1; + } + + if (callingAEQualifier != null) { + sublength = callingAEQualifier.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 7 + os.write(0xA7); + codeLength += 1; + } + + if (callingAPTitle != null) { + sublength = callingAPTitle.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 6 + os.write(0xA6); + codeLength += 1; + } + + if (calledAEInvocationIdentifier != null) { + sublength = calledAEInvocationIdentifier.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 5 + os.write(0xA5); + codeLength += 1; + } + + if (calledAPInvocationIdentifier != null) { + sublength = calledAPInvocationIdentifier.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 + os.write(0xA4); + codeLength += 1; + } + + if (calledAEQualifier != null) { + sublength = calledAEQualifier.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 3 + os.write(0xA3); + codeLength += 1; + } + + if (calledAPTitle != null) { + sublength = calledAPTitle.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + } + + sublength = applicationContextName.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + + if (protocolVersion != null) { + codeLength += protocolVersion.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + protocolVersion = new BerBitString(); + subCodeLength += protocolVersion.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + subCodeLength += length.decode(is); + applicationContextName = new BerObjectIdentifier(); + subCodeLength += applicationContextName.decode(is, true); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + subCodeLength += length.decode(is); + calledAPTitle = new APTitle(); + subCodeLength += calledAPTitle.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) { + subCodeLength += length.decode(is); + calledAEQualifier = new AEQualifier(); + subCodeLength += calledAEQualifier.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { + subCodeLength += length.decode(is); + calledAPInvocationIdentifier = new APInvocationIdentifier(); + subCodeLength += calledAPInvocationIdentifier.decode(is, true); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) { + subCodeLength += length.decode(is); + calledAEInvocationIdentifier = new AEInvocationIdentifier(); + subCodeLength += calledAEInvocationIdentifier.decode(is, true); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) { + subCodeLength += length.decode(is); + callingAPTitle = new APTitle(); + subCodeLength += callingAPTitle.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 7)) { + subCodeLength += length.decode(is); + callingAEQualifier = new AEQualifier(); + subCodeLength += callingAEQualifier.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) { + subCodeLength += length.decode(is); + callingAPInvocationIdentifier = new APInvocationIdentifier(); + subCodeLength += callingAPInvocationIdentifier.decode(is, true); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) { + subCodeLength += length.decode(is); + callingAEInvocationIdentifier = new AEInvocationIdentifier(); + subCodeLength += callingAEInvocationIdentifier.decode(is, true); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) { + senderAcseRequirements = new ACSERequirements(); + subCodeLength += senderAcseRequirements.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) { + mechanismName = new MechanismName(); + subCodeLength += mechanismName.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) { + subCodeLength += length.decode(is); + callingAuthenticationValue = new AuthenticationValue(); + subCodeLength += callingAuthenticationValue.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) { + applicationContextNameList = new ApplicationContextNameList(); + subCodeLength += applicationContextNameList.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 29)) { + implementationInformation = new ImplementationData(); + subCodeLength += implementationInformation.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 30)) { + userInformation = new AssociationInformation(); + subCodeLength += userInformation.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (protocolVersion != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("protocolVersion: ").append(protocolVersion); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (applicationContextName != null) { + sb.append("applicationContextName: ").append(applicationContextName); + } + else { + sb.append("applicationContextName: "); + } + + if (calledAPTitle != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("calledAPTitle: "); + calledAPTitle.appendAsString(sb, indentLevel + 1); + } + + if (calledAEQualifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("calledAEQualifier: "); + calledAEQualifier.appendAsString(sb, indentLevel + 1); + } + + if (calledAPInvocationIdentifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("calledAPInvocationIdentifier: ").append(calledAPInvocationIdentifier); + } + + if (calledAEInvocationIdentifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("calledAEInvocationIdentifier: ").append(calledAEInvocationIdentifier); + } + + if (callingAPTitle != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("callingAPTitle: "); + callingAPTitle.appendAsString(sb, indentLevel + 1); + } + + if (callingAEQualifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("callingAEQualifier: "); + callingAEQualifier.appendAsString(sb, indentLevel + 1); + } + + if (callingAPInvocationIdentifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("callingAPInvocationIdentifier: ").append(callingAPInvocationIdentifier); + } + + if (callingAEInvocationIdentifier != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("callingAEInvocationIdentifier: ").append(callingAEInvocationIdentifier); + } + + if (senderAcseRequirements != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("senderAcseRequirements: ").append(senderAcseRequirements); + } + + if (mechanismName != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("mechanismName: ").append(mechanismName); + } + + if (callingAuthenticationValue != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("callingAuthenticationValue: "); + callingAuthenticationValue.appendAsString(sb, indentLevel + 1); + } + + if (applicationContextNameList != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("applicationContextNameList: "); + applicationContextNameList.appendAsString(sb, indentLevel + 1); + } + + if (implementationInformation != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("implementationInformation: ").append(implementationInformation); + } + + if (userInformation != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("userInformation: "); + userInformation.appendAsString(sb, indentLevel + 1); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ACSEApdu.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ACSEApdu.java new file mode 100644 index 0000000..7de5c64 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ACSEApdu.java @@ -0,0 +1,183 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; + +public class ACSEApdu implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private AARQApdu aarq = null; + private AAREApdu aare = null; + private RLRQApdu rlrq = null; + private RLREApdu rlre = null; + + public ACSEApdu() { + } + + public ACSEApdu(byte[] code) { + this.code = code; + } + + public void setAarq(AARQApdu aarq) { + this.aarq = aarq; + } + + public AARQApdu getAarq() { + return aarq; + } + + public void setAare(AAREApdu aare) { + this.aare = aare; + } + + public AAREApdu getAare() { + return aare; + } + + public void setRlrq(RLRQApdu rlrq) { + this.rlrq = rlrq; + } + + public RLRQApdu getRlrq() { + return rlrq; + } + + public void setRlre(RLREApdu rlre) { + this.rlre = rlre; + } + + public RLREApdu getRlre() { + return rlre; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (rlre != null) { + codeLength += rlre.encode(os, true); + return codeLength; + } + + if (rlrq != null) { + codeLength += rlrq.encode(os, true); + return codeLength; + } + + if (aare != null) { + codeLength += aare.encode(os, true); + return codeLength; + } + + if (aarq != null) { + codeLength += aarq.encode(os, true); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(AARQApdu.tag)) { + aarq = new AARQApdu(); + codeLength += aarq.decode(is, false); + return codeLength; + } + + if (berTag.equals(AAREApdu.tag)) { + aare = new AAREApdu(); + codeLength += aare.decode(is, false); + return codeLength; + } + + if (berTag.equals(RLRQApdu.tag)) { + rlrq = new RLRQApdu(); + codeLength += rlrq.decode(is, false); + return codeLength; + } + + if (berTag.equals(RLREApdu.tag)) { + rlre = new RLREApdu(); + codeLength += rlre.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (aarq != null) { + sb.append("aarq: "); + aarq.appendAsString(sb, indentLevel + 1); + return; + } + + if (aare != null) { + sb.append("aare: "); + aare.appendAsString(sb, indentLevel + 1); + return; + } + + if (rlrq != null) { + sb.append("rlrq: "); + rlrq.appendAsString(sb, indentLevel + 1); + return; + } + + if (rlre != null) { + sb.append("rlre: "); + rlre.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ACSERequirements.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ACSERequirements.java new file mode 100644 index 0000000..526113c --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ACSERequirements.java @@ -0,0 +1,24 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import org.openmuc.jasn1.ber.types.BerBitString; + +public class ACSERequirements extends BerBitString { + + private static final long serialVersionUID = 1L; + + public ACSERequirements() { + } + + public ACSERequirements(byte[] code) { + super(code); + } + + public ACSERequirements(byte[] value, int numBits) { + super(value, numBits); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEInvocationIdentifier.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEInvocationIdentifier.java new file mode 100644 index 0000000..7c70b74 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEInvocationIdentifier.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class AEInvocationIdentifier extends BerInteger { + + private static final long serialVersionUID = 1L; + + public AEInvocationIdentifier() { + } + + public AEInvocationIdentifier(byte[] code) { + super(code); + } + + public AEInvocationIdentifier(BigInteger value) { + super(value); + } + + public AEInvocationIdentifier(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEQualifier.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEQualifier.java new file mode 100644 index 0000000..2ff889a --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEQualifier.java @@ -0,0 +1,105 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; + +public class AEQualifier implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private AEQualifierForm2 aeQualifierForm2 = null; + + public AEQualifier() { + } + + public AEQualifier(byte[] code) { + this.code = code; + } + + public void setAeQualifierForm2(AEQualifierForm2 aeQualifierForm2) { + this.aeQualifierForm2 = aeQualifierForm2; + } + + public AEQualifierForm2 getAeQualifierForm2() { + return aeQualifierForm2; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (aeQualifierForm2 != null) { + codeLength += aeQualifierForm2.encode(os, true); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerInteger.tag)) { + aeQualifierForm2 = new AEQualifierForm2(); + codeLength += aeQualifierForm2.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (aeQualifierForm2 != null) { + sb.append("aeQualifierForm2: ").append(aeQualifierForm2); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEQualifierForm2.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEQualifierForm2.java new file mode 100644 index 0000000..6f56c3c --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AEQualifierForm2.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class AEQualifierForm2 extends BerInteger { + + private static final long serialVersionUID = 1L; + + public AEQualifierForm2() { + } + + public AEQualifierForm2(byte[] code) { + super(code); + } + + public AEQualifierForm2(BigInteger value) { + super(value); + } + + public AEQualifierForm2(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AETitle.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AETitle.java new file mode 100644 index 0000000..5ecb3b9 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AETitle.java @@ -0,0 +1,105 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class AETitle implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private AETitleForm2 aeTitleForm2 = null; + + public AETitle() { + } + + public AETitle(byte[] code) { + this.code = code; + } + + public void setAeTitleForm2(AETitleForm2 aeTitleForm2) { + this.aeTitleForm2 = aeTitleForm2; + } + + public AETitleForm2 getAeTitleForm2() { + return aeTitleForm2; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (aeTitleForm2 != null) { + codeLength += aeTitleForm2.encode(os, true); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerObjectIdentifier.tag)) { + aeTitleForm2 = new AETitleForm2(); + codeLength += aeTitleForm2.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (aeTitleForm2 != null) { + sb.append("aeTitleForm2: ").append(aeTitleForm2); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AETitleForm2.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AETitleForm2.java new file mode 100644 index 0000000..8780e4c --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AETitleForm2.java @@ -0,0 +1,24 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class AETitleForm2 extends BerObjectIdentifier { + + private static final long serialVersionUID = 1L; + + public AETitleForm2() { + } + + public AETitleForm2(byte[] code) { + super(code); + } + + public AETitleForm2(int[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APInvocationIdentifier.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APInvocationIdentifier.java new file mode 100644 index 0000000..178cded --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APInvocationIdentifier.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class APInvocationIdentifier extends BerInteger { + + private static final long serialVersionUID = 1L; + + public APInvocationIdentifier() { + } + + public APInvocationIdentifier(byte[] code) { + super(code); + } + + public APInvocationIdentifier(BigInteger value) { + super(value); + } + + public APInvocationIdentifier(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APTitle.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APTitle.java new file mode 100644 index 0000000..99ff6b4 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APTitle.java @@ -0,0 +1,105 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class APTitle implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private APTitleForm2 apTitleForm2 = null; + + public APTitle() { + } + + public APTitle(byte[] code) { + this.code = code; + } + + public void setApTitleForm2(APTitleForm2 apTitleForm2) { + this.apTitleForm2 = apTitleForm2; + } + + public APTitleForm2 getApTitleForm2() { + return apTitleForm2; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (apTitleForm2 != null) { + codeLength += apTitleForm2.encode(os, true); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerObjectIdentifier.tag)) { + apTitleForm2 = new APTitleForm2(); + codeLength += apTitleForm2.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (apTitleForm2 != null) { + sb.append("apTitleForm2: ").append(apTitleForm2); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APTitleForm2.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APTitleForm2.java new file mode 100644 index 0000000..7f68227 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/APTitleForm2.java @@ -0,0 +1,24 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class APTitleForm2 extends BerObjectIdentifier { + + private static final long serialVersionUID = 1L; + + public APTitleForm2() { + } + + public APTitleForm2(byte[] code) { + super(code); + } + + public APTitleForm2(int[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ApplicationContextName.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ApplicationContextName.java new file mode 100644 index 0000000..db865ad --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ApplicationContextName.java @@ -0,0 +1,24 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class ApplicationContextName extends BerObjectIdentifier { + + private static final long serialVersionUID = 1L; + + public ApplicationContextName() { + } + + public ApplicationContextName(byte[] code) { + super(code); + } + + public ApplicationContextName(int[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ApplicationContextNameList.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ApplicationContextNameList.java new file mode 100644 index 0000000..1de1674 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ApplicationContextNameList.java @@ -0,0 +1,144 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class ApplicationContextNameList implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public ApplicationContextNameList() { + seqOf = new ArrayList<>(); + } + + public ApplicationContextNameList(byte[] code) { + this.code = code; + } + + public List getApplicationContextName() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + ApplicationContextName element = new ApplicationContextName(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + sb.append(it.next()); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append(it.next()); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociateResult.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociateResult.java new file mode 100644 index 0000000..8857738 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociateResult.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class AssociateResult extends BerInteger { + + private static final long serialVersionUID = 1L; + + public AssociateResult() { + } + + public AssociateResult(byte[] code) { + super(code); + } + + public AssociateResult(BigInteger value) { + super(value); + } + + public AssociateResult(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociateSourceDiagnostic.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociateSourceDiagnostic.java new file mode 100644 index 0000000..22831dd --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociateSourceDiagnostic.java @@ -0,0 +1,145 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; + +public class AssociateSourceDiagnostic implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BerInteger acseServiceUser = null; + private BerInteger acseServiceProvider = null; + + public AssociateSourceDiagnostic() { + } + + public AssociateSourceDiagnostic(byte[] code) { + this.code = code; + } + + public void setAcseServiceUser(BerInteger acseServiceUser) { + this.acseServiceUser = acseServiceUser; + } + + public BerInteger getAcseServiceUser() { + return acseServiceUser; + } + + public void setAcseServiceProvider(BerInteger acseServiceProvider) { + this.acseServiceProvider = acseServiceProvider; + } + + public BerInteger getAcseServiceProvider() { + return acseServiceProvider; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (acseServiceProvider != null) { + sublength = acseServiceProvider.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + return codeLength; + } + + if (acseServiceUser != null) { + sublength = acseServiceUser.encode(os, true); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + codeLength += BerLength.skip(is); + acseServiceUser = new BerInteger(); + codeLength += acseServiceUser.decode(is, true); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + codeLength += BerLength.skip(is); + acseServiceProvider = new BerInteger(); + codeLength += acseServiceProvider.decode(is, true); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (acseServiceUser != null) { + sb.append("acseServiceUser: ").append(acseServiceUser); + return; + } + + if (acseServiceProvider != null) { + sb.append("acseServiceProvider: ").append(acseServiceProvider); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociationInformation.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociationInformation.java new file mode 100644 index 0000000..404feb8 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AssociationInformation.java @@ -0,0 +1,144 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class AssociationInformation implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public AssociationInformation() { + seqOf = new ArrayList<>(); + } + + public AssociationInformation(byte[] code) { + this.code = code; + } + + public List getMyexternal() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + Myexternal element = new Myexternal(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AuthenticationValue.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AuthenticationValue.java new file mode 100644 index 0000000..ab27d76 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/AuthenticationValue.java @@ -0,0 +1,166 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.jasn1.ber.types.string.BerGraphicString; + +public class AuthenticationValue implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BerGraphicString charstring = null; + private BerBitString bitstring = null; + private Myexternal2 external = null; + + public AuthenticationValue() { + } + + public AuthenticationValue(byte[] code) { + this.code = code; + } + + public void setCharstring(BerGraphicString charstring) { + this.charstring = charstring; + } + + public BerGraphicString getCharstring() { + return charstring; + } + + public void setBitstring(BerBitString bitstring) { + this.bitstring = bitstring; + } + + public BerBitString getBitstring() { + return bitstring; + } + + public void setExternal(Myexternal2 external) { + this.external = external; + } + + public Myexternal2 getExternal() { + return external; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (external != null) { + codeLength += external.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + return codeLength; + } + + if (bitstring != null) { + codeLength += bitstring.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + if (charstring != null) { + codeLength += charstring.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + charstring = new BerGraphicString(); + codeLength += charstring.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + bitstring = new BerBitString(); + codeLength += bitstring.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + external = new Myexternal2(); + codeLength += external.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (charstring != null) { + sb.append("charstring: ").append(charstring); + return; + } + + if (bitstring != null) { + sb.append("bitstring: ").append(bitstring); + return; + } + + if (external != null) { + sb.append("external: "); + external.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ImplementationData.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ImplementationData.java new file mode 100644 index 0000000..3b0360f --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ImplementationData.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import org.openmuc.jasn1.ber.types.string.BerGraphicString; + +public class ImplementationData extends BerGraphicString { + + private static final long serialVersionUID = 1L; + + public ImplementationData() { + } + + public ImplementationData(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/MechanismName.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/MechanismName.java new file mode 100644 index 0000000..f99be1e --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/MechanismName.java @@ -0,0 +1,24 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class MechanismName extends BerObjectIdentifier { + + private static final long serialVersionUID = 1L; + + public MechanismName() { + } + + public MechanismName(byte[] code) { + super(code); + } + + public MechanismName(int[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/Myexternal.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/Myexternal.java new file mode 100644 index 0000000..9b50c2c --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/Myexternal.java @@ -0,0 +1,355 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerAny; +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; +import org.openmuc.jasn1.ber.types.BerOctetString; + +public class Myexternal implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class Encoding implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BerAny singleASN1Type = null; + private BerOctetString octetAligned = null; + private BerBitString arbitrary = null; + + public Encoding() { + } + + public Encoding(byte[] code) { + this.code = code; + } + + public void setSingleASN1Type(BerAny singleASN1Type) { + this.singleASN1Type = singleASN1Type; + } + + public BerAny getSingleASN1Type() { + return singleASN1Type; + } + + public void setOctetAligned(BerOctetString octetAligned) { + this.octetAligned = octetAligned; + } + + public BerOctetString getOctetAligned() { + return octetAligned; + } + + public void setArbitrary(BerBitString arbitrary) { + this.arbitrary = arbitrary; + } + + public BerBitString getArbitrary() { + return arbitrary; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (arbitrary != null) { + codeLength += arbitrary.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + return codeLength; + } + + if (octetAligned != null) { + codeLength += octetAligned.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + if (singleASN1Type != null) { + sublength = singleASN1Type.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + codeLength += BerLength.skip(is); + singleASN1Type = new BerAny(); + codeLength += singleASN1Type.decode(is, null); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + octetAligned = new BerOctetString(); + codeLength += octetAligned.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + arbitrary = new BerBitString(); + codeLength += arbitrary.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (singleASN1Type != null) { + sb.append("singleASN1Type: ").append(singleASN1Type); + return; + } + + if (octetAligned != null) { + sb.append("octetAligned: ").append(octetAligned); + return; + } + + if (arbitrary != null) { + sb.append("arbitrary: ").append(arbitrary); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 8); + + public byte[] code = null; + private BerObjectIdentifier directReference = null; + private BerInteger indirectReference = null; + private Encoding encoding = null; + + public Myexternal() { + } + + public Myexternal(byte[] code) { + this.code = code; + } + + public void setDirectReference(BerObjectIdentifier directReference) { + this.directReference = directReference; + } + + public BerObjectIdentifier getDirectReference() { + return directReference; + } + + public void setIndirectReference(BerInteger indirectReference) { + this.indirectReference = indirectReference; + } + + public BerInteger getIndirectReference() { + return indirectReference; + } + + public void setEncoding(Encoding encoding) { + this.encoding = encoding; + } + + public Encoding getEncoding() { + return encoding; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += encoding.encode(os); + + if (indirectReference != null) { + codeLength += indirectReference.encode(os, true); + } + + if (directReference != null) { + codeLength += directReference.encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerObjectIdentifier.tag)) { + directReference = new BerObjectIdentifier(); + subCodeLength += directReference.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerInteger.tag)) { + indirectReference = new BerInteger(); + subCodeLength += indirectReference.decode(is, false); + subCodeLength += berTag.decode(is); + } + + encoding = new Encoding(); + subCodeLength += encoding.decode(is, berTag); + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (directReference != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("directReference: ").append(directReference); + firstSelectedElement = false; + } + + if (indirectReference != null) { + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("indirectReference: ").append(indirectReference); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (encoding != null) { + sb.append("encoding: "); + encoding.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("encoding: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/Myexternal2.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/Myexternal2.java new file mode 100644 index 0000000..7e506de --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/Myexternal2.java @@ -0,0 +1,355 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerAny; +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; +import org.openmuc.jasn1.ber.types.BerOctetString; + +public class Myexternal2 implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class Encoding implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BerAny singleASN1Type = null; + private BerOctetString octetAligned = null; + private BerBitString arbitrary = null; + + public Encoding() { + } + + public Encoding(byte[] code) { + this.code = code; + } + + public void setSingleASN1Type(BerAny singleASN1Type) { + this.singleASN1Type = singleASN1Type; + } + + public BerAny getSingleASN1Type() { + return singleASN1Type; + } + + public void setOctetAligned(BerOctetString octetAligned) { + this.octetAligned = octetAligned; + } + + public BerOctetString getOctetAligned() { + return octetAligned; + } + + public void setArbitrary(BerBitString arbitrary) { + this.arbitrary = arbitrary; + } + + public BerBitString getArbitrary() { + return arbitrary; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (arbitrary != null) { + codeLength += arbitrary.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + return codeLength; + } + + if (octetAligned != null) { + codeLength += octetAligned.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + if (singleASN1Type != null) { + sublength = singleASN1Type.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + codeLength += BerLength.skip(is); + singleASN1Type = new BerAny(); + codeLength += singleASN1Type.decode(is, null); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + octetAligned = new BerOctetString(); + codeLength += octetAligned.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + arbitrary = new BerBitString(); + codeLength += arbitrary.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (singleASN1Type != null) { + sb.append("singleASN1Type: ").append(singleASN1Type); + return; + } + + if (octetAligned != null) { + sb.append("octetAligned: ").append(octetAligned); + return; + } + + if (arbitrary != null) { + sb.append("arbitrary: ").append(arbitrary); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 8); + + public byte[] code = null; + private BerObjectIdentifier directReference = null; + private BerInteger indirectReference = null; + private Encoding encoding = null; + + public Myexternal2() { + } + + public Myexternal2(byte[] code) { + this.code = code; + } + + public void setDirectReference(BerObjectIdentifier directReference) { + this.directReference = directReference; + } + + public BerObjectIdentifier getDirectReference() { + return directReference; + } + + public void setIndirectReference(BerInteger indirectReference) { + this.indirectReference = indirectReference; + } + + public BerInteger getIndirectReference() { + return indirectReference; + } + + public void setEncoding(Encoding encoding) { + this.encoding = encoding; + } + + public Encoding getEncoding() { + return encoding; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += encoding.encode(os); + + if (indirectReference != null) { + codeLength += indirectReference.encode(os, true); + } + + if (directReference != null) { + codeLength += directReference.encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerObjectIdentifier.tag)) { + directReference = new BerObjectIdentifier(); + subCodeLength += directReference.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerInteger.tag)) { + indirectReference = new BerInteger(); + subCodeLength += indirectReference.decode(is, false); + subCodeLength += berTag.decode(is); + } + + encoding = new Encoding(); + subCodeLength += encoding.decode(is, berTag); + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (directReference != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("directReference: ").append(directReference); + firstSelectedElement = false; + } + + if (indirectReference != null) { + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("indirectReference: ").append(indirectReference); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (encoding != null) { + sb.append("encoding: "); + encoding.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("encoding: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/OidValues.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/OidValues.java new file mode 100644 index 0000000..d233ef4 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/OidValues.java @@ -0,0 +1,12 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public final class OidValues { + public static final BerObjectIdentifier aCSEId = new BerObjectIdentifier(new int[] { 2, 2, 3, 1, 1 }); + public static final BerObjectIdentifier acseAsId = new BerObjectIdentifier(new int[] { 2, 2, 1, 0, 1 }); +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/RLREApdu.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/RLREApdu.java new file mode 100644 index 0000000..c168426 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/RLREApdu.java @@ -0,0 +1,178 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class RLREApdu implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.APPLICATION_CLASS, BerTag.CONSTRUCTED, 3); + + public byte[] code = null; + private ReleaseResponseReason reason = null; + private AssociationInformation userInformation = null; + + public RLREApdu() { + } + + public RLREApdu(byte[] code) { + this.code = code; + } + + public void setReason(ReleaseResponseReason reason) { + this.reason = reason; + } + + public ReleaseResponseReason getReason() { + return reason; + } + + public void setUserInformation(AssociationInformation userInformation) { + this.userInformation = userInformation; + } + + public AssociationInformation getUserInformation() { + return userInformation; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (userInformation != null) { + codeLength += userInformation.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 30 + os.write(0xBE); + codeLength += 1; + } + + if (reason != null) { + codeLength += reason.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + if (totalLength == 0) { + return codeLength; + } + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + reason = new ReleaseResponseReason(); + subCodeLength += reason.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 30)) { + userInformation = new AssociationInformation(); + subCodeLength += userInformation.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (reason != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("reason: ").append(reason); + firstSelectedElement = false; + } + + if (userInformation != null) { + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("userInformation: "); + userInformation.appendAsString(sb, indentLevel + 1); + firstSelectedElement = false; + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/RLRQApdu.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/RLRQApdu.java new file mode 100644 index 0000000..d9c4ce8 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/RLRQApdu.java @@ -0,0 +1,178 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class RLRQApdu implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.APPLICATION_CLASS, BerTag.CONSTRUCTED, 2); + + public byte[] code = null; + private ReleaseRequestReason reason = null; + private AssociationInformation userInformation = null; + + public RLRQApdu() { + } + + public RLRQApdu(byte[] code) { + this.code = code; + } + + public void setReason(ReleaseRequestReason reason) { + this.reason = reason; + } + + public ReleaseRequestReason getReason() { + return reason; + } + + public void setUserInformation(AssociationInformation userInformation) { + this.userInformation = userInformation; + } + + public AssociationInformation getUserInformation() { + return userInformation; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (userInformation != null) { + codeLength += userInformation.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 30 + os.write(0xBE); + codeLength += 1; + } + + if (reason != null) { + codeLength += reason.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + if (totalLength == 0) { + return codeLength; + } + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + reason = new ReleaseRequestReason(); + subCodeLength += reason.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 30)) { + userInformation = new AssociationInformation(); + subCodeLength += userInformation.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (reason != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("reason: ").append(reason); + firstSelectedElement = false; + } + + if (userInformation != null) { + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("userInformation: "); + userInformation.appendAsString(sb, indentLevel + 1); + firstSelectedElement = false; + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ReleaseRequestReason.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ReleaseRequestReason.java new file mode 100644 index 0000000..9042f7c --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ReleaseRequestReason.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class ReleaseRequestReason extends BerInteger { + + private static final long serialVersionUID = 1L; + + public ReleaseRequestReason() { + } + + public ReleaseRequestReason(byte[] code) { + super(code); + } + + public ReleaseRequestReason(BigInteger value) { + super(value); + } + + public ReleaseRequestReason(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ReleaseResponseReason.java b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ReleaseResponseReason.java new file mode 100644 index 0000000..9c15b3f --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/ReleaseResponseReason.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.acse.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class ReleaseResponseReason extends BerInteger { + + private static final long serialVersionUID = 1L; + + public ReleaseResponseReason() { + } + + public ReleaseResponseReason(byte[] code) { + super(code); + } + + public ReleaseResponseReason(BigInteger value) { + super(value); + } + + public ReleaseResponseReason(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/AbstractSyntaxName.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/AbstractSyntaxName.java new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/AbstractSyntaxName.java @@ -0,0 +1,22 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class AbstractSyntaxName extends BerObjectIdentifier { + + public AbstractSyntaxName() { + } + + public AbstractSyntaxName(byte[] code) { + super(code); + } + + public AbstractSyntaxName(int[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CPAPPDU.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CPAPPDU.java new file mode 100644 index 0000000..cf54810 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CPAPPDU.java @@ -0,0 +1,416 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class CPAPPDU { + + public static class NormalModeParameters { + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private ProtocolVersion protocolVersion = null; + private RespondingPresentationSelector respondingPresentationSelector = null; + private PresentationContextDefinitionResultList presentationContextDefinitionResultList = null; + private PresentationRequirements presentationRequirements = null; + private UserSessionRequirements userSessionRequirements = null; + private UserData userData = null; + + public NormalModeParameters() { + } + + public NormalModeParameters(byte[] code) { + this.code = code; + } + + public void setProtocolVersion(ProtocolVersion protocolVersion) { + this.protocolVersion = protocolVersion; + } + + public ProtocolVersion getProtocolVersion() { + return protocolVersion; + } + + public void setRespondingPresentationSelector(RespondingPresentationSelector respondingPresentationSelector) { + this.respondingPresentationSelector = respondingPresentationSelector; + } + + public RespondingPresentationSelector getRespondingPresentationSelector() { + return respondingPresentationSelector; + } + + public void setPresentationContextDefinitionResultList( + PresentationContextDefinitionResultList presentationContextDefinitionResultList) { + this.presentationContextDefinitionResultList = presentationContextDefinitionResultList; + } + + public PresentationContextDefinitionResultList getPresentationContextDefinitionResultList() { + return presentationContextDefinitionResultList; + } + + public void setPresentationRequirements(PresentationRequirements presentationRequirements) { + this.presentationRequirements = presentationRequirements; + } + + public PresentationRequirements getPresentationRequirements() { + return presentationRequirements; + } + + public void setUserSessionRequirements(UserSessionRequirements userSessionRequirements) { + this.userSessionRequirements = userSessionRequirements; + } + + public UserSessionRequirements getUserSessionRequirements() { + return userSessionRequirements; + } + + public void setUserData(UserData userData) { + this.userData = userData; + } + + public UserData getUserData() { + return userData; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (userData != null) { + codeLength += userData.encode(os); + } + + if (userSessionRequirements != null) { + codeLength += userSessionRequirements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 9 + os.write(0x89); + codeLength += 1; + } + + if (presentationRequirements != null) { + codeLength += presentationRequirements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 8 + os.write(0x88); + codeLength += 1; + } + + if (presentationContextDefinitionResultList != null) { + codeLength += presentationContextDefinitionResultList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 5 + os.write(0xA5); + codeLength += 1; + } + + if (respondingPresentationSelector != null) { + codeLength += respondingPresentationSelector.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 3 + os.write(0x83); + codeLength += 1; + } + + if (protocolVersion != null) { + codeLength += protocolVersion.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + if (totalLength == 0) { + return codeLength; + } + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + protocolVersion = new ProtocolVersion(); + subCodeLength += protocolVersion.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) { + respondingPresentationSelector = new RespondingPresentationSelector(); + subCodeLength += respondingPresentationSelector.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) { + presentationContextDefinitionResultList = new PresentationContextDefinitionResultList(); + subCodeLength += presentationContextDefinitionResultList.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 8)) { + presentationRequirements = new PresentationRequirements(); + subCodeLength += presentationRequirements.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) { + userSessionRequirements = new UserSessionRequirements(); + subCodeLength += userSessionRequirements.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + userData = new UserData(); + int choiceDecodeLength = userData.decode(is, berTag); + subCodeLength += choiceDecodeLength; + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + boolean firstSelectedElement = true; + if (protocolVersion != null) { + sb.append("protocolVersion: ").append(protocolVersion); + firstSelectedElement = false; + } + + if (respondingPresentationSelector != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("respondingPresentationSelector: ").append(respondingPresentationSelector); + firstSelectedElement = false; + } + + if (presentationContextDefinitionResultList != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("presentationContextDefinitionResultList: ").append(presentationContextDefinitionResultList); + firstSelectedElement = false; + } + + if (presentationRequirements != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("presentationRequirements: ").append(presentationRequirements); + firstSelectedElement = false; + } + + if (userSessionRequirements != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("userSessionRequirements: ").append(userSessionRequirements); + firstSelectedElement = false; + } + + if (userData != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("userData: ").append(userData); + firstSelectedElement = false; + } + + sb.append("}"); + return sb.toString(); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17); + + public byte[] code = null; + private ModeSelector modeSelector = null; + private NormalModeParameters normalModeParameters = null; + + public CPAPPDU() { + } + + public CPAPPDU(byte[] code) { + this.code = code; + } + + public void setModeSelector(ModeSelector modeSelector) { + this.modeSelector = modeSelector; + } + + public ModeSelector getModeSelector() { + return modeSelector; + } + + public void setNormalModeParameters(NormalModeParameters normalModeParameters) { + this.normalModeParameters = normalModeParameters; + } + + public NormalModeParameters getNormalModeParameters() { + return normalModeParameters; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (normalModeParameters != null) { + codeLength += normalModeParameters.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + } + + codeLength += modeSelector.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + while (subCodeLength < totalLength) { + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + modeSelector = new ModeSelector(); + subCodeLength += modeSelector.decode(is, false); + } + else if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + normalModeParameters = new NormalModeParameters(); + subCodeLength += normalModeParameters.decode(is, false); + } + } + if (subCodeLength != totalLength) { + throw new IOException("Length of set does not match length tag, length tag: " + totalLength + + ", actual set length: " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + sb.append("modeSelector: ").append(modeSelector); + + if (normalModeParameters != null) { + sb.append(", "); + sb.append("normalModeParameters: ").append(normalModeParameters); + } + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CPType.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CPType.java new file mode 100644 index 0000000..dd43ee2 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CPType.java @@ -0,0 +1,482 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class CPType { + + public static class NormalModeParameters { + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private ProtocolVersion protocolVersion = null; + private CallingPresentationSelector callingPresentationSelector = null; + private CalledPresentationSelector calledPresentationSelector = null; + private PresentationContextDefinitionList presentationContextDefinitionList = null; + private DefaultContextName defaultContextName = null; + private PresentationRequirements presentationRequirements = null; + private UserSessionRequirements userSessionRequirements = null; + private UserData userData = null; + + public NormalModeParameters() { + } + + public NormalModeParameters(byte[] code) { + this.code = code; + } + + public void setProtocolVersion(ProtocolVersion protocolVersion) { + this.protocolVersion = protocolVersion; + } + + public ProtocolVersion getProtocolVersion() { + return protocolVersion; + } + + public void setCallingPresentationSelector(CallingPresentationSelector callingPresentationSelector) { + this.callingPresentationSelector = callingPresentationSelector; + } + + public CallingPresentationSelector getCallingPresentationSelector() { + return callingPresentationSelector; + } + + public void setCalledPresentationSelector(CalledPresentationSelector calledPresentationSelector) { + this.calledPresentationSelector = calledPresentationSelector; + } + + public CalledPresentationSelector getCalledPresentationSelector() { + return calledPresentationSelector; + } + + public void setPresentationContextDefinitionList( + PresentationContextDefinitionList presentationContextDefinitionList) { + this.presentationContextDefinitionList = presentationContextDefinitionList; + } + + public PresentationContextDefinitionList getPresentationContextDefinitionList() { + return presentationContextDefinitionList; + } + + public void setDefaultContextName(DefaultContextName defaultContextName) { + this.defaultContextName = defaultContextName; + } + + public DefaultContextName getDefaultContextName() { + return defaultContextName; + } + + public void setPresentationRequirements(PresentationRequirements presentationRequirements) { + this.presentationRequirements = presentationRequirements; + } + + public PresentationRequirements getPresentationRequirements() { + return presentationRequirements; + } + + public void setUserSessionRequirements(UserSessionRequirements userSessionRequirements) { + this.userSessionRequirements = userSessionRequirements; + } + + public UserSessionRequirements getUserSessionRequirements() { + return userSessionRequirements; + } + + public void setUserData(UserData userData) { + this.userData = userData; + } + + public UserData getUserData() { + return userData; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (userData != null) { + codeLength += userData.encode(os); + } + + if (userSessionRequirements != null) { + codeLength += userSessionRequirements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 9 + os.write(0x89); + codeLength += 1; + } + + if (presentationRequirements != null) { + codeLength += presentationRequirements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 8 + os.write(0x88); + codeLength += 1; + } + + if (defaultContextName != null) { + codeLength += defaultContextName.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 6 + os.write(0xA6); + codeLength += 1; + } + + if (presentationContextDefinitionList != null) { + codeLength += presentationContextDefinitionList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 + os.write(0xA4); + codeLength += 1; + } + + if (calledPresentationSelector != null) { + codeLength += calledPresentationSelector.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + } + + if (callingPresentationSelector != null) { + codeLength += callingPresentationSelector.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + } + + if (protocolVersion != null) { + codeLength += protocolVersion.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + if (totalLength == 0) { + return codeLength; + } + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + protocolVersion = new ProtocolVersion(); + subCodeLength += protocolVersion.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + callingPresentationSelector = new CallingPresentationSelector(); + subCodeLength += callingPresentationSelector.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + calledPresentationSelector = new CalledPresentationSelector(); + subCodeLength += calledPresentationSelector.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { + presentationContextDefinitionList = new PresentationContextDefinitionList(); + subCodeLength += presentationContextDefinitionList.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) { + defaultContextName = new DefaultContextName(); + subCodeLength += defaultContextName.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 8)) { + presentationRequirements = new PresentationRequirements(); + subCodeLength += presentationRequirements.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) { + userSessionRequirements = new UserSessionRequirements(); + subCodeLength += userSessionRequirements.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + userData = new UserData(); + int choiceDecodeLength = userData.decode(is, berTag); + subCodeLength += choiceDecodeLength; + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + boolean firstSelectedElement = true; + if (protocolVersion != null) { + sb.append("protocolVersion: ").append(protocolVersion); + firstSelectedElement = false; + } + + if (callingPresentationSelector != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("callingPresentationSelector: ").append(callingPresentationSelector); + firstSelectedElement = false; + } + + if (calledPresentationSelector != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("calledPresentationSelector: ").append(calledPresentationSelector); + firstSelectedElement = false; + } + + if (presentationContextDefinitionList != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("presentationContextDefinitionList: ").append(presentationContextDefinitionList); + firstSelectedElement = false; + } + + if (defaultContextName != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("defaultContextName: ").append(defaultContextName); + firstSelectedElement = false; + } + + if (presentationRequirements != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("presentationRequirements: ").append(presentationRequirements); + firstSelectedElement = false; + } + + if (userSessionRequirements != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("userSessionRequirements: ").append(userSessionRequirements); + firstSelectedElement = false; + } + + if (userData != null) { + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("userData: ").append(userData); + firstSelectedElement = false; + } + + sb.append("}"); + return sb.toString(); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17); + + public byte[] code = null; + private ModeSelector modeSelector = null; + private NormalModeParameters normalModeParameters = null; + + public CPType() { + } + + public CPType(byte[] code) { + this.code = code; + } + + public void setModeSelector(ModeSelector modeSelector) { + this.modeSelector = modeSelector; + } + + public ModeSelector getModeSelector() { + return modeSelector; + } + + public void setNormalModeParameters(NormalModeParameters normalModeParameters) { + this.normalModeParameters = normalModeParameters; + } + + public NormalModeParameters getNormalModeParameters() { + return normalModeParameters; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (normalModeParameters != null) { + codeLength += normalModeParameters.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + } + + codeLength += modeSelector.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + while (subCodeLength < totalLength) { + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + modeSelector = new ModeSelector(); + subCodeLength += modeSelector.decode(is, false); + } + else if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + normalModeParameters = new NormalModeParameters(); + subCodeLength += normalModeParameters.decode(is, false); + } + } + if (subCodeLength != totalLength) { + throw new IOException("Length of set does not match length tag, length tag: " + totalLength + + ", actual set length: " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + sb.append("modeSelector: ").append(modeSelector); + + if (normalModeParameters != null) { + sb.append(", "); + sb.append("normalModeParameters: ").append(normalModeParameters); + } + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CalledPresentationSelector.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CalledPresentationSelector.java new file mode 100644 index 0000000..4f95065 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CalledPresentationSelector.java @@ -0,0 +1,16 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +public class CalledPresentationSelector extends PresentationSelector { + + public CalledPresentationSelector() { + } + + public CalledPresentationSelector(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CallingPresentationSelector.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CallingPresentationSelector.java new file mode 100644 index 0000000..903ab9e --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/CallingPresentationSelector.java @@ -0,0 +1,16 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +public class CallingPresentationSelector extends PresentationSelector { + + public CallingPresentationSelector() { + } + + public CallingPresentationSelector(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ContextList.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ContextList.java new file mode 100644 index 0000000..3b9e403 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ContextList.java @@ -0,0 +1,387 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class ContextList { + + public static class SEQUENCE { + + public static class TransferSyntaxNameList { + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public TransferSyntaxNameList() { + seqOf = new ArrayList<>(); + } + + public TransferSyntaxNameList(byte[] code) { + this.code = code; + } + + public List getTransferSyntaxName() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + TransferSyntaxName element = new TransferSyntaxName(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE OF{"); + + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + sb.append(it.next()); + while (it.hasNext()) { + sb.append(", ").append(it.next()); + } + } + } + + sb.append("}"); + + return sb.toString(); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private PresentationContextIdentifier presentationContextIdentifier = null; + private AbstractSyntaxName abstractSyntaxName = null; + private TransferSyntaxNameList transferSyntaxNameList = null; + + public SEQUENCE() { + } + + public SEQUENCE(byte[] code) { + this.code = code; + } + + public void setPresentationContextIdentifier(PresentationContextIdentifier presentationContextIdentifier) { + this.presentationContextIdentifier = presentationContextIdentifier; + } + + public PresentationContextIdentifier getPresentationContextIdentifier() { + return presentationContextIdentifier; + } + + public void setAbstractSyntaxName(AbstractSyntaxName abstractSyntaxName) { + this.abstractSyntaxName = abstractSyntaxName; + } + + public AbstractSyntaxName getAbstractSyntaxName() { + return abstractSyntaxName; + } + + public void setTransferSyntaxNameList(TransferSyntaxNameList transferSyntaxNameList) { + this.transferSyntaxNameList = transferSyntaxNameList; + } + + public TransferSyntaxNameList getTransferSyntaxNameList() { + return transferSyntaxNameList; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += transferSyntaxNameList.encode(os, true); + + codeLength += abstractSyntaxName.encode(os, true); + + codeLength += presentationContextIdentifier.encode(os, true); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerInteger.tag)) { + presentationContextIdentifier = new PresentationContextIdentifier(); + subCodeLength += presentationContextIdentifier.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerObjectIdentifier.tag)) { + abstractSyntaxName = new AbstractSyntaxName(); + subCodeLength += abstractSyntaxName.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(TransferSyntaxNameList.tag)) { + transferSyntaxNameList = new TransferSyntaxNameList(); + subCodeLength += transferSyntaxNameList.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + sb.append("presentationContextIdentifier: ").append(presentationContextIdentifier); + + sb.append(", "); + sb.append("abstractSyntaxName: ").append(abstractSyntaxName); + + sb.append(", "); + sb.append("transferSyntaxNameList: ").append(transferSyntaxNameList); + + sb.append("}"); + return sb.toString(); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public ContextList() { + seqOf = new ArrayList<>(); + } + + public ContextList(byte[] code) { + this.code = code; + } + + public List getSEQUENCE() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + SEQUENCE element = new SEQUENCE(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE OF{"); + + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + sb.append(it.next()); + while (it.hasNext()) { + sb.append(", ").append(it.next()); + } + } + } + + sb.append("}"); + + return sb.toString(); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/DefaultContextName.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/DefaultContextName.java new file mode 100644 index 0000000..a27915b --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/DefaultContextName.java @@ -0,0 +1,141 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class DefaultContextName { + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private AbstractSyntaxName abstractSyntaxName = null; + private TransferSyntaxName transferSyntaxName = null; + + public DefaultContextName() { + } + + public DefaultContextName(byte[] code) { + this.code = code; + } + + public void setAbstractSyntaxName(AbstractSyntaxName abstractSyntaxName) { + this.abstractSyntaxName = abstractSyntaxName; + } + + public AbstractSyntaxName getAbstractSyntaxName() { + return abstractSyntaxName; + } + + public void setTransferSyntaxName(TransferSyntaxName transferSyntaxName) { + this.transferSyntaxName = transferSyntaxName; + } + + public TransferSyntaxName getTransferSyntaxName() { + return transferSyntaxName; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += transferSyntaxName.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + codeLength += abstractSyntaxName.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + abstractSyntaxName = new AbstractSyntaxName(); + subCodeLength += abstractSyntaxName.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + transferSyntaxName = new TransferSyntaxName(); + subCodeLength += transferSyntaxName.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + sb.append("abstractSyntaxName: ").append(abstractSyntaxName); + + sb.append(", "); + sb.append("transferSyntaxName: ").append(transferSyntaxName); + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/FullyEncodedData.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/FullyEncodedData.java new file mode 100644 index 0000000..41066eb --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/FullyEncodedData.java @@ -0,0 +1,127 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class FullyEncodedData { + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public FullyEncodedData() { + seqOf = new ArrayList<>(); + } + + public FullyEncodedData(byte[] code) { + this.code = code; + } + + public List getPDVList() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + PDVList element = new PDVList(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE OF{"); + + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + sb.append(it.next()); + while (it.hasNext()) { + sb.append(", ").append(it.next()); + } + } + } + + sb.append("}"); + + return sb.toString(); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ModeSelector.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ModeSelector.java new file mode 100644 index 0000000..8c3a2d4 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ModeSelector.java @@ -0,0 +1,118 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; + +public class ModeSelector { + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17); + + public byte[] code = null; + private BerInteger modeValue = null; + + public ModeSelector() { + } + + public ModeSelector(byte[] code) { + this.code = code; + } + + public void setModeValue(BerInteger modeValue) { + this.modeValue = modeValue; + } + + public BerInteger getModeValue() { + return modeValue; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += modeValue.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + while (subCodeLength < totalLength) { + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + modeValue = new BerInteger(); + subCodeLength += modeValue.decode(is, false); + } + } + if (subCodeLength != totalLength) { + throw new IOException("Length of set does not match length tag, length tag: " + totalLength + + ", actual set length: " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + sb.append("modeValue: ").append(modeValue); + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PDVList.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PDVList.java new file mode 100644 index 0000000..3df1402 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PDVList.java @@ -0,0 +1,310 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerAny; +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; +import org.openmuc.jasn1.ber.types.BerOctetString; + +public class PDVList { + + public static class PresentationDataValues { + + public byte[] code = null; + private BerAny singleASN1Type = null; + private BerOctetString octetAligned = null; + private BerBitString arbitrary = null; + + public PresentationDataValues() { + } + + public PresentationDataValues(byte[] code) { + this.code = code; + } + + public void setSingleASN1Type(BerAny singleASN1Type) { + this.singleASN1Type = singleASN1Type; + } + + public BerAny getSingleASN1Type() { + return singleASN1Type; + } + + public void setOctetAligned(BerOctetString octetAligned) { + this.octetAligned = octetAligned; + } + + public BerOctetString getOctetAligned() { + return octetAligned; + } + + public void setArbitrary(BerBitString arbitrary) { + this.arbitrary = arbitrary; + } + + public BerBitString getArbitrary() { + return arbitrary; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (arbitrary != null) { + codeLength += arbitrary.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + return codeLength; + } + + if (octetAligned != null) { + codeLength += octetAligned.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + if (singleASN1Type != null) { + sublength = singleASN1Type.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + codeLength += BerLength.skip(is); + singleASN1Type = new BerAny(); + codeLength += singleASN1Type.decode(is, null); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + octetAligned = new BerOctetString(); + codeLength += octetAligned.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + arbitrary = new BerBitString(); + codeLength += arbitrary.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + if (singleASN1Type != null) { + return "CHOICE{singleASN1Type: " + singleASN1Type + "}"; + } + + if (octetAligned != null) { + return "CHOICE{octetAligned: " + octetAligned + "}"; + } + + if (arbitrary != null) { + return "CHOICE{arbitrary: " + arbitrary + "}"; + } + + return "unknown"; + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private TransferSyntaxName transferSyntaxName = null; + private PresentationContextIdentifier presentationContextIdentifier = null; + private PresentationDataValues presentationDataValues = null; + + public PDVList() { + } + + public PDVList(byte[] code) { + this.code = code; + } + + public void setTransferSyntaxName(TransferSyntaxName transferSyntaxName) { + this.transferSyntaxName = transferSyntaxName; + } + + public TransferSyntaxName getTransferSyntaxName() { + return transferSyntaxName; + } + + public void setPresentationContextIdentifier(PresentationContextIdentifier presentationContextIdentifier) { + this.presentationContextIdentifier = presentationContextIdentifier; + } + + public PresentationContextIdentifier getPresentationContextIdentifier() { + return presentationContextIdentifier; + } + + public void setPresentationDataValues(PresentationDataValues presentationDataValues) { + this.presentationDataValues = presentationDataValues; + } + + public PresentationDataValues getPresentationDataValues() { + return presentationDataValues; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += presentationDataValues.encode(os); + + codeLength += presentationContextIdentifier.encode(os, true); + + if (transferSyntaxName != null) { + codeLength += transferSyntaxName.encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerObjectIdentifier.tag)) { + transferSyntaxName = new TransferSyntaxName(); + subCodeLength += transferSyntaxName.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerInteger.tag)) { + presentationContextIdentifier = new PresentationContextIdentifier(); + subCodeLength += presentationContextIdentifier.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + presentationDataValues = new PresentationDataValues(); + subCodeLength += presentationDataValues.decode(is, berTag); + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + boolean firstSelectedElement = true; + if (transferSyntaxName != null) { + sb.append("transferSyntaxName: ").append(transferSyntaxName); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(", "); + } + sb.append("presentationContextIdentifier: ").append(presentationContextIdentifier); + + sb.append(", "); + sb.append("presentationDataValues: ").append(presentationDataValues); + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextDefinitionList.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextDefinitionList.java new file mode 100644 index 0000000..b692f3a --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextDefinitionList.java @@ -0,0 +1,16 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +public class PresentationContextDefinitionList extends ContextList { + + public PresentationContextDefinitionList() { + } + + public PresentationContextDefinitionList(byte[] code) { + super(code); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextDefinitionResultList.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextDefinitionResultList.java new file mode 100644 index 0000000..7c6868c --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextDefinitionResultList.java @@ -0,0 +1,16 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +public class PresentationContextDefinitionResultList extends ResultList { + + public PresentationContextDefinitionResultList() { + } + + public PresentationContextDefinitionResultList(byte[] code) { + super(code); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextIdentifier.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextIdentifier.java new file mode 100644 index 0000000..1163a90 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationContextIdentifier.java @@ -0,0 +1,28 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class PresentationContextIdentifier extends BerInteger { + + public PresentationContextIdentifier() { + } + + public PresentationContextIdentifier(byte[] code) { + super(code); + } + + public PresentationContextIdentifier(BigInteger value) { + super(value); + } + + public PresentationContextIdentifier(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationRequirements.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationRequirements.java new file mode 100644 index 0000000..c503d62 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationRequirements.java @@ -0,0 +1,22 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import org.openmuc.jasn1.ber.types.BerBitString; + +public class PresentationRequirements extends BerBitString { + + public PresentationRequirements() { + } + + public PresentationRequirements(byte[] code) { + super(code); + } + + public PresentationRequirements(byte[] value, int numBits) { + super(value, numBits); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationSelector.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationSelector.java new file mode 100644 index 0000000..e3919de --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/PresentationSelector.java @@ -0,0 +1,18 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import org.openmuc.jasn1.ber.types.BerOctetString; + +public class PresentationSelector extends BerOctetString { + + public PresentationSelector() { + } + + public PresentationSelector(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ProtocolVersion.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ProtocolVersion.java new file mode 100644 index 0000000..225e66b --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ProtocolVersion.java @@ -0,0 +1,22 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import org.openmuc.jasn1.ber.types.BerBitString; + +public class ProtocolVersion extends BerBitString { + + public ProtocolVersion() { + } + + public ProtocolVersion(byte[] code) { + super(code); + } + + public ProtocolVersion(byte[] value, int numBits) { + super(value, numBits); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/RespondingPresentationSelector.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/RespondingPresentationSelector.java new file mode 100644 index 0000000..57ca615 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/RespondingPresentationSelector.java @@ -0,0 +1,16 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +public class RespondingPresentationSelector extends PresentationSelector { + + public RespondingPresentationSelector() { + } + + public RespondingPresentationSelector(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/Result.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/Result.java new file mode 100644 index 0000000..7fa57c0 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/Result.java @@ -0,0 +1,28 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class Result extends BerInteger { + + public Result() { + } + + public Result(byte[] code) { + super(code); + } + + public Result(BigInteger value) { + super(value); + } + + public Result(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ResultList.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ResultList.java new file mode 100644 index 0000000..4ccdbfd --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/ResultList.java @@ -0,0 +1,294 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; + +public class ResultList { + + public static class SEQUENCE { + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Result result = null; + private TransferSyntaxName transferSyntaxName = null; + private BerInteger providerReason = null; + + public SEQUENCE() { + } + + public SEQUENCE(byte[] code) { + this.code = code; + } + + public void setResult(Result result) { + this.result = result; + } + + public Result getResult() { + return result; + } + + public void setTransferSyntaxName(TransferSyntaxName transferSyntaxName) { + this.transferSyntaxName = transferSyntaxName; + } + + public TransferSyntaxName getTransferSyntaxName() { + return transferSyntaxName; + } + + public void setProviderReason(BerInteger providerReason) { + this.providerReason = providerReason; + } + + public BerInteger getProviderReason() { + return providerReason; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (providerReason != null) { + codeLength += providerReason.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + } + + if (transferSyntaxName != null) { + codeLength += transferSyntaxName.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + } + + codeLength += result.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + result = new Result(); + subCodeLength += result.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + transferSyntaxName = new TransferSyntaxName(); + subCodeLength += transferSyntaxName.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + providerReason = new BerInteger(); + subCodeLength += providerReason.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE{"); + sb.append("result: ").append(result); + + if (transferSyntaxName != null) { + sb.append(", "); + sb.append("transferSyntaxName: ").append(transferSyntaxName); + } + + if (providerReason != null) { + sb.append(", "); + sb.append("providerReason: ").append(providerReason); + } + + sb.append("}"); + return sb.toString(); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public ResultList() { + seqOf = new ArrayList<>(); + } + + public ResultList(byte[] code) { + this.code = code; + } + + public List getSEQUENCE() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + SEQUENCE element = new SEQUENCE(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SEQUENCE OF{"); + + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + sb.append(it.next()); + while (it.hasNext()) { + sb.append(", ").append(it.next()); + } + } + } + + sb.append("}"); + + return sb.toString(); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/SimplyEncodedData.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/SimplyEncodedData.java new file mode 100644 index 0000000..ec431df --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/SimplyEncodedData.java @@ -0,0 +1,18 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import org.openmuc.jasn1.ber.types.BerOctetString; + +public class SimplyEncodedData extends BerOctetString { + + public SimplyEncodedData() { + } + + public SimplyEncodedData(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/TransferSyntaxName.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/TransferSyntaxName.java new file mode 100644 index 0000000..f8432c1 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/TransferSyntaxName.java @@ -0,0 +1,22 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; + +public class TransferSyntaxName extends BerObjectIdentifier { + + public TransferSyntaxName() { + } + + public TransferSyntaxName(byte[] code) { + super(code); + } + + public TransferSyntaxName(int[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/UserData.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/UserData.java new file mode 100644 index 0000000..7f04b63 --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/UserData.java @@ -0,0 +1,123 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import java.io.IOException; +import java.io.InputStream; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; + +public class UserData { + + public byte[] code = null; + private SimplyEncodedData simplyEncodedData = null; + private FullyEncodedData fullyEncodedData = null; + + public UserData() { + } + + public UserData(byte[] code) { + this.code = code; + } + + public void setSimplyEncodedData(SimplyEncodedData simplyEncodedData) { + this.simplyEncodedData = simplyEncodedData; + } + + public SimplyEncodedData getSimplyEncodedData() { + return simplyEncodedData; + } + + public void setFullyEncodedData(FullyEncodedData fullyEncodedData) { + this.fullyEncodedData = fullyEncodedData; + } + + public FullyEncodedData getFullyEncodedData() { + return fullyEncodedData; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (fullyEncodedData != null) { + codeLength += fullyEncodedData.encode(os, false); + // write tag: APPLICATION_CLASS, CONSTRUCTED, 1 + os.write(0x61); + codeLength += 1; + return codeLength; + } + + if (simplyEncodedData != null) { + codeLength += simplyEncodedData.encode(os, false); + // write tag: APPLICATION_CLASS, PRIMITIVE, 0 + os.write(0x40); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.APPLICATION_CLASS, BerTag.PRIMITIVE, 0)) { + simplyEncodedData = new SimplyEncodedData(); + codeLength += simplyEncodedData.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.APPLICATION_CLASS, BerTag.CONSTRUCTED, 1)) { + fullyEncodedData = new FullyEncodedData(); + codeLength += fullyEncodedData.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + if (simplyEncodedData != null) { + return "CHOICE{simplyEncodedData: " + simplyEncodedData + "}"; + } + + if (fullyEncodedData != null) { + return "CHOICE{fullyEncodedData: " + fullyEncodedData + "}"; + } + + return "unknown"; + } + +} diff --git a/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/UserSessionRequirements.java b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/UserSessionRequirements.java new file mode 100644 index 0000000..2cdeeae --- /dev/null +++ b/src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/UserSessionRequirements.java @@ -0,0 +1,22 @@ +/** + * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org) + */ + +package org.openmuc.josistack.internal.presentation.asn1; + +import org.openmuc.jasn1.ber.types.BerBitString; + +public class UserSessionRequirements extends BerBitString { + + public UserSessionRequirements() { + } + + public UserSessionRequirements(byte[] code) { + super(code); + } + + public UserSessionRequirements(byte[] value, int numBits) { + super(value, numBits); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AccessResult.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AccessResult.java new file mode 100644 index 0000000..6224f78 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AccessResult.java @@ -0,0 +1,136 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; + +public class AccessResult implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private DataAccessError failure = null; + private Data success = null; + + public AccessResult() { + } + + public AccessResult(byte[] code) { + this.code = code; + } + + public void setFailure(DataAccessError failure) { + this.failure = failure; + } + + public DataAccessError getFailure() { + return failure; + } + + public void setSuccess(Data success) { + this.success = success; + } + + public Data getSuccess() { + return success; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (success != null) { + codeLength += success.encode(os); + return codeLength; + } + + if (failure != null) { + codeLength += failure.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + failure = new DataAccessError(); + codeLength += failure.decode(is, false); + return codeLength; + } + + success = new Data(); + int choiceDecodeLength = success.decode(is, berTag); + if (choiceDecodeLength != 0) { + return codeLength + choiceDecodeLength; + } + else { + success = null; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (failure != null) { + sb.append("failure: ").append(failure); + return; + } + + if (success != null) { + sb.append("success: "); + success.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AlternateAccess.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AlternateAccess.java new file mode 100644 index 0000000..4879b16 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AlternateAccess.java @@ -0,0 +1,240 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class AlternateAccess implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class CHOICE implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private AlternateAccessSelection unnamed = null; + + public CHOICE() { + } + + public CHOICE(byte[] code) { + this.code = code; + } + + public void setUnnamed(AlternateAccessSelection unnamed) { + this.unnamed = unnamed; + } + + public AlternateAccessSelection getUnnamed() { + return unnamed; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (unnamed != null) { + codeLength += unnamed.encode(os); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + unnamed = new AlternateAccessSelection(); + int choiceDecodeLength = unnamed.decode(is, berTag); + if (choiceDecodeLength != 0) { + return codeLength + choiceDecodeLength; + } + else { + unnamed = null; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (unnamed != null) { + sb.append("unnamed: "); + unnamed.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public AlternateAccess() { + seqOf = new ArrayList<>(); + } + + public AlternateAccess(byte[] code) { + this.code = code; + } + + public List getCHOICE() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + CHOICE element = new CHOICE(); + subCodeLength += element.decode(is, null); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AlternateAccessSelection.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AlternateAccessSelection.java new file mode 100644 index 0000000..3245a23 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/AlternateAccessSelection.java @@ -0,0 +1,1164 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerNull; +import org.openmuc.jasn1.ber.types.string.BerVisibleString; + +public class AlternateAccessSelection implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + + public static class SelectAlternateAccess implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class AccessSelection implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + + public static class Component implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BasicIdentifier basic = null; + + public Component() { + } + + public Component(byte[] code) { + this.code = code; + } + + public void setBasic(BasicIdentifier basic) { + this.basic = basic; + } + + public BasicIdentifier getBasic() { + return basic; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (basic != null) { + codeLength += basic.encode(os, true); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerVisibleString.tag)) { + basic = new BasicIdentifier(); + codeLength += basic.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (basic != null) { + sb.append("basic: ").append(basic); + return; + } + + sb.append(""); + } + + } + + public static class IndexRange implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Unsigned32 lowIndex = null; + private Unsigned32 numberOfElements = null; + + public IndexRange() { + } + + public IndexRange(byte[] code) { + this.code = code; + } + + public void setLowIndex(Unsigned32 lowIndex) { + this.lowIndex = lowIndex; + } + + public Unsigned32 getLowIndex() { + return lowIndex; + } + + public void setNumberOfElements(Unsigned32 numberOfElements) { + this.numberOfElements = numberOfElements; + } + + public Unsigned32 getNumberOfElements() { + return numberOfElements; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += numberOfElements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + codeLength += lowIndex.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + lowIndex = new Unsigned32(); + subCodeLength += lowIndex.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + numberOfElements = new Unsigned32(); + subCodeLength += numberOfElements.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (lowIndex != null) { + sb.append("lowIndex: ").append(lowIndex); + } + else { + sb.append("lowIndex: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (numberOfElements != null) { + sb.append("numberOfElements: ").append(numberOfElements); + } + else { + sb.append("numberOfElements: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + private Component component = null; + private Unsigned32 index = null; + private IndexRange indexRange = null; + private BerNull allElements = null; + + public AccessSelection() { + } + + public AccessSelection(byte[] code) { + this.code = code; + } + + public void setComponent(Component component) { + this.component = component; + } + + public Component getComponent() { + return component; + } + + public void setIndex(Unsigned32 index) { + this.index = index; + } + + public Unsigned32 getIndex() { + return index; + } + + public void setIndexRange(IndexRange indexRange) { + this.indexRange = indexRange; + } + + public IndexRange getIndexRange() { + return indexRange; + } + + public void setAllElements(BerNull allElements) { + this.allElements = allElements; + } + + public BerNull getAllElements() { + return allElements; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (allElements != null) { + codeLength += allElements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 3 + os.write(0x83); + codeLength += 1; + return codeLength; + } + + if (indexRange != null) { + codeLength += indexRange.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + return codeLength; + } + + if (index != null) { + codeLength += index.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + if (component != null) { + sublength = component.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + codeLength += BerLength.skip(is); + component = new Component(); + codeLength += component.decode(is, null); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + index = new Unsigned32(); + codeLength += index.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + indexRange = new IndexRange(); + codeLength += indexRange.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) { + allElements = new BerNull(); + codeLength += allElements.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (component != null) { + sb.append("component: "); + component.appendAsString(sb, indentLevel + 1); + return; + } + + if (index != null) { + sb.append("index: ").append(index); + return; + } + + if (indexRange != null) { + sb.append("indexRange: "); + indexRange.appendAsString(sb, indentLevel + 1); + return; + } + + if (allElements != null) { + sb.append("allElements: ").append(allElements); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private AccessSelection accessSelection = null; + private AlternateAccess alternateAccess = null; + + public SelectAlternateAccess() { + } + + public SelectAlternateAccess(byte[] code) { + this.code = code; + } + + public void setAccessSelection(AccessSelection accessSelection) { + this.accessSelection = accessSelection; + } + + public AccessSelection getAccessSelection() { + return accessSelection; + } + + public void setAlternateAccess(AlternateAccess alternateAccess) { + this.alternateAccess = alternateAccess; + } + + public AlternateAccess getAlternateAccess() { + return alternateAccess; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += alternateAccess.encode(os, true); + + codeLength += accessSelection.encode(os); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + accessSelection = new AccessSelection(); + subCodeLength += accessSelection.decode(is, berTag); + subCodeLength += berTag.decode(is); + + if (berTag.equals(AlternateAccess.tag)) { + alternateAccess = new AlternateAccess(); + subCodeLength += alternateAccess.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (accessSelection != null) { + sb.append("accessSelection: "); + accessSelection.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("accessSelection: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (alternateAccess != null) { + sb.append("alternateAccess: "); + alternateAccess.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("alternateAccess: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static class SelectAccess implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + + public static class Component implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BasicIdentifier basic = null; + + public Component() { + } + + public Component(byte[] code) { + this.code = code; + } + + public void setBasic(BasicIdentifier basic) { + this.basic = basic; + } + + public BasicIdentifier getBasic() { + return basic; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (basic != null) { + codeLength += basic.encode(os, true); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerVisibleString.tag)) { + basic = new BasicIdentifier(); + codeLength += basic.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (basic != null) { + sb.append("basic: ").append(basic); + return; + } + + sb.append(""); + } + + } + + public static class IndexRange implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Unsigned32 lowIndex = null; + private Unsigned32 numberOfElements = null; + + public IndexRange() { + } + + public IndexRange(byte[] code) { + this.code = code; + } + + public void setLowIndex(Unsigned32 lowIndex) { + this.lowIndex = lowIndex; + } + + public Unsigned32 getLowIndex() { + return lowIndex; + } + + public void setNumberOfElements(Unsigned32 numberOfElements) { + this.numberOfElements = numberOfElements; + } + + public Unsigned32 getNumberOfElements() { + return numberOfElements; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += numberOfElements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + codeLength += lowIndex.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + lowIndex = new Unsigned32(); + subCodeLength += lowIndex.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + numberOfElements = new Unsigned32(); + subCodeLength += numberOfElements.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (lowIndex != null) { + sb.append("lowIndex: ").append(lowIndex); + } + else { + sb.append("lowIndex: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (numberOfElements != null) { + sb.append("numberOfElements: ").append(numberOfElements); + } + else { + sb.append("numberOfElements: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + private Component component = null; + private Unsigned32 index = null; + private IndexRange indexRange = null; + private BerNull allElements = null; + + public SelectAccess() { + } + + public SelectAccess(byte[] code) { + this.code = code; + } + + public void setComponent(Component component) { + this.component = component; + } + + public Component getComponent() { + return component; + } + + public void setIndex(Unsigned32 index) { + this.index = index; + } + + public Unsigned32 getIndex() { + return index; + } + + public void setIndexRange(IndexRange indexRange) { + this.indexRange = indexRange; + } + + public IndexRange getIndexRange() { + return indexRange; + } + + public void setAllElements(BerNull allElements) { + this.allElements = allElements; + } + + public BerNull getAllElements() { + return allElements; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (allElements != null) { + codeLength += allElements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 4 + os.write(0x84); + codeLength += 1; + return codeLength; + } + + if (indexRange != null) { + codeLength += indexRange.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 3 + os.write(0xA3); + codeLength += 1; + return codeLength; + } + + if (index != null) { + codeLength += index.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + return codeLength; + } + + if (component != null) { + sublength = component.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + codeLength += BerLength.skip(is); + component = new Component(); + codeLength += component.decode(is, null); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + index = new Unsigned32(); + codeLength += index.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) { + indexRange = new IndexRange(); + codeLength += indexRange.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) { + allElements = new BerNull(); + codeLength += allElements.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (component != null) { + sb.append("component: "); + component.appendAsString(sb, indentLevel + 1); + return; + } + + if (index != null) { + sb.append("index: ").append(index); + return; + } + + if (indexRange != null) { + sb.append("indexRange: "); + indexRange.appendAsString(sb, indentLevel + 1); + return; + } + + if (allElements != null) { + sb.append("allElements: ").append(allElements); + return; + } + + sb.append(""); + } + + } + + private SelectAlternateAccess selectAlternateAccess = null; + private SelectAccess selectAccess = null; + + public AlternateAccessSelection() { + } + + public AlternateAccessSelection(byte[] code) { + this.code = code; + } + + public void setSelectAlternateAccess(SelectAlternateAccess selectAlternateAccess) { + this.selectAlternateAccess = selectAlternateAccess; + } + + public SelectAlternateAccess getSelectAlternateAccess() { + return selectAlternateAccess; + } + + public void setSelectAccess(SelectAccess selectAccess) { + this.selectAccess = selectAccess; + } + + public SelectAccess getSelectAccess() { + return selectAccess; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (selectAccess != null) { + codeLength += selectAccess.encode(os); + return codeLength; + } + + if (selectAlternateAccess != null) { + codeLength += selectAlternateAccess.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + selectAlternateAccess = new SelectAlternateAccess(); + codeLength += selectAlternateAccess.decode(is, false); + return codeLength; + } + + selectAccess = new SelectAccess(); + int choiceDecodeLength = selectAccess.decode(is, berTag); + if (choiceDecodeLength != 0) { + return codeLength + choiceDecodeLength; + } + else { + selectAccess = null; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (selectAlternateAccess != null) { + sb.append("selectAlternateAccess: "); + selectAlternateAccess.appendAsString(sb, indentLevel + 1); + return; + } + + if (selectAccess != null) { + sb.append("selectAccess: "); + selectAccess.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/BasicIdentifier.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/BasicIdentifier.java new file mode 100644 index 0000000..58c18b6 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/BasicIdentifier.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.string.BerVisibleString; + +public class BasicIdentifier extends BerVisibleString { + + private static final long serialVersionUID = 1L; + + public BasicIdentifier() { + } + + public BasicIdentifier(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConcludeRequestPDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConcludeRequestPDU.java new file mode 100644 index 0000000..b83e232 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConcludeRequestPDU.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.BerNull; + +public class ConcludeRequestPDU extends BerNull { + + private static final long serialVersionUID = 1L; + + public ConcludeRequestPDU() { + } + + public ConcludeRequestPDU(byte[] code) { + super(code); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedErrorPDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedErrorPDU.java new file mode 100644 index 0000000..866049a --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedErrorPDU.java @@ -0,0 +1,202 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class ConfirmedErrorPDU implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Unsigned32 invokeID = null; + private Unsigned32 modifierPosition = null; + private ServiceError serviceError = null; + + public ConfirmedErrorPDU() { + } + + public ConfirmedErrorPDU(byte[] code) { + this.code = code; + } + + public void setInvokeID(Unsigned32 invokeID) { + this.invokeID = invokeID; + } + + public Unsigned32 getInvokeID() { + return invokeID; + } + + public void setModifierPosition(Unsigned32 modifierPosition) { + this.modifierPosition = modifierPosition; + } + + public Unsigned32 getModifierPosition() { + return modifierPosition; + } + + public void setServiceError(ServiceError serviceError) { + this.serviceError = serviceError; + } + + public ServiceError getServiceError() { + return serviceError; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += serviceError.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + + if (modifierPosition != null) { + codeLength += modifierPosition.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + } + + codeLength += invokeID.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + invokeID = new Unsigned32(); + subCodeLength += invokeID.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + modifierPosition = new Unsigned32(); + subCodeLength += modifierPosition.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + serviceError = new ServiceError(); + subCodeLength += serviceError.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (invokeID != null) { + sb.append("invokeID: ").append(invokeID); + } + else { + sb.append("invokeID: "); + } + + if (modifierPosition != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("modifierPosition: ").append(modifierPosition); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (serviceError != null) { + sb.append("serviceError: "); + serviceError.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("serviceError: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedRequestPDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedRequestPDU.java new file mode 100644 index 0000000..8013580 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedRequestPDU.java @@ -0,0 +1,165 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; + +public class ConfirmedRequestPDU implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Unsigned32 invokeID = null; + private ConfirmedServiceRequest service = null; + + public ConfirmedRequestPDU() { + } + + public ConfirmedRequestPDU(byte[] code) { + this.code = code; + } + + public void setInvokeID(Unsigned32 invokeID) { + this.invokeID = invokeID; + } + + public Unsigned32 getInvokeID() { + return invokeID; + } + + public void setService(ConfirmedServiceRequest service) { + this.service = service; + } + + public ConfirmedServiceRequest getService() { + return service; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += service.encode(os); + + codeLength += invokeID.encode(os, true); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerInteger.tag)) { + invokeID = new Unsigned32(); + subCodeLength += invokeID.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + service = new ConfirmedServiceRequest(); + subCodeLength += service.decode(is, berTag); + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (invokeID != null) { + sb.append("invokeID: ").append(invokeID); + } + else { + sb.append("invokeID: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (service != null) { + sb.append("service: "); + service.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("service: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedResponsePDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedResponsePDU.java new file mode 100644 index 0000000..1debf2d --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedResponsePDU.java @@ -0,0 +1,165 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; + +public class ConfirmedResponsePDU implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Unsigned32 invokeID = null; + private ConfirmedServiceResponse service = null; + + public ConfirmedResponsePDU() { + } + + public ConfirmedResponsePDU(byte[] code) { + this.code = code; + } + + public void setInvokeID(Unsigned32 invokeID) { + this.invokeID = invokeID; + } + + public Unsigned32 getInvokeID() { + return invokeID; + } + + public void setService(ConfirmedServiceResponse service) { + this.service = service; + } + + public ConfirmedServiceResponse getService() { + return service; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += service.encode(os); + + codeLength += invokeID.encode(os, true); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerInteger.tag)) { + invokeID = new Unsigned32(); + subCodeLength += invokeID.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + service = new ConfirmedServiceResponse(); + subCodeLength += service.decode(is, berTag); + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (invokeID != null) { + sb.append("invokeID: ").append(invokeID); + } + else { + sb.append("invokeID: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (service != null) { + sb.append("service: "); + service.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("service: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedServiceRequest.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedServiceRequest.java new file mode 100644 index 0000000..8c0d7b7 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedServiceRequest.java @@ -0,0 +1,292 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class ConfirmedServiceRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private GetNameListRequest getNameList = null; + private ReadRequest read = null; + private WriteRequest write = null; + private GetVariableAccessAttributesRequest getVariableAccessAttributes = null; + private DefineNamedVariableListRequest defineNamedVariableList = null; + private GetNamedVariableListAttributesRequest getNamedVariableListAttributes = null; + private DeleteNamedVariableListRequest deleteNamedVariableList = null; + + public ConfirmedServiceRequest() { + } + + public ConfirmedServiceRequest(byte[] code) { + this.code = code; + } + + public void setGetNameList(GetNameListRequest getNameList) { + this.getNameList = getNameList; + } + + public GetNameListRequest getGetNameList() { + return getNameList; + } + + public void setRead(ReadRequest read) { + this.read = read; + } + + public ReadRequest getRead() { + return read; + } + + public void setWrite(WriteRequest write) { + this.write = write; + } + + public WriteRequest getWrite() { + return write; + } + + public void setGetVariableAccessAttributes(GetVariableAccessAttributesRequest getVariableAccessAttributes) { + this.getVariableAccessAttributes = getVariableAccessAttributes; + } + + public GetVariableAccessAttributesRequest getGetVariableAccessAttributes() { + return getVariableAccessAttributes; + } + + public void setDefineNamedVariableList(DefineNamedVariableListRequest defineNamedVariableList) { + this.defineNamedVariableList = defineNamedVariableList; + } + + public DefineNamedVariableListRequest getDefineNamedVariableList() { + return defineNamedVariableList; + } + + public void setGetNamedVariableListAttributes( + GetNamedVariableListAttributesRequest getNamedVariableListAttributes) { + this.getNamedVariableListAttributes = getNamedVariableListAttributes; + } + + public GetNamedVariableListAttributesRequest getGetNamedVariableListAttributes() { + return getNamedVariableListAttributes; + } + + public void setDeleteNamedVariableList(DeleteNamedVariableListRequest deleteNamedVariableList) { + this.deleteNamedVariableList = deleteNamedVariableList; + } + + public DeleteNamedVariableListRequest getDeleteNamedVariableList() { + return deleteNamedVariableList; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (deleteNamedVariableList != null) { + codeLength += deleteNamedVariableList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 13 + os.write(0xAD); + codeLength += 1; + return codeLength; + } + + if (getNamedVariableListAttributes != null) { + sublength = getNamedVariableListAttributes.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 12 + os.write(0xAC); + codeLength += 1; + return codeLength; + } + + if (defineNamedVariableList != null) { + codeLength += defineNamedVariableList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 11 + os.write(0xAB); + codeLength += 1; + return codeLength; + } + + if (getVariableAccessAttributes != null) { + sublength = getVariableAccessAttributes.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 6 + os.write(0xA6); + codeLength += 1; + return codeLength; + } + + if (write != null) { + codeLength += write.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 5 + os.write(0xA5); + codeLength += 1; + return codeLength; + } + + if (read != null) { + codeLength += read.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 + os.write(0xA4); + codeLength += 1; + return codeLength; + } + + if (getNameList != null) { + codeLength += getNameList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + getNameList = new GetNameListRequest(); + codeLength += getNameList.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { + read = new ReadRequest(); + codeLength += read.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) { + write = new WriteRequest(); + codeLength += write.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) { + codeLength += BerLength.skip(is); + getVariableAccessAttributes = new GetVariableAccessAttributesRequest(); + codeLength += getVariableAccessAttributes.decode(is, null); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 11)) { + defineNamedVariableList = new DefineNamedVariableListRequest(); + codeLength += defineNamedVariableList.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) { + codeLength += BerLength.skip(is); + getNamedVariableListAttributes = new GetNamedVariableListAttributesRequest(); + codeLength += getNamedVariableListAttributes.decode(is, null); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) { + deleteNamedVariableList = new DeleteNamedVariableListRequest(); + codeLength += deleteNamedVariableList.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (getNameList != null) { + sb.append("getNameList: "); + getNameList.appendAsString(sb, indentLevel + 1); + return; + } + + if (read != null) { + sb.append("read: "); + read.appendAsString(sb, indentLevel + 1); + return; + } + + if (write != null) { + sb.append("write: "); + write.appendAsString(sb, indentLevel + 1); + return; + } + + if (getVariableAccessAttributes != null) { + sb.append("getVariableAccessAttributes: "); + getVariableAccessAttributes.appendAsString(sb, indentLevel + 1); + return; + } + + if (defineNamedVariableList != null) { + sb.append("defineNamedVariableList: "); + defineNamedVariableList.appendAsString(sb, indentLevel + 1); + return; + } + + if (getNamedVariableListAttributes != null) { + sb.append("getNamedVariableListAttributes: "); + getNamedVariableListAttributes.appendAsString(sb, indentLevel + 1); + return; + } + + if (deleteNamedVariableList != null) { + sb.append("deleteNamedVariableList: "); + deleteNamedVariableList.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedServiceResponse.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedServiceResponse.java new file mode 100644 index 0000000..539ba01 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ConfirmedServiceResponse.java @@ -0,0 +1,282 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; + +public class ConfirmedServiceResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private GetNameListResponse getNameList = null; + private ReadResponse read = null; + private WriteResponse write = null; + private GetVariableAccessAttributesResponse getVariableAccessAttributes = null; + private DefineNamedVariableListResponse defineNamedVariableList = null; + private GetNamedVariableListAttributesResponse getNamedVariableListAttributes = null; + private DeleteNamedVariableListResponse deleteNamedVariableList = null; + + public ConfirmedServiceResponse() { + } + + public ConfirmedServiceResponse(byte[] code) { + this.code = code; + } + + public void setGetNameList(GetNameListResponse getNameList) { + this.getNameList = getNameList; + } + + public GetNameListResponse getGetNameList() { + return getNameList; + } + + public void setRead(ReadResponse read) { + this.read = read; + } + + public ReadResponse getRead() { + return read; + } + + public void setWrite(WriteResponse write) { + this.write = write; + } + + public WriteResponse getWrite() { + return write; + } + + public void setGetVariableAccessAttributes(GetVariableAccessAttributesResponse getVariableAccessAttributes) { + this.getVariableAccessAttributes = getVariableAccessAttributes; + } + + public GetVariableAccessAttributesResponse getGetVariableAccessAttributes() { + return getVariableAccessAttributes; + } + + public void setDefineNamedVariableList(DefineNamedVariableListResponse defineNamedVariableList) { + this.defineNamedVariableList = defineNamedVariableList; + } + + public DefineNamedVariableListResponse getDefineNamedVariableList() { + return defineNamedVariableList; + } + + public void setGetNamedVariableListAttributes( + GetNamedVariableListAttributesResponse getNamedVariableListAttributes) { + this.getNamedVariableListAttributes = getNamedVariableListAttributes; + } + + public GetNamedVariableListAttributesResponse getGetNamedVariableListAttributes() { + return getNamedVariableListAttributes; + } + + public void setDeleteNamedVariableList(DeleteNamedVariableListResponse deleteNamedVariableList) { + this.deleteNamedVariableList = deleteNamedVariableList; + } + + public DeleteNamedVariableListResponse getDeleteNamedVariableList() { + return deleteNamedVariableList; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (deleteNamedVariableList != null) { + codeLength += deleteNamedVariableList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 13 + os.write(0xAD); + codeLength += 1; + return codeLength; + } + + if (getNamedVariableListAttributes != null) { + codeLength += getNamedVariableListAttributes.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 12 + os.write(0xAC); + codeLength += 1; + return codeLength; + } + + if (defineNamedVariableList != null) { + codeLength += defineNamedVariableList.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 11 + os.write(0x8B); + codeLength += 1; + return codeLength; + } + + if (getVariableAccessAttributes != null) { + codeLength += getVariableAccessAttributes.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 6 + os.write(0xA6); + codeLength += 1; + return codeLength; + } + + if (write != null) { + codeLength += write.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 5 + os.write(0xA5); + codeLength += 1; + return codeLength; + } + + if (read != null) { + codeLength += read.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 + os.write(0xA4); + codeLength += 1; + return codeLength; + } + + if (getNameList != null) { + codeLength += getNameList.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + getNameList = new GetNameListResponse(); + codeLength += getNameList.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { + read = new ReadResponse(); + codeLength += read.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) { + write = new WriteResponse(); + codeLength += write.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) { + getVariableAccessAttributes = new GetVariableAccessAttributesResponse(); + codeLength += getVariableAccessAttributes.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) { + defineNamedVariableList = new DefineNamedVariableListResponse(); + codeLength += defineNamedVariableList.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) { + getNamedVariableListAttributes = new GetNamedVariableListAttributesResponse(); + codeLength += getNamedVariableListAttributes.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) { + deleteNamedVariableList = new DeleteNamedVariableListResponse(); + codeLength += deleteNamedVariableList.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (getNameList != null) { + sb.append("getNameList: "); + getNameList.appendAsString(sb, indentLevel + 1); + return; + } + + if (read != null) { + sb.append("read: "); + read.appendAsString(sb, indentLevel + 1); + return; + } + + if (write != null) { + sb.append("write: "); + write.appendAsString(sb, indentLevel + 1); + return; + } + + if (getVariableAccessAttributes != null) { + sb.append("getVariableAccessAttributes: "); + getVariableAccessAttributes.appendAsString(sb, indentLevel + 1); + return; + } + + if (defineNamedVariableList != null) { + sb.append("defineNamedVariableList: ").append(defineNamedVariableList); + return; + } + + if (getNamedVariableListAttributes != null) { + sb.append("getNamedVariableListAttributes: "); + getNamedVariableListAttributes.appendAsString(sb, indentLevel + 1); + return; + } + + if (deleteNamedVariableList != null) { + sb.append("deleteNamedVariableList: "); + deleteNamedVariableList.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Data.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Data.java new file mode 100644 index 0000000..74e301a --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Data.java @@ -0,0 +1,683 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.jasn1.ber.types.BerBoolean; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerOctetString; +import org.openmuc.jasn1.ber.types.string.BerVisibleString; + +public class Data implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + + public static class Array implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public Array() { + seqOf = new ArrayList<>(); + } + + public Array(byte[] code) { + this.code = code; + } + + public List getData() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + Data element = new Data(); + subCodeLength += element.decode(is, null); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static class Structure implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public Structure() { + seqOf = new ArrayList<>(); + } + + public Structure(byte[] code) { + this.code = code; + } + + public List getData() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + Data element = new Data(); + subCodeLength += element.decode(is, null); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + private Array array = null; + private Structure structure = null; + private BerBoolean bool = null; + private BerBitString bitString = null; + private BerInteger integer = null; + private BerInteger unsigned = null; + private FloatingPoint floatingPoint = null; + private BerOctetString octetString = null; + private BerVisibleString visibleString = null; + private TimeOfDay binaryTime = null; + private MMSString mMSString = null; + private UtcTime utcTime = null; + + public Data() { + } + + public Data(byte[] code) { + this.code = code; + } + + public void setArray(Array array) { + this.array = array; + } + + public Array getArray() { + return array; + } + + public void setStructure(Structure structure) { + this.structure = structure; + } + + public Structure getStructure() { + return structure; + } + + public void setBool(BerBoolean bool) { + this.bool = bool; + } + + public BerBoolean getBool() { + return bool; + } + + public void setBitString(BerBitString bitString) { + this.bitString = bitString; + } + + public BerBitString getBitString() { + return bitString; + } + + public void setInteger(BerInteger integer) { + this.integer = integer; + } + + public BerInteger getInteger() { + return integer; + } + + public void setUnsigned(BerInteger unsigned) { + this.unsigned = unsigned; + } + + public BerInteger getUnsigned() { + return unsigned; + } + + public void setFloatingPoint(FloatingPoint floatingPoint) { + this.floatingPoint = floatingPoint; + } + + public FloatingPoint getFloatingPoint() { + return floatingPoint; + } + + public void setOctetString(BerOctetString octetString) { + this.octetString = octetString; + } + + public BerOctetString getOctetString() { + return octetString; + } + + public void setVisibleString(BerVisibleString visibleString) { + this.visibleString = visibleString; + } + + public BerVisibleString getVisibleString() { + return visibleString; + } + + public void setBinaryTime(TimeOfDay binaryTime) { + this.binaryTime = binaryTime; + } + + public TimeOfDay getBinaryTime() { + return binaryTime; + } + + public void setMMSString(MMSString mMSString) { + this.mMSString = mMSString; + } + + public MMSString getMMSString() { + return mMSString; + } + + public void setUtcTime(UtcTime utcTime) { + this.utcTime = utcTime; + } + + public UtcTime getUtcTime() { + return utcTime; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (utcTime != null) { + codeLength += utcTime.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 17 + os.write(0x91); + codeLength += 1; + return codeLength; + } + + if (mMSString != null) { + codeLength += mMSString.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 16 + os.write(0x90); + codeLength += 1; + return codeLength; + } + + if (binaryTime != null) { + codeLength += binaryTime.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 12 + os.write(0x8C); + codeLength += 1; + return codeLength; + } + + if (visibleString != null) { + codeLength += visibleString.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 10 + os.write(0x8A); + codeLength += 1; + return codeLength; + } + + if (octetString != null) { + codeLength += octetString.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 9 + os.write(0x89); + codeLength += 1; + return codeLength; + } + + if (floatingPoint != null) { + codeLength += floatingPoint.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 7 + os.write(0x87); + codeLength += 1; + return codeLength; + } + + if (unsigned != null) { + codeLength += unsigned.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 6 + os.write(0x86); + codeLength += 1; + return codeLength; + } + + if (integer != null) { + codeLength += integer.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 5 + os.write(0x85); + codeLength += 1; + return codeLength; + } + + if (bitString != null) { + codeLength += bitString.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 4 + os.write(0x84); + codeLength += 1; + return codeLength; + } + + if (bool != null) { + codeLength += bool.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 3 + os.write(0x83); + codeLength += 1; + return codeLength; + } + + if (structure != null) { + codeLength += structure.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + return codeLength; + } + + if (array != null) { + codeLength += array.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + array = new Array(); + codeLength += array.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + structure = new Structure(); + codeLength += structure.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) { + bool = new BerBoolean(); + codeLength += bool.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) { + bitString = new BerBitString(); + codeLength += bitString.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) { + integer = new BerInteger(); + codeLength += integer.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) { + unsigned = new BerInteger(); + codeLength += unsigned.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 7)) { + floatingPoint = new FloatingPoint(); + codeLength += floatingPoint.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) { + octetString = new BerOctetString(); + codeLength += octetString.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) { + visibleString = new BerVisibleString(); + codeLength += visibleString.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 12)) { + binaryTime = new TimeOfDay(); + codeLength += binaryTime.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 16)) { + mMSString = new MMSString(); + codeLength += mMSString.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 17)) { + utcTime = new UtcTime(); + codeLength += utcTime.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (array != null) { + sb.append("array: "); + array.appendAsString(sb, indentLevel + 1); + return; + } + + if (structure != null) { + sb.append("structure: "); + structure.appendAsString(sb, indentLevel + 1); + return; + } + + if (bool != null) { + sb.append("bool: ").append(bool); + return; + } + + if (bitString != null) { + sb.append("bitString: ").append(bitString); + return; + } + + if (integer != null) { + sb.append("integer: ").append(integer); + return; + } + + if (unsigned != null) { + sb.append("unsigned: ").append(unsigned); + return; + } + + if (floatingPoint != null) { + sb.append("floatingPoint: ").append(floatingPoint); + return; + } + + if (octetString != null) { + sb.append("octetString: ").append(octetString); + return; + } + + if (visibleString != null) { + sb.append("visibleString: ").append(visibleString); + return; + } + + if (binaryTime != null) { + sb.append("binaryTime: ").append(binaryTime); + return; + } + + if (mMSString != null) { + sb.append("mMSString: ").append(mMSString); + return; + } + + if (utcTime != null) { + sb.append("utcTime: ").append(utcTime); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DataAccessError.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DataAccessError.java new file mode 100644 index 0000000..2c109a4 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DataAccessError.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class DataAccessError extends BerInteger { + + private static final long serialVersionUID = 1L; + + public DataAccessError() { + } + + public DataAccessError(byte[] code) { + super(code); + } + + public DataAccessError(BigInteger value) { + super(value); + } + + public DataAccessError(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DefineNamedVariableListRequest.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DefineNamedVariableListRequest.java new file mode 100644 index 0000000..a314f6b --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DefineNamedVariableListRequest.java @@ -0,0 +1,165 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class DefineNamedVariableListRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private ObjectName variableListName = null; + private VariableDefs listOfVariable = null; + + public DefineNamedVariableListRequest() { + } + + public DefineNamedVariableListRequest(byte[] code) { + this.code = code; + } + + public void setVariableListName(ObjectName variableListName) { + this.variableListName = variableListName; + } + + public ObjectName getVariableListName() { + return variableListName; + } + + public void setListOfVariable(VariableDefs listOfVariable) { + this.listOfVariable = listOfVariable; + } + + public VariableDefs getListOfVariable() { + return listOfVariable; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += listOfVariable.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + + codeLength += variableListName.encode(os); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + variableListName = new ObjectName(); + subCodeLength += variableListName.decode(is, berTag); + subCodeLength += berTag.decode(is); + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + listOfVariable = new VariableDefs(); + subCodeLength += listOfVariable.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (variableListName != null) { + sb.append("variableListName: "); + variableListName.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("variableListName: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (listOfVariable != null) { + sb.append("listOfVariable: "); + listOfVariable.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("listOfVariable: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DefineNamedVariableListResponse.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DefineNamedVariableListResponse.java new file mode 100644 index 0000000..898453e --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DefineNamedVariableListResponse.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.BerNull; + +public class DefineNamedVariableListResponse extends BerNull { + + private static final long serialVersionUID = 1L; + + public DefineNamedVariableListResponse() { + } + + public DefineNamedVariableListResponse(byte[] code) { + super(code); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DeleteNamedVariableListRequest.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DeleteNamedVariableListRequest.java new file mode 100644 index 0000000..c301522 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DeleteNamedVariableListRequest.java @@ -0,0 +1,445 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.string.BerVisibleString; + +public class DeleteNamedVariableListRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class ListOfVariableListName implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public ListOfVariableListName() { + seqOf = new ArrayList<>(); + } + + public ListOfVariableListName(byte[] code) { + this.code = code; + } + + public List getObjectName() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + ObjectName element = new ObjectName(); + subCodeLength += element.decode(is, null); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static class DomainName implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BasicIdentifier basic = null; + + public DomainName() { + } + + public DomainName(byte[] code) { + this.code = code; + } + + public void setBasic(BasicIdentifier basic) { + this.basic = basic; + } + + public BasicIdentifier getBasic() { + return basic; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (basic != null) { + codeLength += basic.encode(os, true); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerVisibleString.tag)) { + basic = new BasicIdentifier(); + codeLength += basic.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (basic != null) { + sb.append("basic: ").append(basic); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private BerInteger scopeOfDelete = null; + private ListOfVariableListName listOfVariableListName = null; + private DomainName domainName = null; + + public DeleteNamedVariableListRequest() { + } + + public DeleteNamedVariableListRequest(byte[] code) { + this.code = code; + } + + public void setScopeOfDelete(BerInteger scopeOfDelete) { + this.scopeOfDelete = scopeOfDelete; + } + + public BerInteger getScopeOfDelete() { + return scopeOfDelete; + } + + public void setListOfVariableListName(ListOfVariableListName listOfVariableListName) { + this.listOfVariableListName = listOfVariableListName; + } + + public ListOfVariableListName getListOfVariableListName() { + return listOfVariableListName; + } + + public void setDomainName(DomainName domainName) { + this.domainName = domainName; + } + + public DomainName getDomainName() { + return domainName; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (domainName != null) { + sublength = domainName.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + } + + if (listOfVariableListName != null) { + codeLength += listOfVariableListName.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + } + + if (scopeOfDelete != null) { + codeLength += scopeOfDelete.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + if (totalLength == 0) { + return codeLength; + } + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + scopeOfDelete = new BerInteger(); + subCodeLength += scopeOfDelete.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + listOfVariableListName = new ListOfVariableListName(); + subCodeLength += listOfVariableListName.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + subCodeLength += length.decode(is); + domainName = new DomainName(); + subCodeLength += domainName.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (scopeOfDelete != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("scopeOfDelete: ").append(scopeOfDelete); + firstSelectedElement = false; + } + + if (listOfVariableListName != null) { + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("listOfVariableListName: "); + listOfVariableListName.appendAsString(sb, indentLevel + 1); + firstSelectedElement = false; + } + + if (domainName != null) { + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("domainName: "); + domainName.appendAsString(sb, indentLevel + 1); + firstSelectedElement = false; + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DeleteNamedVariableListResponse.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DeleteNamedVariableListResponse.java new file mode 100644 index 0000000..6a95879 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/DeleteNamedVariableListResponse.java @@ -0,0 +1,171 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class DeleteNamedVariableListResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Unsigned32 numberMatched = null; + private Unsigned32 numberDeleted = null; + + public DeleteNamedVariableListResponse() { + } + + public DeleteNamedVariableListResponse(byte[] code) { + this.code = code; + } + + public void setNumberMatched(Unsigned32 numberMatched) { + this.numberMatched = numberMatched; + } + + public Unsigned32 getNumberMatched() { + return numberMatched; + } + + public void setNumberDeleted(Unsigned32 numberDeleted) { + this.numberDeleted = numberDeleted; + } + + public Unsigned32 getNumberDeleted() { + return numberDeleted; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += numberDeleted.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + codeLength += numberMatched.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + numberMatched = new Unsigned32(); + subCodeLength += numberMatched.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + numberDeleted = new Unsigned32(); + subCodeLength += numberDeleted.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (numberMatched != null) { + sb.append("numberMatched: ").append(numberMatched); + } + else { + sb.append("numberMatched: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (numberDeleted != null) { + sb.append("numberDeleted: ").append(numberDeleted); + } + else { + sb.append("numberDeleted: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/FloatingPoint.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/FloatingPoint.java new file mode 100644 index 0000000..f147f64 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/FloatingPoint.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.BerOctetString; + +public class FloatingPoint extends BerOctetString { + + private static final long serialVersionUID = 1L; + + public FloatingPoint() { + } + + public FloatingPoint(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNameListRequest.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNameListRequest.java new file mode 100644 index 0000000..fcccc52 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNameListRequest.java @@ -0,0 +1,369 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerNull; + +public class GetNameListRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class ObjectScope implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BerNull vmdSpecific = null; + private Identifier domainSpecific = null; + private BerNull aaSpecific = null; + + public ObjectScope() { + } + + public ObjectScope(byte[] code) { + this.code = code; + } + + public void setVmdSpecific(BerNull vmdSpecific) { + this.vmdSpecific = vmdSpecific; + } + + public BerNull getVmdSpecific() { + return vmdSpecific; + } + + public void setDomainSpecific(Identifier domainSpecific) { + this.domainSpecific = domainSpecific; + } + + public Identifier getDomainSpecific() { + return domainSpecific; + } + + public void setAaSpecific(BerNull aaSpecific) { + this.aaSpecific = aaSpecific; + } + + public BerNull getAaSpecific() { + return aaSpecific; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (aaSpecific != null) { + codeLength += aaSpecific.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + return codeLength; + } + + if (domainSpecific != null) { + codeLength += domainSpecific.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + if (vmdSpecific != null) { + codeLength += vmdSpecific.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + vmdSpecific = new BerNull(); + codeLength += vmdSpecific.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + domainSpecific = new Identifier(); + codeLength += domainSpecific.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + aaSpecific = new BerNull(); + codeLength += aaSpecific.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (vmdSpecific != null) { + sb.append("vmdSpecific: ").append(vmdSpecific); + return; + } + + if (domainSpecific != null) { + sb.append("domainSpecific: ").append(domainSpecific); + return; + } + + if (aaSpecific != null) { + sb.append("aaSpecific: ").append(aaSpecific); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private ObjectClass objectClass = null; + private ObjectScope objectScope = null; + private Identifier continueAfter = null; + + public GetNameListRequest() { + } + + public GetNameListRequest(byte[] code) { + this.code = code; + } + + public void setObjectClass(ObjectClass objectClass) { + this.objectClass = objectClass; + } + + public ObjectClass getObjectClass() { + return objectClass; + } + + public void setObjectScope(ObjectScope objectScope) { + this.objectScope = objectScope; + } + + public ObjectScope getObjectScope() { + return objectScope; + } + + public void setContinueAfter(Identifier continueAfter) { + this.continueAfter = continueAfter; + } + + public Identifier getContinueAfter() { + return continueAfter; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (continueAfter != null) { + codeLength += continueAfter.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + } + + sublength = objectScope.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + + sublength = objectClass.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + subCodeLength += length.decode(is); + objectClass = new ObjectClass(); + subCodeLength += objectClass.decode(is, null); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + subCodeLength += length.decode(is); + objectScope = new ObjectScope(); + subCodeLength += objectScope.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + continueAfter = new Identifier(); + subCodeLength += continueAfter.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (objectClass != null) { + sb.append("objectClass: "); + objectClass.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("objectClass: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (objectScope != null) { + sb.append("objectScope: "); + objectScope.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("objectScope: "); + } + + if (continueAfter != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("continueAfter: ").append(continueAfter); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNameListResponse.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNameListResponse.java new file mode 100644 index 0000000..efe8df7 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNameListResponse.java @@ -0,0 +1,306 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBoolean; + +public class GetNameListResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class ListOfIdentifier implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public ListOfIdentifier() { + seqOf = new ArrayList<>(); + } + + public ListOfIdentifier(byte[] code) { + this.code = code; + } + + public List getIdentifier() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + Identifier element = new Identifier(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + sb.append(it.next()); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append(it.next()); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private ListOfIdentifier listOfIdentifier = null; + private BerBoolean moreFollows = null; + + public GetNameListResponse() { + } + + public GetNameListResponse(byte[] code) { + this.code = code; + } + + public void setListOfIdentifier(ListOfIdentifier listOfIdentifier) { + this.listOfIdentifier = listOfIdentifier; + } + + public ListOfIdentifier getListOfIdentifier() { + return listOfIdentifier; + } + + public void setMoreFollows(BerBoolean moreFollows) { + this.moreFollows = moreFollows; + } + + public BerBoolean getMoreFollows() { + return moreFollows; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (moreFollows != null) { + codeLength += moreFollows.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + } + + codeLength += listOfIdentifier.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + listOfIdentifier = new ListOfIdentifier(); + subCodeLength += listOfIdentifier.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + moreFollows = new BerBoolean(); + subCodeLength += moreFollows.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (listOfIdentifier != null) { + sb.append("listOfIdentifier: "); + listOfIdentifier.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("listOfIdentifier: "); + } + + if (moreFollows != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("moreFollows: ").append(moreFollows); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNamedVariableListAttributesRequest.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNamedVariableListAttributesRequest.java new file mode 100644 index 0000000..43c3912 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNamedVariableListAttributesRequest.java @@ -0,0 +1,18 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +public class GetNamedVariableListAttributesRequest extends ObjectName { + + private static final long serialVersionUID = 1L; + + public GetNamedVariableListAttributesRequest() { + } + + public GetNamedVariableListAttributesRequest(byte[] code) { + super(code); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNamedVariableListAttributesResponse.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNamedVariableListAttributesResponse.java new file mode 100644 index 0000000..1043b0d --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetNamedVariableListAttributesResponse.java @@ -0,0 +1,173 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBoolean; + +public class GetNamedVariableListAttributesResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private BerBoolean mmsDeletable = null; + private VariableDefs listOfVariable = null; + + public GetNamedVariableListAttributesResponse() { + } + + public GetNamedVariableListAttributesResponse(byte[] code) { + this.code = code; + } + + public void setMmsDeletable(BerBoolean mmsDeletable) { + this.mmsDeletable = mmsDeletable; + } + + public BerBoolean getMmsDeletable() { + return mmsDeletable; + } + + public void setListOfVariable(VariableDefs listOfVariable) { + this.listOfVariable = listOfVariable; + } + + public VariableDefs getListOfVariable() { + return listOfVariable; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += listOfVariable.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + + codeLength += mmsDeletable.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + mmsDeletable = new BerBoolean(); + subCodeLength += mmsDeletable.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + listOfVariable = new VariableDefs(); + subCodeLength += listOfVariable.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (mmsDeletable != null) { + sb.append("mmsDeletable: ").append(mmsDeletable); + } + else { + sb.append("mmsDeletable: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (listOfVariable != null) { + sb.append("listOfVariable: "); + listOfVariable.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("listOfVariable: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetVariableAccessAttributesRequest.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetVariableAccessAttributesRequest.java new file mode 100644 index 0000000..cd00b9f --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetVariableAccessAttributesRequest.java @@ -0,0 +1,114 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class GetVariableAccessAttributesRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private ObjectName name = null; + + public GetVariableAccessAttributesRequest() { + } + + public GetVariableAccessAttributesRequest(byte[] code) { + this.code = code; + } + + public void setName(ObjectName name) { + this.name = name; + } + + public ObjectName getName() { + return name; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (name != null) { + sublength = name.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + codeLength += BerLength.skip(is); + name = new ObjectName(); + codeLength += name.decode(is, null); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (name != null) { + sb.append("name: "); + name.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetVariableAccessAttributesResponse.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetVariableAccessAttributesResponse.java new file mode 100644 index 0000000..ddd3cad --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/GetVariableAccessAttributesResponse.java @@ -0,0 +1,178 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBoolean; + +public class GetVariableAccessAttributesResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private BerBoolean mmsDeletable = null; + private TypeDescription typeDescription = null; + + public GetVariableAccessAttributesResponse() { + } + + public GetVariableAccessAttributesResponse(byte[] code) { + this.code = code; + } + + public void setMmsDeletable(BerBoolean mmsDeletable) { + this.mmsDeletable = mmsDeletable; + } + + public BerBoolean getMmsDeletable() { + return mmsDeletable; + } + + public void setTypeDescription(TypeDescription typeDescription) { + this.typeDescription = typeDescription; + } + + public TypeDescription getTypeDescription() { + return typeDescription; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + sublength = typeDescription.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + + codeLength += mmsDeletable.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + mmsDeletable = new BerBoolean(); + subCodeLength += mmsDeletable.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + subCodeLength += length.decode(is); + typeDescription = new TypeDescription(); + subCodeLength += typeDescription.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (mmsDeletable != null) { + sb.append("mmsDeletable: ").append(mmsDeletable); + } + else { + sb.append("mmsDeletable: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (typeDescription != null) { + sb.append("typeDescription: "); + typeDescription.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("typeDescription: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Identifier.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Identifier.java new file mode 100644 index 0000000..b26b61a --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Identifier.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.string.BerVisibleString; + +public class Identifier extends BerVisibleString { + + private static final long serialVersionUID = 1L; + + public Identifier() { + } + + public Identifier(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InformationReport.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InformationReport.java new file mode 100644 index 0000000..17fdd43 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InformationReport.java @@ -0,0 +1,296 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class InformationReport implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class ListOfAccessResult implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public ListOfAccessResult() { + seqOf = new ArrayList<>(); + } + + public ListOfAccessResult(byte[] code) { + this.code = code; + } + + public List getAccessResult() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + AccessResult element = new AccessResult(); + subCodeLength += element.decode(is, null); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private VariableAccessSpecification variableAccessSpecification = null; + private ListOfAccessResult listOfAccessResult = null; + + public InformationReport() { + } + + public InformationReport(byte[] code) { + this.code = code; + } + + public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) { + this.variableAccessSpecification = variableAccessSpecification; + } + + public VariableAccessSpecification getVariableAccessSpecification() { + return variableAccessSpecification; + } + + public void setListOfAccessResult(ListOfAccessResult listOfAccessResult) { + this.listOfAccessResult = listOfAccessResult; + } + + public ListOfAccessResult getListOfAccessResult() { + return listOfAccessResult; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += listOfAccessResult.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + + codeLength += variableAccessSpecification.encode(os); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + variableAccessSpecification = new VariableAccessSpecification(); + subCodeLength += variableAccessSpecification.decode(is, berTag); + subCodeLength += berTag.decode(is); + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + listOfAccessResult = new ListOfAccessResult(); + subCodeLength += listOfAccessResult.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (variableAccessSpecification != null) { + sb.append("variableAccessSpecification: "); + variableAccessSpecification.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("variableAccessSpecification: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (listOfAccessResult != null) { + sb.append("listOfAccessResult: "); + listOfAccessResult.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("listOfAccessResult: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateErrorPDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateErrorPDU.java new file mode 100644 index 0000000..8ed85de --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateErrorPDU.java @@ -0,0 +1,18 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +public class InitiateErrorPDU extends ServiceError { + + private static final long serialVersionUID = 1L; + + public InitiateErrorPDU() { + } + + public InitiateErrorPDU(byte[] code) { + super(code); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateRequestPDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateRequestPDU.java new file mode 100644 index 0000000..73ec638 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateRequestPDU.java @@ -0,0 +1,462 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class InitiateRequestPDU implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class InitRequestDetail implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Integer16 proposedVersionNumber = null; + private ParameterSupportOptions proposedParameterCBB = null; + private ServiceSupportOptions servicesSupportedCalling = null; + + public InitRequestDetail() { + } + + public InitRequestDetail(byte[] code) { + this.code = code; + } + + public void setProposedVersionNumber(Integer16 proposedVersionNumber) { + this.proposedVersionNumber = proposedVersionNumber; + } + + public Integer16 getProposedVersionNumber() { + return proposedVersionNumber; + } + + public void setProposedParameterCBB(ParameterSupportOptions proposedParameterCBB) { + this.proposedParameterCBB = proposedParameterCBB; + } + + public ParameterSupportOptions getProposedParameterCBB() { + return proposedParameterCBB; + } + + public void setServicesSupportedCalling(ServiceSupportOptions servicesSupportedCalling) { + this.servicesSupportedCalling = servicesSupportedCalling; + } + + public ServiceSupportOptions getServicesSupportedCalling() { + return servicesSupportedCalling; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += servicesSupportedCalling.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + + codeLength += proposedParameterCBB.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + codeLength += proposedVersionNumber.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + proposedVersionNumber = new Integer16(); + subCodeLength += proposedVersionNumber.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + proposedParameterCBB = new ParameterSupportOptions(); + subCodeLength += proposedParameterCBB.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + servicesSupportedCalling = new ServiceSupportOptions(); + subCodeLength += servicesSupportedCalling.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (proposedVersionNumber != null) { + sb.append("proposedVersionNumber: ").append(proposedVersionNumber); + } + else { + sb.append("proposedVersionNumber: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (proposedParameterCBB != null) { + sb.append("proposedParameterCBB: ").append(proposedParameterCBB); + } + else { + sb.append("proposedParameterCBB: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (servicesSupportedCalling != null) { + sb.append("servicesSupportedCalling: ").append(servicesSupportedCalling); + } + else { + sb.append("servicesSupportedCalling: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Integer32 localDetailCalling = null; + private Integer16 proposedMaxServOutstandingCalling = null; + private Integer16 proposedMaxServOutstandingCalled = null; + private Integer8 proposedDataStructureNestingLevel = null; + private InitRequestDetail initRequestDetail = null; + + public InitiateRequestPDU() { + } + + public InitiateRequestPDU(byte[] code) { + this.code = code; + } + + public void setLocalDetailCalling(Integer32 localDetailCalling) { + this.localDetailCalling = localDetailCalling; + } + + public Integer32 getLocalDetailCalling() { + return localDetailCalling; + } + + public void setProposedMaxServOutstandingCalling(Integer16 proposedMaxServOutstandingCalling) { + this.proposedMaxServOutstandingCalling = proposedMaxServOutstandingCalling; + } + + public Integer16 getProposedMaxServOutstandingCalling() { + return proposedMaxServOutstandingCalling; + } + + public void setProposedMaxServOutstandingCalled(Integer16 proposedMaxServOutstandingCalled) { + this.proposedMaxServOutstandingCalled = proposedMaxServOutstandingCalled; + } + + public Integer16 getProposedMaxServOutstandingCalled() { + return proposedMaxServOutstandingCalled; + } + + public void setProposedDataStructureNestingLevel(Integer8 proposedDataStructureNestingLevel) { + this.proposedDataStructureNestingLevel = proposedDataStructureNestingLevel; + } + + public Integer8 getProposedDataStructureNestingLevel() { + return proposedDataStructureNestingLevel; + } + + public void setInitRequestDetail(InitRequestDetail initRequestDetail) { + this.initRequestDetail = initRequestDetail; + } + + public InitRequestDetail getInitRequestDetail() { + return initRequestDetail; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += initRequestDetail.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 + os.write(0xA4); + codeLength += 1; + + if (proposedDataStructureNestingLevel != null) { + codeLength += proposedDataStructureNestingLevel.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 3 + os.write(0x83); + codeLength += 1; + } + + codeLength += proposedMaxServOutstandingCalled.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + + codeLength += proposedMaxServOutstandingCalling.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + if (localDetailCalling != null) { + codeLength += localDetailCalling.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + localDetailCalling = new Integer32(); + subCodeLength += localDetailCalling.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + proposedMaxServOutstandingCalling = new Integer16(); + subCodeLength += proposedMaxServOutstandingCalling.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + proposedMaxServOutstandingCalled = new Integer16(); + subCodeLength += proposedMaxServOutstandingCalled.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) { + proposedDataStructureNestingLevel = new Integer8(); + subCodeLength += proposedDataStructureNestingLevel.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { + initRequestDetail = new InitRequestDetail(); + subCodeLength += initRequestDetail.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (localDetailCalling != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("localDetailCalling: ").append(localDetailCalling); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (proposedMaxServOutstandingCalling != null) { + sb.append("proposedMaxServOutstandingCalling: ").append(proposedMaxServOutstandingCalling); + } + else { + sb.append("proposedMaxServOutstandingCalling: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (proposedMaxServOutstandingCalled != null) { + sb.append("proposedMaxServOutstandingCalled: ").append(proposedMaxServOutstandingCalled); + } + else { + sb.append("proposedMaxServOutstandingCalled: "); + } + + if (proposedDataStructureNestingLevel != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("proposedDataStructureNestingLevel: ").append(proposedDataStructureNestingLevel); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (initRequestDetail != null) { + sb.append("initRequestDetail: "); + initRequestDetail.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("initRequestDetail: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateResponsePDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateResponsePDU.java new file mode 100644 index 0000000..9b7922a --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/InitiateResponsePDU.java @@ -0,0 +1,462 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class InitiateResponsePDU implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class InitResponseDetail implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Integer16 negotiatedVersionNumber = null; + private ParameterSupportOptions negotiatedParameterCBB = null; + private ServiceSupportOptions servicesSupportedCalled = null; + + public InitResponseDetail() { + } + + public InitResponseDetail(byte[] code) { + this.code = code; + } + + public void setNegotiatedVersionNumber(Integer16 negotiatedVersionNumber) { + this.negotiatedVersionNumber = negotiatedVersionNumber; + } + + public Integer16 getNegotiatedVersionNumber() { + return negotiatedVersionNumber; + } + + public void setNegotiatedParameterCBB(ParameterSupportOptions negotiatedParameterCBB) { + this.negotiatedParameterCBB = negotiatedParameterCBB; + } + + public ParameterSupportOptions getNegotiatedParameterCBB() { + return negotiatedParameterCBB; + } + + public void setServicesSupportedCalled(ServiceSupportOptions servicesSupportedCalled) { + this.servicesSupportedCalled = servicesSupportedCalled; + } + + public ServiceSupportOptions getServicesSupportedCalled() { + return servicesSupportedCalled; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += servicesSupportedCalled.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + + codeLength += negotiatedParameterCBB.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + codeLength += negotiatedVersionNumber.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + negotiatedVersionNumber = new Integer16(); + subCodeLength += negotiatedVersionNumber.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + negotiatedParameterCBB = new ParameterSupportOptions(); + subCodeLength += negotiatedParameterCBB.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + servicesSupportedCalled = new ServiceSupportOptions(); + subCodeLength += servicesSupportedCalled.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (negotiatedVersionNumber != null) { + sb.append("negotiatedVersionNumber: ").append(negotiatedVersionNumber); + } + else { + sb.append("negotiatedVersionNumber: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (negotiatedParameterCBB != null) { + sb.append("negotiatedParameterCBB: ").append(negotiatedParameterCBB); + } + else { + sb.append("negotiatedParameterCBB: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (servicesSupportedCalled != null) { + sb.append("servicesSupportedCalled: ").append(servicesSupportedCalled); + } + else { + sb.append("servicesSupportedCalled: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Integer32 localDetailCalled = null; + private Integer16 negotiatedMaxServOutstandingCalling = null; + private Integer16 negotiatedMaxServOutstandingCalled = null; + private Integer8 negotiatedDataStructureNestingLevel = null; + private InitResponseDetail initResponseDetail = null; + + public InitiateResponsePDU() { + } + + public InitiateResponsePDU(byte[] code) { + this.code = code; + } + + public void setLocalDetailCalled(Integer32 localDetailCalled) { + this.localDetailCalled = localDetailCalled; + } + + public Integer32 getLocalDetailCalled() { + return localDetailCalled; + } + + public void setNegotiatedMaxServOutstandingCalling(Integer16 negotiatedMaxServOutstandingCalling) { + this.negotiatedMaxServOutstandingCalling = negotiatedMaxServOutstandingCalling; + } + + public Integer16 getNegotiatedMaxServOutstandingCalling() { + return negotiatedMaxServOutstandingCalling; + } + + public void setNegotiatedMaxServOutstandingCalled(Integer16 negotiatedMaxServOutstandingCalled) { + this.negotiatedMaxServOutstandingCalled = negotiatedMaxServOutstandingCalled; + } + + public Integer16 getNegotiatedMaxServOutstandingCalled() { + return negotiatedMaxServOutstandingCalled; + } + + public void setNegotiatedDataStructureNestingLevel(Integer8 negotiatedDataStructureNestingLevel) { + this.negotiatedDataStructureNestingLevel = negotiatedDataStructureNestingLevel; + } + + public Integer8 getNegotiatedDataStructureNestingLevel() { + return negotiatedDataStructureNestingLevel; + } + + public void setInitResponseDetail(InitResponseDetail initResponseDetail) { + this.initResponseDetail = initResponseDetail; + } + + public InitResponseDetail getInitResponseDetail() { + return initResponseDetail; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += initResponseDetail.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 + os.write(0xA4); + codeLength += 1; + + if (negotiatedDataStructureNestingLevel != null) { + codeLength += negotiatedDataStructureNestingLevel.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 3 + os.write(0x83); + codeLength += 1; + } + + codeLength += negotiatedMaxServOutstandingCalled.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + + codeLength += negotiatedMaxServOutstandingCalling.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + if (localDetailCalled != null) { + codeLength += localDetailCalled.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + localDetailCalled = new Integer32(); + subCodeLength += localDetailCalled.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + negotiatedMaxServOutstandingCalling = new Integer16(); + subCodeLength += negotiatedMaxServOutstandingCalling.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + negotiatedMaxServOutstandingCalled = new Integer16(); + subCodeLength += negotiatedMaxServOutstandingCalled.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) { + negotiatedDataStructureNestingLevel = new Integer8(); + subCodeLength += negotiatedDataStructureNestingLevel.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { + initResponseDetail = new InitResponseDetail(); + subCodeLength += initResponseDetail.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (localDetailCalled != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("localDetailCalled: ").append(localDetailCalled); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (negotiatedMaxServOutstandingCalling != null) { + sb.append("negotiatedMaxServOutstandingCalling: ").append(negotiatedMaxServOutstandingCalling); + } + else { + sb.append("negotiatedMaxServOutstandingCalling: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (negotiatedMaxServOutstandingCalled != null) { + sb.append("negotiatedMaxServOutstandingCalled: ").append(negotiatedMaxServOutstandingCalled); + } + else { + sb.append("negotiatedMaxServOutstandingCalled: "); + } + + if (negotiatedDataStructureNestingLevel != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("negotiatedDataStructureNestingLevel: ").append(negotiatedDataStructureNestingLevel); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (initResponseDetail != null) { + sb.append("initResponseDetail: "); + initResponseDetail.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("initResponseDetail: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer16.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer16.java new file mode 100644 index 0000000..df499f2 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer16.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class Integer16 extends BerInteger { + + private static final long serialVersionUID = 1L; + + public Integer16() { + } + + public Integer16(byte[] code) { + super(code); + } + + public Integer16(BigInteger value) { + super(value); + } + + public Integer16(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer32.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer32.java new file mode 100644 index 0000000..eb3f553 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer32.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class Integer32 extends BerInteger { + + private static final long serialVersionUID = 1L; + + public Integer32() { + } + + public Integer32(byte[] code) { + super(code); + } + + public Integer32(BigInteger value) { + super(value); + } + + public Integer32(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer8.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer8.java new file mode 100644 index 0000000..d81c78c --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Integer8.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class Integer8 extends BerInteger { + + private static final long serialVersionUID = 1L; + + public Integer8() { + } + + public Integer8(byte[] code) { + super(code); + } + + public Integer8(BigInteger value) { + super(value); + } + + public Integer8(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/MMSString.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/MMSString.java new file mode 100644 index 0000000..bc1f76b --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/MMSString.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.string.BerVisibleString; + +public class MMSString extends BerVisibleString { + + private static final long serialVersionUID = 1L; + + public MMSString() { + } + + public MMSString(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/MMSpdu.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/MMSpdu.java new file mode 100644 index 0000000..8a98e8f --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/MMSpdu.java @@ -0,0 +1,339 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; + +public class MMSpdu implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private ConfirmedRequestPDU confirmedRequestPDU = null; + private ConfirmedResponsePDU confirmedResponsePDU = null; + private ConfirmedErrorPDU confirmedErrorPDU = null; + private UnconfirmedPDU unconfirmedPDU = null; + private RejectPDU rejectPDU = null; + private InitiateRequestPDU initiateRequestPDU = null; + private InitiateResponsePDU initiateResponsePDU = null; + private InitiateErrorPDU initiateErrorPDU = null; + private ConcludeRequestPDU concludeRequestPDU = null; + + public MMSpdu() { + } + + public MMSpdu(byte[] code) { + this.code = code; + } + + public void setConfirmedRequestPDU(ConfirmedRequestPDU confirmedRequestPDU) { + this.confirmedRequestPDU = confirmedRequestPDU; + } + + public ConfirmedRequestPDU getConfirmedRequestPDU() { + return confirmedRequestPDU; + } + + public void setConfirmedResponsePDU(ConfirmedResponsePDU confirmedResponsePDU) { + this.confirmedResponsePDU = confirmedResponsePDU; + } + + public ConfirmedResponsePDU getConfirmedResponsePDU() { + return confirmedResponsePDU; + } + + public void setConfirmedErrorPDU(ConfirmedErrorPDU confirmedErrorPDU) { + this.confirmedErrorPDU = confirmedErrorPDU; + } + + public ConfirmedErrorPDU getConfirmedErrorPDU() { + return confirmedErrorPDU; + } + + public void setUnconfirmedPDU(UnconfirmedPDU unconfirmedPDU) { + this.unconfirmedPDU = unconfirmedPDU; + } + + public UnconfirmedPDU getUnconfirmedPDU() { + return unconfirmedPDU; + } + + public void setRejectPDU(RejectPDU rejectPDU) { + this.rejectPDU = rejectPDU; + } + + public RejectPDU getRejectPDU() { + return rejectPDU; + } + + public void setInitiateRequestPDU(InitiateRequestPDU initiateRequestPDU) { + this.initiateRequestPDU = initiateRequestPDU; + } + + public InitiateRequestPDU getInitiateRequestPDU() { + return initiateRequestPDU; + } + + public void setInitiateResponsePDU(InitiateResponsePDU initiateResponsePDU) { + this.initiateResponsePDU = initiateResponsePDU; + } + + public InitiateResponsePDU getInitiateResponsePDU() { + return initiateResponsePDU; + } + + public void setInitiateErrorPDU(InitiateErrorPDU initiateErrorPDU) { + this.initiateErrorPDU = initiateErrorPDU; + } + + public InitiateErrorPDU getInitiateErrorPDU() { + return initiateErrorPDU; + } + + public void setConcludeRequestPDU(ConcludeRequestPDU concludeRequestPDU) { + this.concludeRequestPDU = concludeRequestPDU; + } + + public ConcludeRequestPDU getConcludeRequestPDU() { + return concludeRequestPDU; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (concludeRequestPDU != null) { + codeLength += concludeRequestPDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 11 + os.write(0x8B); + codeLength += 1; + return codeLength; + } + + if (initiateErrorPDU != null) { + codeLength += initiateErrorPDU.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 10 + os.write(0xAA); + codeLength += 1; + return codeLength; + } + + if (initiateResponsePDU != null) { + codeLength += initiateResponsePDU.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 9 + os.write(0xA9); + codeLength += 1; + return codeLength; + } + + if (initiateRequestPDU != null) { + codeLength += initiateRequestPDU.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 8 + os.write(0xA8); + codeLength += 1; + return codeLength; + } + + if (rejectPDU != null) { + codeLength += rejectPDU.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 + os.write(0xA4); + codeLength += 1; + return codeLength; + } + + if (unconfirmedPDU != null) { + codeLength += unconfirmedPDU.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 3 + os.write(0xA3); + codeLength += 1; + return codeLength; + } + + if (confirmedErrorPDU != null) { + codeLength += confirmedErrorPDU.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + return codeLength; + } + + if (confirmedResponsePDU != null) { + codeLength += confirmedResponsePDU.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + if (confirmedRequestPDU != null) { + codeLength += confirmedRequestPDU.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + confirmedRequestPDU = new ConfirmedRequestPDU(); + codeLength += confirmedRequestPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + confirmedResponsePDU = new ConfirmedResponsePDU(); + codeLength += confirmedResponsePDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + confirmedErrorPDU = new ConfirmedErrorPDU(); + codeLength += confirmedErrorPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) { + unconfirmedPDU = new UnconfirmedPDU(); + codeLength += unconfirmedPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { + rejectPDU = new RejectPDU(); + codeLength += rejectPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) { + initiateRequestPDU = new InitiateRequestPDU(); + codeLength += initiateRequestPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) { + initiateResponsePDU = new InitiateResponsePDU(); + codeLength += initiateResponsePDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 10)) { + initiateErrorPDU = new InitiateErrorPDU(); + codeLength += initiateErrorPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) { + concludeRequestPDU = new ConcludeRequestPDU(); + codeLength += concludeRequestPDU.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (confirmedRequestPDU != null) { + sb.append("confirmedRequestPDU: "); + confirmedRequestPDU.appendAsString(sb, indentLevel + 1); + return; + } + + if (confirmedResponsePDU != null) { + sb.append("confirmedResponsePDU: "); + confirmedResponsePDU.appendAsString(sb, indentLevel + 1); + return; + } + + if (confirmedErrorPDU != null) { + sb.append("confirmedErrorPDU: "); + confirmedErrorPDU.appendAsString(sb, indentLevel + 1); + return; + } + + if (unconfirmedPDU != null) { + sb.append("unconfirmedPDU: "); + unconfirmedPDU.appendAsString(sb, indentLevel + 1); + return; + } + + if (rejectPDU != null) { + sb.append("rejectPDU: "); + rejectPDU.appendAsString(sb, indentLevel + 1); + return; + } + + if (initiateRequestPDU != null) { + sb.append("initiateRequestPDU: "); + initiateRequestPDU.appendAsString(sb, indentLevel + 1); + return; + } + + if (initiateResponsePDU != null) { + sb.append("initiateResponsePDU: "); + initiateResponsePDU.appendAsString(sb, indentLevel + 1); + return; + } + + if (initiateErrorPDU != null) { + sb.append("initiateErrorPDU: "); + initiateErrorPDU.appendAsString(sb, indentLevel + 1); + return; + } + + if (concludeRequestPDU != null) { + sb.append("concludeRequestPDU: ").append(concludeRequestPDU); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ObjectClass.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ObjectClass.java new file mode 100644 index 0000000..7b388a2 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ObjectClass.java @@ -0,0 +1,108 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; + +public class ObjectClass implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BerInteger basicObjectClass = null; + + public ObjectClass() { + } + + public ObjectClass(byte[] code) { + this.code = code; + } + + public void setBasicObjectClass(BerInteger basicObjectClass) { + this.basicObjectClass = basicObjectClass; + } + + public BerInteger getBasicObjectClass() { + return basicObjectClass; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (basicObjectClass != null) { + codeLength += basicObjectClass.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + basicObjectClass = new BerInteger(); + codeLength += basicObjectClass.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (basicObjectClass != null) { + sb.append("basicObjectClass: ").append(basicObjectClass); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ObjectName.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ObjectName.java new file mode 100644 index 0000000..5881a82 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ObjectName.java @@ -0,0 +1,319 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.string.BerVisibleString; + +public class ObjectName implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + + public static class DomainSpecific implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Identifier domainID = null; + private Identifier itemID = null; + + public DomainSpecific() { + } + + public DomainSpecific(byte[] code) { + this.code = code; + } + + public void setDomainID(Identifier domainID) { + this.domainID = domainID; + } + + public Identifier getDomainID() { + return domainID; + } + + public void setItemID(Identifier itemID) { + this.itemID = itemID; + } + + public Identifier getItemID() { + return itemID; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += itemID.encode(os, true); + + codeLength += domainID.encode(os, true); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerVisibleString.tag)) { + domainID = new Identifier(); + subCodeLength += domainID.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerVisibleString.tag)) { + itemID = new Identifier(); + subCodeLength += itemID.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (domainID != null) { + sb.append("domainID: ").append(domainID); + } + else { + sb.append("domainID: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (itemID != null) { + sb.append("itemID: ").append(itemID); + } + else { + sb.append("itemID: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + private Identifier vmdSpecific = null; + private DomainSpecific domainSpecific = null; + private Identifier aaSpecific = null; + + public ObjectName() { + } + + public ObjectName(byte[] code) { + this.code = code; + } + + public void setVmdSpecific(Identifier vmdSpecific) { + this.vmdSpecific = vmdSpecific; + } + + public Identifier getVmdSpecific() { + return vmdSpecific; + } + + public void setDomainSpecific(DomainSpecific domainSpecific) { + this.domainSpecific = domainSpecific; + } + + public DomainSpecific getDomainSpecific() { + return domainSpecific; + } + + public void setAaSpecific(Identifier aaSpecific) { + this.aaSpecific = aaSpecific; + } + + public Identifier getAaSpecific() { + return aaSpecific; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (aaSpecific != null) { + codeLength += aaSpecific.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + return codeLength; + } + + if (domainSpecific != null) { + codeLength += domainSpecific.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + if (vmdSpecific != null) { + codeLength += vmdSpecific.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + vmdSpecific = new Identifier(); + codeLength += vmdSpecific.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + domainSpecific = new DomainSpecific(); + codeLength += domainSpecific.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + aaSpecific = new Identifier(); + codeLength += aaSpecific.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (vmdSpecific != null) { + sb.append("vmdSpecific: ").append(vmdSpecific); + return; + } + + if (domainSpecific != null) { + sb.append("domainSpecific: "); + domainSpecific.appendAsString(sb, indentLevel + 1); + return; + } + + if (aaSpecific != null) { + sb.append("aaSpecific: ").append(aaSpecific); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ParameterSupportOptions.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ParameterSupportOptions.java new file mode 100644 index 0000000..ebce7ca --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ParameterSupportOptions.java @@ -0,0 +1,24 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.BerBitString; + +public class ParameterSupportOptions extends BerBitString { + + private static final long serialVersionUID = 1L; + + public ParameterSupportOptions() { + } + + public ParameterSupportOptions(byte[] code) { + super(code); + } + + public ParameterSupportOptions(byte[] value, int numBits) { + super(value, numBits); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ReadRequest.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ReadRequest.java new file mode 100644 index 0000000..bb44014 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ReadRequest.java @@ -0,0 +1,178 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBoolean; + +public class ReadRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private BerBoolean specificationWithResult = null; + private VariableAccessSpecification variableAccessSpecification = null; + + public ReadRequest() { + } + + public ReadRequest(byte[] code) { + this.code = code; + } + + public void setSpecificationWithResult(BerBoolean specificationWithResult) { + this.specificationWithResult = specificationWithResult; + } + + public BerBoolean getSpecificationWithResult() { + return specificationWithResult; + } + + public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) { + this.variableAccessSpecification = variableAccessSpecification; + } + + public VariableAccessSpecification getVariableAccessSpecification() { + return variableAccessSpecification; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + sublength = variableAccessSpecification.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + + if (specificationWithResult != null) { + codeLength += specificationWithResult.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + specificationWithResult = new BerBoolean(); + subCodeLength += specificationWithResult.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + subCodeLength += length.decode(is); + variableAccessSpecification = new VariableAccessSpecification(); + subCodeLength += variableAccessSpecification.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (specificationWithResult != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("specificationWithResult: ").append(specificationWithResult); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (variableAccessSpecification != null) { + sb.append("variableAccessSpecification: "); + variableAccessSpecification.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("variableAccessSpecification: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ReadResponse.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ReadResponse.java new file mode 100644 index 0000000..2f040ee --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ReadResponse.java @@ -0,0 +1,309 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class ReadResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class ListOfAccessResult implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public ListOfAccessResult() { + seqOf = new ArrayList<>(); + } + + public ListOfAccessResult(byte[] code) { + this.code = code; + } + + public List getAccessResult() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + AccessResult element = new AccessResult(); + subCodeLength += element.decode(is, null); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private VariableAccessSpecification variableAccessSpecification = null; + private ListOfAccessResult listOfAccessResult = null; + + public ReadResponse() { + } + + public ReadResponse(byte[] code) { + this.code = code; + } + + public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) { + this.variableAccessSpecification = variableAccessSpecification; + } + + public VariableAccessSpecification getVariableAccessSpecification() { + return variableAccessSpecification; + } + + public void setListOfAccessResult(ListOfAccessResult listOfAccessResult) { + this.listOfAccessResult = listOfAccessResult; + } + + public ListOfAccessResult getListOfAccessResult() { + return listOfAccessResult; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + codeLength += listOfAccessResult.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + + if (variableAccessSpecification != null) { + sublength = variableAccessSpecification.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + subCodeLength += length.decode(is); + variableAccessSpecification = new VariableAccessSpecification(); + subCodeLength += variableAccessSpecification.decode(is, null); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + listOfAccessResult = new ListOfAccessResult(); + subCodeLength += listOfAccessResult.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (variableAccessSpecification != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("variableAccessSpecification: "); + variableAccessSpecification.appendAsString(sb, indentLevel + 1); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (listOfAccessResult != null) { + sb.append("listOfAccessResult: "); + listOfAccessResult.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("listOfAccessResult: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/RejectPDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/RejectPDU.java new file mode 100644 index 0000000..7803d6a --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/RejectPDU.java @@ -0,0 +1,543 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; + +public class RejectPDU implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class RejectReason implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BerInteger confirmedRequestPDU = null; + private BerInteger confirmedResponsePDU = null; + private BerInteger confirmedErrorPDU = null; + private BerInteger unconfirmedPDU = null; + private BerInteger pduError = null; + private BerInteger cancelRequestPDU = null; + private BerInteger cancelResponsePDU = null; + private BerInteger cancelErrorPDU = null; + private BerInteger concludeRequestPDU = null; + private BerInteger concludeResponsePDU = null; + private BerInteger concludeErrorPDU = null; + + public RejectReason() { + } + + public RejectReason(byte[] code) { + this.code = code; + } + + public void setConfirmedRequestPDU(BerInteger confirmedRequestPDU) { + this.confirmedRequestPDU = confirmedRequestPDU; + } + + public BerInteger getConfirmedRequestPDU() { + return confirmedRequestPDU; + } + + public void setConfirmedResponsePDU(BerInteger confirmedResponsePDU) { + this.confirmedResponsePDU = confirmedResponsePDU; + } + + public BerInteger getConfirmedResponsePDU() { + return confirmedResponsePDU; + } + + public void setConfirmedErrorPDU(BerInteger confirmedErrorPDU) { + this.confirmedErrorPDU = confirmedErrorPDU; + } + + public BerInteger getConfirmedErrorPDU() { + return confirmedErrorPDU; + } + + public void setUnconfirmedPDU(BerInteger unconfirmedPDU) { + this.unconfirmedPDU = unconfirmedPDU; + } + + public BerInteger getUnconfirmedPDU() { + return unconfirmedPDU; + } + + public void setPduError(BerInteger pduError) { + this.pduError = pduError; + } + + public BerInteger getPduError() { + return pduError; + } + + public void setCancelRequestPDU(BerInteger cancelRequestPDU) { + this.cancelRequestPDU = cancelRequestPDU; + } + + public BerInteger getCancelRequestPDU() { + return cancelRequestPDU; + } + + public void setCancelResponsePDU(BerInteger cancelResponsePDU) { + this.cancelResponsePDU = cancelResponsePDU; + } + + public BerInteger getCancelResponsePDU() { + return cancelResponsePDU; + } + + public void setCancelErrorPDU(BerInteger cancelErrorPDU) { + this.cancelErrorPDU = cancelErrorPDU; + } + + public BerInteger getCancelErrorPDU() { + return cancelErrorPDU; + } + + public void setConcludeRequestPDU(BerInteger concludeRequestPDU) { + this.concludeRequestPDU = concludeRequestPDU; + } + + public BerInteger getConcludeRequestPDU() { + return concludeRequestPDU; + } + + public void setConcludeResponsePDU(BerInteger concludeResponsePDU) { + this.concludeResponsePDU = concludeResponsePDU; + } + + public BerInteger getConcludeResponsePDU() { + return concludeResponsePDU; + } + + public void setConcludeErrorPDU(BerInteger concludeErrorPDU) { + this.concludeErrorPDU = concludeErrorPDU; + } + + public BerInteger getConcludeErrorPDU() { + return concludeErrorPDU; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (concludeErrorPDU != null) { + codeLength += concludeErrorPDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 11 + os.write(0x8B); + codeLength += 1; + return codeLength; + } + + if (concludeResponsePDU != null) { + codeLength += concludeResponsePDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 10 + os.write(0x8A); + codeLength += 1; + return codeLength; + } + + if (concludeRequestPDU != null) { + codeLength += concludeRequestPDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 9 + os.write(0x89); + codeLength += 1; + return codeLength; + } + + if (cancelErrorPDU != null) { + codeLength += cancelErrorPDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 8 + os.write(0x88); + codeLength += 1; + return codeLength; + } + + if (cancelResponsePDU != null) { + codeLength += cancelResponsePDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 7 + os.write(0x87); + codeLength += 1; + return codeLength; + } + + if (cancelRequestPDU != null) { + codeLength += cancelRequestPDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 6 + os.write(0x86); + codeLength += 1; + return codeLength; + } + + if (pduError != null) { + codeLength += pduError.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 5 + os.write(0x85); + codeLength += 1; + return codeLength; + } + + if (unconfirmedPDU != null) { + codeLength += unconfirmedPDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 4 + os.write(0x84); + codeLength += 1; + return codeLength; + } + + if (confirmedErrorPDU != null) { + codeLength += confirmedErrorPDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 3 + os.write(0x83); + codeLength += 1; + return codeLength; + } + + if (confirmedResponsePDU != null) { + codeLength += confirmedResponsePDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + return codeLength; + } + + if (confirmedRequestPDU != null) { + codeLength += confirmedRequestPDU.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + confirmedRequestPDU = new BerInteger(); + codeLength += confirmedRequestPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + confirmedResponsePDU = new BerInteger(); + codeLength += confirmedResponsePDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) { + confirmedErrorPDU = new BerInteger(); + codeLength += confirmedErrorPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) { + unconfirmedPDU = new BerInteger(); + codeLength += unconfirmedPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) { + pduError = new BerInteger(); + codeLength += pduError.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) { + cancelRequestPDU = new BerInteger(); + codeLength += cancelRequestPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 7)) { + cancelResponsePDU = new BerInteger(); + codeLength += cancelResponsePDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 8)) { + cancelErrorPDU = new BerInteger(); + codeLength += cancelErrorPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) { + concludeRequestPDU = new BerInteger(); + codeLength += concludeRequestPDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) { + concludeResponsePDU = new BerInteger(); + codeLength += concludeResponsePDU.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) { + concludeErrorPDU = new BerInteger(); + codeLength += concludeErrorPDU.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (confirmedRequestPDU != null) { + sb.append("confirmedRequestPDU: ").append(confirmedRequestPDU); + return; + } + + if (confirmedResponsePDU != null) { + sb.append("confirmedResponsePDU: ").append(confirmedResponsePDU); + return; + } + + if (confirmedErrorPDU != null) { + sb.append("confirmedErrorPDU: ").append(confirmedErrorPDU); + return; + } + + if (unconfirmedPDU != null) { + sb.append("unconfirmedPDU: ").append(unconfirmedPDU); + return; + } + + if (pduError != null) { + sb.append("pduError: ").append(pduError); + return; + } + + if (cancelRequestPDU != null) { + sb.append("cancelRequestPDU: ").append(cancelRequestPDU); + return; + } + + if (cancelResponsePDU != null) { + sb.append("cancelResponsePDU: ").append(cancelResponsePDU); + return; + } + + if (cancelErrorPDU != null) { + sb.append("cancelErrorPDU: ").append(cancelErrorPDU); + return; + } + + if (concludeRequestPDU != null) { + sb.append("concludeRequestPDU: ").append(concludeRequestPDU); + return; + } + + if (concludeResponsePDU != null) { + sb.append("concludeResponsePDU: ").append(concludeResponsePDU); + return; + } + + if (concludeErrorPDU != null) { + sb.append("concludeErrorPDU: ").append(concludeErrorPDU); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Unsigned32 originalInvokeID = null; + private RejectReason rejectReason = null; + + public RejectPDU() { + } + + public RejectPDU(byte[] code) { + this.code = code; + } + + public void setOriginalInvokeID(Unsigned32 originalInvokeID) { + this.originalInvokeID = originalInvokeID; + } + + public Unsigned32 getOriginalInvokeID() { + return originalInvokeID; + } + + public void setRejectReason(RejectReason rejectReason) { + this.rejectReason = rejectReason; + } + + public RejectReason getRejectReason() { + return rejectReason; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += rejectReason.encode(os); + + if (originalInvokeID != null) { + codeLength += originalInvokeID.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + originalInvokeID = new Unsigned32(); + subCodeLength += originalInvokeID.decode(is, false); + subCodeLength += berTag.decode(is); + } + + rejectReason = new RejectReason(); + subCodeLength += rejectReason.decode(is, berTag); + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (originalInvokeID != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("originalInvokeID: ").append(originalInvokeID); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (rejectReason != null) { + sb.append("rejectReason: "); + rejectReason.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("rejectReason: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ServiceError.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ServiceError.java new file mode 100644 index 0000000..be77405 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ServiceError.java @@ -0,0 +1,645 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.string.BerVisibleString; + +public class ServiceError implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class ErrorClass implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private BerInteger vmdState = null; + private BerInteger applicationReference = null; + private BerInteger definition = null; + private BerInteger resource = null; + private BerInteger service = null; + private BerInteger servicePreempt = null; + private BerInteger timeResolution = null; + private BerInteger access = null; + private BerInteger initiate = null; + private BerInteger conclude = null; + private BerInteger cancel = null; + private BerInteger file = null; + private BerInteger others = null; + + public ErrorClass() { + } + + public ErrorClass(byte[] code) { + this.code = code; + } + + public void setVmdState(BerInteger vmdState) { + this.vmdState = vmdState; + } + + public BerInteger getVmdState() { + return vmdState; + } + + public void setApplicationReference(BerInteger applicationReference) { + this.applicationReference = applicationReference; + } + + public BerInteger getApplicationReference() { + return applicationReference; + } + + public void setDefinition(BerInteger definition) { + this.definition = definition; + } + + public BerInteger getDefinition() { + return definition; + } + + public void setResource(BerInteger resource) { + this.resource = resource; + } + + public BerInteger getResource() { + return resource; + } + + public void setService(BerInteger service) { + this.service = service; + } + + public BerInteger getService() { + return service; + } + + public void setServicePreempt(BerInteger servicePreempt) { + this.servicePreempt = servicePreempt; + } + + public BerInteger getServicePreempt() { + return servicePreempt; + } + + public void setTimeResolution(BerInteger timeResolution) { + this.timeResolution = timeResolution; + } + + public BerInteger getTimeResolution() { + return timeResolution; + } + + public void setAccess(BerInteger access) { + this.access = access; + } + + public BerInteger getAccess() { + return access; + } + + public void setInitiate(BerInteger initiate) { + this.initiate = initiate; + } + + public BerInteger getInitiate() { + return initiate; + } + + public void setConclude(BerInteger conclude) { + this.conclude = conclude; + } + + public BerInteger getConclude() { + return conclude; + } + + public void setCancel(BerInteger cancel) { + this.cancel = cancel; + } + + public BerInteger getCancel() { + return cancel; + } + + public void setFile(BerInteger file) { + this.file = file; + } + + public BerInteger getFile() { + return file; + } + + public void setOthers(BerInteger others) { + this.others = others; + } + + public BerInteger getOthers() { + return others; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (others != null) { + codeLength += others.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 12 + os.write(0x8C); + codeLength += 1; + return codeLength; + } + + if (file != null) { + codeLength += file.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 11 + os.write(0x8B); + codeLength += 1; + return codeLength; + } + + if (cancel != null) { + codeLength += cancel.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 10 + os.write(0x8A); + codeLength += 1; + return codeLength; + } + + if (conclude != null) { + codeLength += conclude.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 9 + os.write(0x89); + codeLength += 1; + return codeLength; + } + + if (initiate != null) { + codeLength += initiate.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 8 + os.write(0x88); + codeLength += 1; + return codeLength; + } + + if (access != null) { + codeLength += access.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 7 + os.write(0x87); + codeLength += 1; + return codeLength; + } + + if (timeResolution != null) { + codeLength += timeResolution.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 6 + os.write(0x86); + codeLength += 1; + return codeLength; + } + + if (servicePreempt != null) { + codeLength += servicePreempt.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 5 + os.write(0x85); + codeLength += 1; + return codeLength; + } + + if (service != null) { + codeLength += service.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 4 + os.write(0x84); + codeLength += 1; + return codeLength; + } + + if (resource != null) { + codeLength += resource.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 3 + os.write(0x83); + codeLength += 1; + return codeLength; + } + + if (definition != null) { + codeLength += definition.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + return codeLength; + } + + if (applicationReference != null) { + codeLength += applicationReference.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + if (vmdState != null) { + codeLength += vmdState.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + vmdState = new BerInteger(); + codeLength += vmdState.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + applicationReference = new BerInteger(); + codeLength += applicationReference.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + definition = new BerInteger(); + codeLength += definition.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) { + resource = new BerInteger(); + codeLength += resource.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) { + service = new BerInteger(); + codeLength += service.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) { + servicePreempt = new BerInteger(); + codeLength += servicePreempt.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) { + timeResolution = new BerInteger(); + codeLength += timeResolution.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 7)) { + access = new BerInteger(); + codeLength += access.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 8)) { + initiate = new BerInteger(); + codeLength += initiate.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) { + conclude = new BerInteger(); + codeLength += conclude.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) { + cancel = new BerInteger(); + codeLength += cancel.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) { + file = new BerInteger(); + codeLength += file.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 12)) { + others = new BerInteger(); + codeLength += others.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (vmdState != null) { + sb.append("vmdState: ").append(vmdState); + return; + } + + if (applicationReference != null) { + sb.append("applicationReference: ").append(applicationReference); + return; + } + + if (definition != null) { + sb.append("definition: ").append(definition); + return; + } + + if (resource != null) { + sb.append("resource: ").append(resource); + return; + } + + if (service != null) { + sb.append("service: ").append(service); + return; + } + + if (servicePreempt != null) { + sb.append("servicePreempt: ").append(servicePreempt); + return; + } + + if (timeResolution != null) { + sb.append("timeResolution: ").append(timeResolution); + return; + } + + if (access != null) { + sb.append("access: ").append(access); + return; + } + + if (initiate != null) { + sb.append("initiate: ").append(initiate); + return; + } + + if (conclude != null) { + sb.append("conclude: ").append(conclude); + return; + } + + if (cancel != null) { + sb.append("cancel: ").append(cancel); + return; + } + + if (file != null) { + sb.append("file: ").append(file); + return; + } + + if (others != null) { + sb.append("others: ").append(others); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private ErrorClass errorClass = null; + private BerInteger additionalCode = null; + private BerVisibleString additionalDescription = null; + + public ServiceError() { + } + + public ServiceError(byte[] code) { + this.code = code; + } + + public void setErrorClass(ErrorClass errorClass) { + this.errorClass = errorClass; + } + + public ErrorClass getErrorClass() { + return errorClass; + } + + public void setAdditionalCode(BerInteger additionalCode) { + this.additionalCode = additionalCode; + } + + public BerInteger getAdditionalCode() { + return additionalCode; + } + + public void setAdditionalDescription(BerVisibleString additionalDescription) { + this.additionalDescription = additionalDescription; + } + + public BerVisibleString getAdditionalDescription() { + return additionalDescription; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (additionalDescription != null) { + codeLength += additionalDescription.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 2 + os.write(0x82); + codeLength += 1; + } + + if (additionalCode != null) { + codeLength += additionalCode.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + } + + sublength = errorClass.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + subCodeLength += length.decode(is); + errorClass = new ErrorClass(); + subCodeLength += errorClass.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + additionalCode = new BerInteger(); + subCodeLength += additionalCode.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { + additionalDescription = new BerVisibleString(); + subCodeLength += additionalDescription.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (errorClass != null) { + sb.append("errorClass: "); + errorClass.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("errorClass: "); + } + + if (additionalCode != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("additionalCode: ").append(additionalCode); + } + + if (additionalDescription != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("additionalDescription: ").append(additionalDescription); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ServiceSupportOptions.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ServiceSupportOptions.java new file mode 100644 index 0000000..bd57a26 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/ServiceSupportOptions.java @@ -0,0 +1,24 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.BerBitString; + +public class ServiceSupportOptions extends BerBitString { + + private static final long serialVersionUID = 1L; + + public ServiceSupportOptions() { + } + + public ServiceSupportOptions(byte[] code) { + super(code); + } + + public ServiceSupportOptions(byte[] value, int numBits) { + super(value, numBits); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TimeOfDay.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TimeOfDay.java new file mode 100644 index 0000000..16ea396 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TimeOfDay.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.BerOctetString; + +public class TimeOfDay extends BerOctetString { + + private static final long serialVersionUID = 1L; + + public TimeOfDay() { + } + + public TimeOfDay(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TypeDescription.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TypeDescription.java new file mode 100644 index 0000000..e346001 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TypeDescription.java @@ -0,0 +1,1227 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerBoolean; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerNull; + +public class TypeDescription implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + + public static class Array implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private BerBoolean packed = null; + private Unsigned32 numberOfElements = null; + private TypeSpecification elementType = null; + + public Array() { + } + + public Array(byte[] code) { + this.code = code; + } + + public void setPacked(BerBoolean packed) { + this.packed = packed; + } + + public BerBoolean getPacked() { + return packed; + } + + public void setNumberOfElements(Unsigned32 numberOfElements) { + this.numberOfElements = numberOfElements; + } + + public Unsigned32 getNumberOfElements() { + return numberOfElements; + } + + public void setElementType(TypeSpecification elementType) { + this.elementType = elementType; + } + + public TypeSpecification getElementType() { + return elementType; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + sublength = elementType.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + + codeLength += numberOfElements.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + + if (packed != null) { + codeLength += packed.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + packed = new BerBoolean(); + subCodeLength += packed.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + numberOfElements = new Unsigned32(); + subCodeLength += numberOfElements.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + subCodeLength += length.decode(is); + elementType = new TypeSpecification(); + subCodeLength += elementType.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (packed != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("packed: ").append(packed); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (numberOfElements != null) { + sb.append("numberOfElements: ").append(numberOfElements); + } + else { + sb.append("numberOfElements: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (elementType != null) { + sb.append("elementType: "); + elementType.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("elementType: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static class Structure implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class Components implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class SEQUENCE implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Identifier componentName = null; + private TypeSpecification componentType = null; + + public SEQUENCE() { + } + + public SEQUENCE(byte[] code) { + this.code = code; + } + + public void setComponentName(Identifier componentName) { + this.componentName = componentName; + } + + public Identifier getComponentName() { + return componentName; + } + + public void setComponentType(TypeSpecification componentType) { + this.componentType = componentType; + } + + public TypeSpecification getComponentType() { + return componentType; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + int sublength; + + sublength = componentType.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + + if (componentName != null) { + codeLength += componentName.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + componentName = new Identifier(); + subCodeLength += componentName.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + subCodeLength += length.decode(is); + componentType = new TypeSpecification(); + subCodeLength += componentType.decode(is, null); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (componentName != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("componentName: ").append(componentName); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (componentType != null) { + sb.append("componentType: "); + componentType.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("componentType: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public Components() { + seqOf = new ArrayList<>(); + } + + public Components(byte[] code) { + this.code = code; + } + + public List getSEQUENCE() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + SEQUENCE element = new SEQUENCE(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private BerBoolean packed = null; + private Components components = null; + + public Structure() { + } + + public Structure(byte[] code) { + this.code = code; + } + + public void setPacked(BerBoolean packed) { + this.packed = packed; + } + + public BerBoolean getPacked() { + return packed; + } + + public void setComponents(Components components) { + this.components = components; + } + + public Components getComponents() { + return components; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += components.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + + if (packed != null) { + codeLength += packed.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + packed = new BerBoolean(); + subCodeLength += packed.decode(is, false); + subCodeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + components = new Components(); + subCodeLength += components.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + boolean firstSelectedElement = true; + if (packed != null) { + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("packed: ").append(packed); + firstSelectedElement = false; + } + + if (!firstSelectedElement) { + sb.append(",\n"); + } + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (components != null) { + sb.append("components: "); + components.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("components: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static class FloatingPoint implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private Unsigned8 formatWidth = null; + private Unsigned8 exponentWidth = null; + + public FloatingPoint() { + } + + public FloatingPoint(byte[] code) { + this.code = code; + } + + public void setFormatWidth(Unsigned8 formatWidth) { + this.formatWidth = formatWidth; + } + + public Unsigned8 getFormatWidth() { + return formatWidth; + } + + public void setExponentWidth(Unsigned8 exponentWidth) { + this.exponentWidth = exponentWidth; + } + + public Unsigned8 getExponentWidth() { + return exponentWidth; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += exponentWidth.encode(os, true); + + codeLength += formatWidth.encode(os, true); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + if (berTag.equals(BerInteger.tag)) { + formatWidth = new Unsigned8(); + subCodeLength += formatWidth.decode(is, false); + subCodeLength += berTag.decode(is); + } + else { + throw new IOException("Tag does not match the mandatory sequence element tag."); + } + + if (berTag.equals(BerInteger.tag)) { + exponentWidth = new Unsigned8(); + subCodeLength += exponentWidth.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (formatWidth != null) { + sb.append("formatWidth: ").append(formatWidth); + } + else { + sb.append("formatWidth: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (exponentWidth != null) { + sb.append("exponentWidth: ").append(exponentWidth); + } + else { + sb.append("exponentWidth: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + private Array array = null; + private Structure structure = null; + private BerNull bool = null; + private Integer32 bitString = null; + private Unsigned8 integer = null; + private Unsigned8 unsigned = null; + private FloatingPoint floatingPoint = null; + private Integer32 octetString = null; + private Integer32 visibleString = null; + private BerBoolean binaryTime = null; + private Integer32 mMSString = null; + private BerNull utcTime = null; + + public TypeDescription() { + } + + public TypeDescription(byte[] code) { + this.code = code; + } + + public void setArray(Array array) { + this.array = array; + } + + public Array getArray() { + return array; + } + + public void setStructure(Structure structure) { + this.structure = structure; + } + + public Structure getStructure() { + return structure; + } + + public void setBool(BerNull bool) { + this.bool = bool; + } + + public BerNull getBool() { + return bool; + } + + public void setBitString(Integer32 bitString) { + this.bitString = bitString; + } + + public Integer32 getBitString() { + return bitString; + } + + public void setInteger(Unsigned8 integer) { + this.integer = integer; + } + + public Unsigned8 getInteger() { + return integer; + } + + public void setUnsigned(Unsigned8 unsigned) { + this.unsigned = unsigned; + } + + public Unsigned8 getUnsigned() { + return unsigned; + } + + public void setFloatingPoint(FloatingPoint floatingPoint) { + this.floatingPoint = floatingPoint; + } + + public FloatingPoint getFloatingPoint() { + return floatingPoint; + } + + public void setOctetString(Integer32 octetString) { + this.octetString = octetString; + } + + public Integer32 getOctetString() { + return octetString; + } + + public void setVisibleString(Integer32 visibleString) { + this.visibleString = visibleString; + } + + public Integer32 getVisibleString() { + return visibleString; + } + + public void setBinaryTime(BerBoolean binaryTime) { + this.binaryTime = binaryTime; + } + + public BerBoolean getBinaryTime() { + return binaryTime; + } + + public void setMMSString(Integer32 mMSString) { + this.mMSString = mMSString; + } + + public Integer32 getMMSString() { + return mMSString; + } + + public void setUtcTime(BerNull utcTime) { + this.utcTime = utcTime; + } + + public BerNull getUtcTime() { + return utcTime; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (utcTime != null) { + codeLength += utcTime.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 17 + os.write(0x91); + codeLength += 1; + return codeLength; + } + + if (mMSString != null) { + codeLength += mMSString.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 16 + os.write(0x90); + codeLength += 1; + return codeLength; + } + + if (binaryTime != null) { + codeLength += binaryTime.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 12 + os.write(0x8C); + codeLength += 1; + return codeLength; + } + + if (visibleString != null) { + codeLength += visibleString.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 10 + os.write(0x8A); + codeLength += 1; + return codeLength; + } + + if (octetString != null) { + codeLength += octetString.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 9 + os.write(0x89); + codeLength += 1; + return codeLength; + } + + if (floatingPoint != null) { + codeLength += floatingPoint.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 7 + os.write(0xA7); + codeLength += 1; + return codeLength; + } + + if (unsigned != null) { + codeLength += unsigned.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 6 + os.write(0x86); + codeLength += 1; + return codeLength; + } + + if (integer != null) { + codeLength += integer.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 5 + os.write(0x85); + codeLength += 1; + return codeLength; + } + + if (bitString != null) { + codeLength += bitString.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 4 + os.write(0x84); + codeLength += 1; + return codeLength; + } + + if (bool != null) { + codeLength += bool.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 3 + os.write(0x83); + codeLength += 1; + return codeLength; + } + + if (structure != null) { + codeLength += structure.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 + os.write(0xA2); + codeLength += 1; + return codeLength; + } + + if (array != null) { + codeLength += array.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + array = new Array(); + codeLength += array.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { + structure = new Structure(); + codeLength += structure.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) { + bool = new BerNull(); + codeLength += bool.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) { + bitString = new Integer32(); + codeLength += bitString.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) { + integer = new Unsigned8(); + codeLength += integer.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) { + unsigned = new Unsigned8(); + codeLength += unsigned.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 7)) { + floatingPoint = new FloatingPoint(); + codeLength += floatingPoint.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) { + octetString = new Integer32(); + codeLength += octetString.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) { + visibleString = new Integer32(); + codeLength += visibleString.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 12)) { + binaryTime = new BerBoolean(); + codeLength += binaryTime.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 16)) { + mMSString = new Integer32(); + codeLength += mMSString.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 17)) { + utcTime = new BerNull(); + codeLength += utcTime.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (array != null) { + sb.append("array: "); + array.appendAsString(sb, indentLevel + 1); + return; + } + + if (structure != null) { + sb.append("structure: "); + structure.appendAsString(sb, indentLevel + 1); + return; + } + + if (bool != null) { + sb.append("bool: ").append(bool); + return; + } + + if (bitString != null) { + sb.append("bitString: ").append(bitString); + return; + } + + if (integer != null) { + sb.append("integer: ").append(integer); + return; + } + + if (unsigned != null) { + sb.append("unsigned: ").append(unsigned); + return; + } + + if (floatingPoint != null) { + sb.append("floatingPoint: "); + floatingPoint.appendAsString(sb, indentLevel + 1); + return; + } + + if (octetString != null) { + sb.append("octetString: ").append(octetString); + return; + } + + if (visibleString != null) { + sb.append("visibleString: ").append(visibleString); + return; + } + + if (binaryTime != null) { + sb.append("binaryTime: ").append(binaryTime); + return; + } + + if (mMSString != null) { + sb.append("mMSString: ").append(mMSString); + return; + } + + if (utcTime != null) { + sb.append("utcTime: ").append(utcTime); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TypeSpecification.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TypeSpecification.java new file mode 100644 index 0000000..1da9af7 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/TypeSpecification.java @@ -0,0 +1,108 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; + +public class TypeSpecification implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private TypeDescription typeDescription = null; + + public TypeSpecification() { + } + + public TypeSpecification(byte[] code) { + this.code = code; + } + + public void setTypeDescription(TypeDescription typeDescription) { + this.typeDescription = typeDescription; + } + + public TypeDescription getTypeDescription() { + return typeDescription; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (typeDescription != null) { + codeLength += typeDescription.encode(os); + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + typeDescription = new TypeDescription(); + int choiceDecodeLength = typeDescription.decode(is, berTag); + if (choiceDecodeLength != 0) { + return codeLength + choiceDecodeLength; + } + else { + typeDescription = null; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (typeDescription != null) { + sb.append("typeDescription: "); + typeDescription.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UnconfirmedPDU.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UnconfirmedPDU.java new file mode 100644 index 0000000..76d3b1f --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UnconfirmedPDU.java @@ -0,0 +1,133 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class UnconfirmedPDU implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private UnconfirmedService service = null; + + public UnconfirmedPDU() { + } + + public UnconfirmedPDU(byte[] code) { + this.code = code; + } + + public void setService(UnconfirmedService service) { + this.service = service; + } + + public UnconfirmedService getService() { + return service; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += service.encode(os); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + service = new UnconfirmedService(); + subCodeLength += service.decode(is, berTag); + if (subCodeLength == totalLength) { + return codeLength; + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (service != null) { + sb.append("service: "); + service.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("service: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UnconfirmedService.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UnconfirmedService.java new file mode 100644 index 0000000..ae5b30d --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UnconfirmedService.java @@ -0,0 +1,108 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerTag; + +public class UnconfirmedService implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private InformationReport informationReport = null; + + public UnconfirmedService() { + } + + public UnconfirmedService(byte[] code) { + this.code = code; + } + + public void setInformationReport(InformationReport informationReport) { + this.informationReport = informationReport; + } + + public InformationReport getInformationReport() { + return informationReport; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (informationReport != null) { + codeLength += informationReport.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + informationReport = new InformationReport(); + codeLength += informationReport.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (informationReport != null) { + sb.append("informationReport: "); + informationReport.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned16.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned16.java new file mode 100644 index 0000000..d0198e2 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned16.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class Unsigned16 extends BerInteger { + + private static final long serialVersionUID = 1L; + + public Unsigned16() { + } + + public Unsigned16(byte[] code) { + super(code); + } + + public Unsigned16(BigInteger value) { + super(value); + } + + public Unsigned16(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned32.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned32.java new file mode 100644 index 0000000..8387066 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned32.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class Unsigned32 extends BerInteger { + + private static final long serialVersionUID = 1L; + + public Unsigned32() { + } + + public Unsigned32(byte[] code) { + super(code); + } + + public Unsigned32(BigInteger value) { + super(value); + } + + public Unsigned32(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned8.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned8.java new file mode 100644 index 0000000..dacc0ea --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/Unsigned8.java @@ -0,0 +1,30 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.math.BigInteger; + +import org.openmuc.jasn1.ber.types.BerInteger; + +public class Unsigned8 extends BerInteger { + + private static final long serialVersionUID = 1L; + + public Unsigned8() { + } + + public Unsigned8(byte[] code) { + super(code); + } + + public Unsigned8(BigInteger value) { + super(value); + } + + public Unsigned8(long value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UtcTime.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UtcTime.java new file mode 100644 index 0000000..0683866 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/UtcTime.java @@ -0,0 +1,20 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import org.openmuc.jasn1.ber.types.BerOctetString; + +public class UtcTime extends BerOctetString { + + private static final long serialVersionUID = 1L; + + public UtcTime() { + } + + public UtcTime(byte[] value) { + super(value); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableAccessSpecification.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableAccessSpecification.java new file mode 100644 index 0000000..480610a --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableAccessSpecification.java @@ -0,0 +1,143 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class VariableAccessSpecification implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private VariableDefs listOfVariable = null; + private ObjectName variableListName = null; + + public VariableAccessSpecification() { + } + + public VariableAccessSpecification(byte[] code) { + this.code = code; + } + + public void setListOfVariable(VariableDefs listOfVariable) { + this.listOfVariable = listOfVariable; + } + + public VariableDefs getListOfVariable() { + return listOfVariable; + } + + public void setVariableListName(ObjectName variableListName) { + this.variableListName = variableListName; + } + + public ObjectName getVariableListName() { + return variableListName; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (variableListName != null) { + sublength = variableListName.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 + os.write(0xA1); + codeLength += 1; + return codeLength; + } + + if (listOfVariable != null) { + codeLength += listOfVariable.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + listOfVariable = new VariableDefs(); + codeLength += listOfVariable.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { + codeLength += BerLength.skip(is); + variableListName = new ObjectName(); + codeLength += variableListName.decode(is, null); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (listOfVariable != null) { + sb.append("listOfVariable: "); + listOfVariable.appendAsString(sb, indentLevel + 1); + return; + } + + if (variableListName != null) { + sb.append("variableListName: "); + variableListName.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableDefs.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableDefs.java new file mode 100644 index 0000000..4843c74 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableDefs.java @@ -0,0 +1,298 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class VariableDefs implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class SEQUENCE implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private VariableSpecification variableSpecification = null; + private AlternateAccess alternateAccess = null; + + public SEQUENCE() { + } + + public SEQUENCE(byte[] code) { + this.code = code; + } + + public void setVariableSpecification(VariableSpecification variableSpecification) { + this.variableSpecification = variableSpecification; + } + + public VariableSpecification getVariableSpecification() { + return variableSpecification; + } + + public void setAlternateAccess(AlternateAccess alternateAccess) { + this.alternateAccess = alternateAccess; + } + + public AlternateAccess getAlternateAccess() { + return alternateAccess; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + if (alternateAccess != null) { + codeLength += alternateAccess.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 5 + os.write(0xA5); + codeLength += 1; + } + + codeLength += variableSpecification.encode(os); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + variableSpecification = new VariableSpecification(); + subCodeLength += variableSpecification.decode(is, berTag); + if (subCodeLength == totalLength) { + return codeLength; + } + subCodeLength += berTag.decode(is); + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) { + alternateAccess = new AlternateAccess(); + subCodeLength += alternateAccess.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + + ", actual sequence length: " + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (variableSpecification != null) { + sb.append("variableSpecification: "); + variableSpecification.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("variableSpecification: "); + } + + if (alternateAccess != null) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + sb.append("alternateAccess: "); + alternateAccess.appendAsString(sb, indentLevel + 1); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public VariableDefs() { + seqOf = new ArrayList<>(); + } + + public VariableDefs(byte[] code) { + this.code = code; + } + + public List getSEQUENCE() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os, true); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + SEQUENCE element = new SEQUENCE(); + subCodeLength += element.decode(is, true); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableSpecification.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableSpecification.java new file mode 100644 index 0000000..d94e8a1 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/VariableSpecification.java @@ -0,0 +1,114 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class VariableSpecification implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private ObjectName name = null; + + public VariableSpecification() { + } + + public VariableSpecification(byte[] code) { + this.code = code; + } + + public void setName(ObjectName name) { + this.name = name; + } + + public ObjectName getName() { + return name; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + int sublength; + + if (name != null) { + sublength = name.encode(os); + codeLength += sublength; + codeLength += BerLength.encodeLength(os, sublength); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + codeLength += BerLength.skip(is); + name = new ObjectName(); + codeLength += name.decode(is, null); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (name != null) { + sb.append("name: "); + name.appendAsString(sb, indentLevel + 1); + return; + } + + sb.append(""); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/WriteRequest.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/WriteRequest.java new file mode 100644 index 0000000..5fecb32 --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/WriteRequest.java @@ -0,0 +1,296 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; + +public class WriteRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class ListOfData implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public ListOfData() { + seqOf = new ArrayList<>(); + } + + public ListOfData(byte[] code) { + this.code = code; + } + + public List getData() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + Data element = new Data(); + subCodeLength += element.decode(is, null); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + + " but has " + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + + public byte[] code = null; + private VariableAccessSpecification variableAccessSpecification = null; + private ListOfData listOfData = null; + + public WriteRequest() { + } + + public WriteRequest(byte[] code) { + this.code = code; + } + + public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) { + this.variableAccessSpecification = variableAccessSpecification; + } + + public VariableAccessSpecification getVariableAccessSpecification() { + return variableAccessSpecification; + } + + public void setListOfData(ListOfData listOfData) { + this.listOfData = listOfData; + } + + public ListOfData getListOfData() { + return listOfData; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + codeLength += listOfData.encode(os, false); + // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 + os.write(0xA0); + codeLength += 1; + + codeLength += variableAccessSpecification.encode(os); + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + BerTag berTag = new BerTag(); + + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + + int totalLength = length.val; + codeLength += totalLength; + + subCodeLength += berTag.decode(is); + variableAccessSpecification = new VariableAccessSpecification(); + subCodeLength += variableAccessSpecification.decode(is, berTag); + subCodeLength += berTag.decode(is); + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { + listOfData = new ListOfData(); + subCodeLength += listOfData.decode(is, false); + if (subCodeLength == totalLength) { + return codeLength; + } + } + throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + + subCodeLength); + + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{"); + sb.append("\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (variableAccessSpecification != null) { + sb.append("variableAccessSpecification: "); + variableAccessSpecification.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("variableAccessSpecification: "); + } + + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (listOfData != null) { + sb.append("listOfData: "); + listOfData.appendAsString(sb, indentLevel + 1); + } + else { + sb.append("listOfData: "); + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/WriteResponse.java b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/WriteResponse.java new file mode 100644 index 0000000..d1e56aa --- /dev/null +++ b/src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/WriteResponse.java @@ -0,0 +1,268 @@ +/** + * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) + */ + +package org.openmuc.openiec61850.internal.mms.asn1; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.BerLength; +import org.openmuc.jasn1.ber.BerTag; +import org.openmuc.jasn1.ber.types.BerNull; + +public class WriteResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class CHOICE implements Serializable { + + private static final long serialVersionUID = 1L; + + public byte[] code = null; + private DataAccessError failure = null; + private BerNull success = null; + + public CHOICE() { + } + + public CHOICE(byte[] code) { + this.code = code; + } + + public void setFailure(DataAccessError failure) { + this.failure = failure; + } + + public DataAccessError getFailure() { + return failure; + } + + public void setSuccess(BerNull success) { + this.success = success; + } + + public BerNull getSuccess() { + return success; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + return code.length; + } + + int codeLength = 0; + if (success != null) { + codeLength += success.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 1 + os.write(0x81); + codeLength += 1; + return codeLength; + } + + if (failure != null) { + codeLength += failure.encode(os, false); + // write tag: CONTEXT_CLASS, PRIMITIVE, 0 + os.write(0x80); + codeLength += 1; + return codeLength; + } + + throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); + } + + public int decode(InputStream is) throws IOException { + return decode(is, null); + } + + public int decode(InputStream is, BerTag berTag) throws IOException { + + int codeLength = 0; + BerTag passedTag = berTag; + + if (berTag == null) { + berTag = new BerTag(); + codeLength += berTag.decode(is); + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { + failure = new DataAccessError(); + codeLength += failure.decode(is, false); + return codeLength; + } + + if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { + success = new BerNull(); + codeLength += success.decode(is, false); + return codeLength; + } + + if (passedTag != null) { + return 0; + } + + throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + if (failure != null) { + sb.append("failure: ").append(failure); + return; + } + + if (success != null) { + sb.append("success: ").append(success); + return; + } + + sb.append(""); + } + + } + + public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); + public byte[] code = null; + private List seqOf = null; + + public WriteResponse() { + seqOf = new ArrayList<>(); + } + + public WriteResponse(byte[] code) { + this.code = code; + } + + public List getCHOICE() { + if (seqOf == null) { + seqOf = new ArrayList<>(); + } + return seqOf; + } + + public int encode(BerByteArrayOutputStream os) throws IOException { + return encode(os, true); + } + + public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { + + if (code != null) { + for (int i = code.length - 1; i >= 0; i--) { + os.write(code[i]); + } + if (withTag) { + return tag.encode(os) + code.length; + } + return code.length; + } + + int codeLength = 0; + for (int i = (seqOf.size() - 1); i >= 0; i--) { + codeLength += seqOf.get(i).encode(os); + } + + codeLength += BerLength.encodeLength(os, codeLength); + + if (withTag) { + codeLength += tag.encode(os); + } + + return codeLength; + } + + public int decode(InputStream is) throws IOException { + return decode(is, true); + } + + public int decode(InputStream is, boolean withTag) throws IOException { + int codeLength = 0; + int subCodeLength = 0; + if (withTag) { + codeLength += tag.decodeAndCheck(is); + } + + BerLength length = new BerLength(); + codeLength += length.decode(is); + int totalLength = length.val; + + while (subCodeLength < totalLength) { + CHOICE element = new CHOICE(); + subCodeLength += element.decode(is, null); + seqOf.add(element); + } + if (subCodeLength != totalLength) { + throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + + subCodeLength); + + } + codeLength += subCodeLength; + + return codeLength; + } + + public void encodeAndSave(int encodingSizeGuess) throws IOException { + BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); + encode(os, false); + code = os.getArray(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + appendAsString(sb, 0); + return sb.toString(); + } + + public void appendAsString(StringBuilder sb, int indentLevel) { + + sb.append("{\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + if (seqOf == null) { + sb.append("null"); + } + else { + Iterator it = seqOf.iterator(); + if (it.hasNext()) { + it.next().appendAsString(sb, indentLevel + 1); + while (it.hasNext()) { + sb.append(",\n"); + for (int i = 0; i < indentLevel + 1; i++) { + sb.append("\t"); + } + it.next().appendAsString(sb, indentLevel + 1); + } + } + } + + sb.append("\n"); + for (int i = 0; i < indentLevel; i++) { + sb.append("\t"); + } + sb.append("}"); + } + +} diff --git a/src/main/java/org/openmuc/josistack/AcseAssociation.java b/src/main/java/org/openmuc/josistack/AcseAssociation.java new file mode 100644 index 0000000..f7c744e --- /dev/null +++ b/src/main/java/org/openmuc/josistack/AcseAssociation.java @@ -0,0 +1,956 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.josistack; + +import java.io.ByteArrayInputStream; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; +import java.net.InetAddress; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.TimeoutException; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.types.BerAny; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerObjectIdentifier; +import org.openmuc.jasn1.ber.types.string.BerGraphicString; +import org.openmuc.josistack.internal.acse.asn1.AAREApdu; +import org.openmuc.josistack.internal.acse.asn1.AARQApdu; +import org.openmuc.josistack.internal.acse.asn1.ACSEApdu; +import org.openmuc.josistack.internal.acse.asn1.ACSERequirements; +import org.openmuc.josistack.internal.acse.asn1.AEQualifier; +import org.openmuc.josistack.internal.acse.asn1.AEQualifierForm2; +import org.openmuc.josistack.internal.acse.asn1.APTitle; +import org.openmuc.josistack.internal.acse.asn1.APTitleForm2; +import org.openmuc.josistack.internal.acse.asn1.AssociateResult; +import org.openmuc.josistack.internal.acse.asn1.AssociateSourceDiagnostic; +import org.openmuc.josistack.internal.acse.asn1.AssociationInformation; +import org.openmuc.josistack.internal.acse.asn1.AuthenticationValue; +import org.openmuc.josistack.internal.acse.asn1.MechanismName; +import org.openmuc.josistack.internal.acse.asn1.Myexternal; +import org.openmuc.josistack.internal.presentation.asn1.CPAPPDU; +import org.openmuc.josistack.internal.presentation.asn1.CPType; +import org.openmuc.josistack.internal.presentation.asn1.CalledPresentationSelector; +import org.openmuc.josistack.internal.presentation.asn1.CallingPresentationSelector; +import org.openmuc.josistack.internal.presentation.asn1.FullyEncodedData; +import org.openmuc.josistack.internal.presentation.asn1.ModeSelector; +import org.openmuc.josistack.internal.presentation.asn1.PDVList; +import org.openmuc.josistack.internal.presentation.asn1.PresentationContextDefinitionList; +import org.openmuc.josistack.internal.presentation.asn1.PresentationContextDefinitionResultList; +import org.openmuc.josistack.internal.presentation.asn1.PresentationContextIdentifier; +import org.openmuc.josistack.internal.presentation.asn1.RespondingPresentationSelector; +import org.openmuc.josistack.internal.presentation.asn1.UserData; +import org.openmuc.jositransport.ClientTSap; +import org.openmuc.jositransport.TConnection; + +public final class AcseAssociation { + + // private static final Logger logger = LoggerFactory.getLogger(AcseAssociation.class); + + private boolean connected = false; + private TConnection tConnection; + private ByteBuffer associateResponseAPDU = null; + private final RespondingPresentationSelector pSelLocalBerOctetString; + + private static final PresentationContextDefinitionList context_list = new PresentationContextDefinitionList( + new byte[] { (byte) 0x23, (byte) 0x30, (byte) 0x0f, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x06, + (byte) 0x04, (byte) 0x52, (byte) 0x01, (byte) 0x00, (byte) 0x01, (byte) 0x30, (byte) 0x04, + (byte) 0x06, (byte) 0x02, (byte) 0x51, (byte) 0x01, (byte) 0x30, (byte) 0x10, (byte) 0x02, + (byte) 0x01, (byte) 0x03, (byte) 0x06, (byte) 0x05, (byte) 0x28, (byte) 0xca, (byte) 0x22, + (byte) 0x02, (byte) 0x01, (byte) 0x30, (byte) 0x04, (byte) 0x06, (byte) 0x02, (byte) 0x51, + (byte) 0x01 }); + + private static final PresentationContextIdentifier acsePresentationContextId = new PresentationContextIdentifier( + new byte[] { (byte) 0x01, (byte) 0x01 }); + private static final ModeSelector normalModeSelector = new ModeSelector(); + + private static final PresentationContextDefinitionResultList presentationResultList = new PresentationContextDefinitionResultList( + new byte[] { (byte) 0x12, (byte) 0x30, (byte) 0x07, (byte) 0x80, (byte) 0x01, (byte) 0x00, (byte) 0x81, + (byte) 0x02, (byte) 0x51, (byte) 0x01, (byte) 0x30, (byte) 0x07, (byte) 0x80, (byte) 0x01, + (byte) 0x00, (byte) 0x81, (byte) 0x02, (byte) 0x51, (byte) 0x01 }); + + private static final AssociateResult aareAccepted = new AssociateResult(new byte[] { (byte) 0x01, (byte) 0x00 }); + + private static final AssociateSourceDiagnostic associateSourceDiagnostic = new AssociateSourceDiagnostic( + new byte[] { (byte) 0xa1, (byte) 0x03, (byte) 0x02, (byte) 0x01, (byte) 0x00 }); + + // is always equal to 1.0.9506.2.3 (MMS) + private static final BerObjectIdentifier application_context_name = new BerObjectIdentifier( + new byte[] { (byte) 0x05, (byte) 0x28, (byte) 0xca, (byte) 0x22, (byte) 0x02, (byte) 0x03 }); + + private static final BerObjectIdentifier directReference = new BerObjectIdentifier( + new byte[] { (byte) 0x02, (byte) 0x51, (byte) 0x01 }); + private static final BerInteger indirectReference = new BerInteger(new byte[] { (byte) 0x01, (byte) 0x03 }); + + private static final MechanismName default_mechanism_name = new MechanismName( + new byte[] { 0x03, 0x52, 0x03, 0x01 }); + + static { + normalModeSelector.setModeValue(new BerInteger(BigInteger.ONE)); + } + + AcseAssociation(TConnection tConnection, byte[] pSelLocal) { + this.tConnection = tConnection; + pSelLocalBerOctetString = new RespondingPresentationSelector(pSelLocal); + } + + /** + * A server that got an Association Request Indication may use this function to accept the association. + * + * @param payload + * the payload to send with the accept message + * @throws IOException + * if an error occures accepting the association + */ + public void accept(ByteBuffer payload) throws IOException { + + BerAny anyPayload = new BerAny(Arrays.copyOfRange(payload.array(), payload.position(), payload.limit())); + + Myexternal.Encoding encoding = new Myexternal.Encoding(); + encoding.setSingleASN1Type(anyPayload); + + Myexternal myExternal = new Myexternal(); + myExternal.setDirectReference(directReference); + myExternal.setIndirectReference(indirectReference); + myExternal.setEncoding(encoding); + + AssociationInformation userInformation = new AssociationInformation(); + List externalList = userInformation.getMyexternal(); + externalList.add(myExternal); + + AAREApdu aare = new AAREApdu(); + aare.setApplicationContextName(application_context_name); + aare.setResult(aareAccepted); + aare.setResultSourceDiagnostic(associateSourceDiagnostic); + aare.setUserInformation(userInformation); + + ACSEApdu acse = new ACSEApdu(); + acse.setAare(aare); + + BerByteArrayOutputStream berOStream = new BerByteArrayOutputStream(100, true); + acse.encode(berOStream); + + UserData userData = getPresentationUserDataField(berOStream.getArray()); + CPAPPDU.NormalModeParameters normalModeParameters = new CPAPPDU.NormalModeParameters(); + normalModeParameters.setRespondingPresentationSelector(pSelLocalBerOctetString); + normalModeParameters.setPresentationContextDefinitionResultList(presentationResultList); + normalModeParameters.setUserData(userData); + + CPAPPDU cpaPPdu = new CPAPPDU(); + cpaPPdu.setModeSelector(normalModeSelector); + cpaPPdu.setNormalModeParameters(normalModeParameters); + + berOStream.reset(); + cpaPPdu.encode(berOStream, true); + + List ssduList = new LinkedList<>(); + List ssduOffsets = new LinkedList<>(); + List ssduLengths = new LinkedList<>(); + + ssduList.add(berOStream.buffer); + ssduOffsets.add(berOStream.index + 1); + ssduLengths.add(berOStream.buffer.length - (berOStream.index + 1)); + + writeSessionAccept(ssduList, ssduOffsets, ssduLengths); + + connected = true; + } + + private void writeSessionAccept(List ssdu, List ssduOffsets, List ssduLengths) + throws IOException { + byte[] sduAcceptHeader = new byte[20]; + int idx = 0; + + int ssduLength = 0; + for (int ssduElementLength : ssduLengths) { + ssduLength += ssduElementLength; + } + + // write ISO 8327-1 Header + // SPDU Type: ACCEPT (14) + sduAcceptHeader[idx++] = 0x0e; + // Length: length of session user data + 22 ( header data after length + // field ) + sduAcceptHeader[idx++] = (byte) ((ssduLength + 18) & 0xff); + + // -- start Connect Accept Item + // Parameter type: Connect Accept Item (5) + sduAcceptHeader[idx++] = 0x05; + // Parameter length + sduAcceptHeader[idx++] = 0x06; + + // Protocol options: + // Parameter Type: Protocol Options (19) + sduAcceptHeader[idx++] = 0x13; + // Parameter length + sduAcceptHeader[idx++] = 0x01; + // flags: (.... ...0 = Able to receive extended concatenated SPDU: + // False) + sduAcceptHeader[idx++] = 0x00; + + // Version number: + // Parameter type: Version Number (22) + sduAcceptHeader[idx++] = 0x16; + // Parameter length + sduAcceptHeader[idx++] = 0x01; + // flags: (.... ..1. = Protocol Version 2: True) + sduAcceptHeader[idx++] = 0x02; + // -- end Connect Accept Item + + // Session Requirement + // Parameter type: Session Requirement (20) + sduAcceptHeader[idx++] = 0x14; + // Parameter length + sduAcceptHeader[idx++] = 0x02; + // flags: (.... .... .... ..1. = Duplex functional unit: True) + sduAcceptHeader[idx++] = 0x00; + sduAcceptHeader[idx++] = 0x02; + + // Called Session Selector + // Parameter type: Called Session Selector (52) + sduAcceptHeader[idx++] = 0x34; + // Parameter length + sduAcceptHeader[idx++] = 0x02; + // Called Session Selector + sduAcceptHeader[idx++] = 0x00; + sduAcceptHeader[idx++] = 0x01; + + // Session user data + // Parameter type: Session user data (193) + sduAcceptHeader[idx++] = (byte) 0xc1; + + // Parameter length + sduAcceptHeader[idx++] = (byte) ssduLength; + + ssdu.add(0, sduAcceptHeader); + ssduOffsets.add(0, 0); + ssduLengths.add(0, sduAcceptHeader.length); + + tConnection.send(ssdu, ssduOffsets, ssduLengths); + + } + + public ByteBuffer getAssociateResponseAPdu() { + ByteBuffer returnBuffer = associateResponseAPDU; + associateResponseAPDU = null; + return returnBuffer; + } + + /** + * Starts an Application Association by sending an association request and waiting for an association accept message + * + * @param payload + * payload that can be sent with the association request + * @param port + * @param address + * @param tSAP + * @param aeQualifierCalling + * @param aeQualifierCalled + * @param apTitleCalling + * @param apTitleCalled + * @throws IOException + */ + void startAssociation(ByteBuffer payload, InetAddress address, int port, InetAddress localAddr, int localPort, + String authenticationParameter, byte[] sSelRemote, byte[] sSelLocal, byte[] pSelRemote, ClientTSap tSAP, + int[] apTitleCalled, int[] apTitleCalling, int aeQualifierCalled, int aeQualifierCalling) + throws IOException { + if (connected == true) { + throw new IOException(); + } + + APTitle called_ap_title = new APTitle(); + called_ap_title.setApTitleForm2(new APTitleForm2(apTitleCalled)); + APTitle calling_ap_title = new APTitle(); + calling_ap_title.setApTitleForm2(new APTitleForm2(apTitleCalling)); + + AEQualifier called_ae_qualifier = new AEQualifier(); + called_ae_qualifier.setAeQualifierForm2(new AEQualifierForm2(aeQualifierCalled)); + AEQualifier calling_ae_qualifier = new AEQualifier(); + calling_ae_qualifier.setAeQualifierForm2(new AEQualifierForm2(aeQualifierCalling)); + + Myexternal.Encoding encoding = new Myexternal.Encoding(); + encoding.setSingleASN1Type( + new BerAny(Arrays.copyOfRange(payload.array(), payload.position(), payload.limit()))); + + Myexternal myExternal = new Myexternal(); + myExternal.setDirectReference(directReference); + myExternal.setIndirectReference(indirectReference); + myExternal.setEncoding(encoding); + + AssociationInformation userInformation = new AssociationInformation(); + List externalList = userInformation.getMyexternal(); + externalList.add(myExternal); + + ACSERequirements sender_acse_requirements = null; + MechanismName mechanism_name = null; + AuthenticationValue authentication_value = null; + if (authenticationParameter != null) { + sender_acse_requirements = new ACSERequirements(new byte[] { (byte) 0x02, (byte) 0x07, (byte) 0x80 }); + mechanism_name = default_mechanism_name; + authentication_value = new AuthenticationValue(); + authentication_value.setCharstring(new BerGraphicString(authenticationParameter.getBytes())); + } + + AARQApdu aarq = new AARQApdu(); + aarq.setApplicationContextName(application_context_name); + aarq.setCalledAPTitle(called_ap_title); + aarq.setCalledAEQualifier(called_ae_qualifier); + aarq.setCallingAPTitle(calling_ap_title); + aarq.setCallingAEQualifier(calling_ae_qualifier); + aarq.setSenderAcseRequirements(sender_acse_requirements); + aarq.setMechanismName(mechanism_name); + aarq.setCallingAuthenticationValue(authentication_value); + aarq.setUserInformation(userInformation); + + ACSEApdu acse = new ACSEApdu(); + acse.setAarq(aarq); + + BerByteArrayOutputStream berOStream = new BerByteArrayOutputStream(200, true); + acse.encode(berOStream); + + UserData userData = getPresentationUserDataField(berOStream.getArray()); + + CPType.NormalModeParameters normalModeParameter = new CPType.NormalModeParameters(); + normalModeParameter + .setCallingPresentationSelector(new CallingPresentationSelector(pSelLocalBerOctetString.value)); + normalModeParameter.setCalledPresentationSelector(new CalledPresentationSelector(pSelRemote)); + normalModeParameter.setPresentationContextDefinitionList(context_list); + normalModeParameter.setUserData(userData); + + CPType cpType = new CPType(); + cpType.setModeSelector(normalModeSelector); + cpType.setNormalModeParameters(normalModeParameter); + + berOStream.reset(); + cpType.encode(berOStream, true); + + List ssduList = new LinkedList<>(); + List ssduOffsets = new LinkedList<>(); + List ssduLengths = new LinkedList<>(); + + ssduList.add(berOStream.buffer); + ssduOffsets.add(berOStream.index + 1); + ssduLengths.add(berOStream.buffer.length - (berOStream.index + 1)); + + ByteBuffer res = null; + res = startSConnection(ssduList, ssduOffsets, ssduLengths, address, port, localAddr, localPort, tSAP, + sSelRemote, sSelLocal); + + associateResponseAPDU = decodePConResponse(res); + + } + + private static ByteBuffer decodePConResponse(ByteBuffer ppdu) throws IOException { + + CPAPPDU cpa_ppdu = new CPAPPDU(); + InputStream iStream = new ByteBufferInputStream(ppdu); + cpa_ppdu.decode(iStream); + + iStream = new ByteArrayInputStream(cpa_ppdu.getNormalModeParameters() + .getUserData() + .getFullyEncodedData() + .getPDVList() + .get(0) + .getPresentationDataValues() + .getSingleASN1Type().value); + + ACSEApdu acseApdu = new ACSEApdu(); + acseApdu.decode(iStream, null); + return ByteBuffer.wrap( + acseApdu.getAare().getUserInformation().getMyexternal().get(0).getEncoding().getSingleASN1Type().value); + + } + + private static UserData getPresentationUserDataField(byte[] userDataBytes) { + PDVList.PresentationDataValues presDataValues = new PDVList.PresentationDataValues(); + presDataValues.setSingleASN1Type(new BerAny(userDataBytes)); + PDVList pdvList = new PDVList(); + pdvList.setPresentationContextIdentifier(acsePresentationContextId); + pdvList.setPresentationDataValues(presDataValues); + + FullyEncodedData fullyEncodedData = new FullyEncodedData(); + List pdvListList = fullyEncodedData.getPDVList(); + pdvListList.add(pdvList); + + UserData userData = new UserData(); + userData.setFullyEncodedData(fullyEncodedData); + return userData; + } + + /** + * Starts a session layer connection, sends a CONNECT (CN), waits for a ACCEPT (AC) and throws an IOException if not + * successful + * + * @throws IOException + */ + private ByteBuffer startSConnection(List ssduList, List ssduOffsets, List ssduLengths, + InetAddress address, int port, InetAddress localAddr, int localPort, ClientTSap tSAP, byte[] sSelRemote, + byte[] sSelLocal) throws IOException { + if (connected == true) { + throw new IOException(); + } + + byte[] spduHeader = new byte[24]; + int idx = 0; + // byte[] res = null; + + int ssduLength = 0; + for (int ssduElementLength : ssduLengths) { + ssduLength += ssduElementLength; + } + + // write ISO 8327-1 Header + // SPDU Type: CONNECT (13) + spduHeader[idx++] = 0x0d; + // Length: length of session user data + 22 ( header data after + // length field ) + spduHeader[idx++] = (byte) ((ssduLength + 22) & 0xff); + + // -- start Connect Accept Item + // Parameter type: Connect Accept Item (5) + spduHeader[idx++] = 0x05; + // Parameter length + spduHeader[idx++] = 0x06; + + // Protocol options: + // Parameter Type: Protocol Options (19) + spduHeader[idx++] = 0x13; + // Parameter length + spduHeader[idx++] = 0x01; + // flags: (.... ...0 = Able to receive extended concatenated SPDU: + // False) + spduHeader[idx++] = 0x00; + + // Version number: + // Parameter type: Version Number (22) + spduHeader[idx++] = 0x16; + // Parameter length + spduHeader[idx++] = 0x01; + // flags: (.... ..1. = Protocol Version 2: True) + spduHeader[idx++] = 0x02; + // -- end Connect Accept Item + + // Session Requirement + // Parameter type: Session Requirement (20) + spduHeader[idx++] = 0x14; + // Parameter length + spduHeader[idx++] = 0x02; + // flags: (.... .... .... ..1. = Duplex functional unit: True) + spduHeader[idx++] = 0x00; + spduHeader[idx++] = 0x02; + + // Calling Session Selector + // Parameter type: Calling Session Selector (51) + spduHeader[idx++] = 0x33; + // Parameter length + spduHeader[idx++] = 0x02; + // Calling Session Selector + spduHeader[idx++] = sSelRemote[0]; + spduHeader[idx++] = sSelRemote[1]; + + // Called Session Selector + // Parameter type: Called Session Selector (52) + spduHeader[idx++] = 0x34; + // Parameter length + spduHeader[idx++] = 0x02; + // Called Session Selector + spduHeader[idx++] = sSelLocal[0]; + spduHeader[idx++] = sSelLocal[1]; + + // Session user data + // Parameter type: Session user data (193) + spduHeader[idx++] = (byte) 0xc1; + // Parameter length + spduHeader[idx++] = (byte) (ssduLength & 0xff); + // write session user data + + ssduList.add(0, spduHeader); + ssduOffsets.add(0, 0); + ssduLengths.add(0, spduHeader.length); + + tConnection = tSAP.connectTo(address, port, localAddr, localPort); + + tConnection.send(ssduList, ssduOffsets, ssduLengths); + + // TODO how much should be allocated here? + ByteBuffer pduBuffer = ByteBuffer.allocate(500); + + try { + tConnection.receive(pduBuffer); + } catch (TimeoutException e) { + throw new IOException("ResponseTimeout waiting for connection response.", e); + } + idx = 0; + + // read ISO 8327-1 Header + // SPDU Type: ACCEPT (14) + byte spduType = pduBuffer.get(); + if (spduType != 0x0e) { + throw new IOException("ISO 8327-1 header wrong SPDU type, expected ACCEPT (14), got " + + getSPDUTypeString(spduType) + " (" + spduType + ")"); + } + pduBuffer.get(); // skip length byte + + parameter_loop: while (true) { + // read parameter type + int parameterType = pduBuffer.get() & 0xff; + // read parameter length + int parameterLength = pduBuffer.get() & 0xff; + + switch (parameterType) { + // Connect Accept Item (5) + case 0x05: + int bytesToRead = parameterLength; + while (bytesToRead > 0) { + // read parameter type + int ca_parameterType = pduBuffer.get(); + // read parameter length + // int ca_parameterLength = res[idx++]; + pduBuffer.get(); + + bytesToRead -= 2; + + switch (ca_parameterType & 0xff) { + // Protocol Options (19) + case 0x13: + // flags: .... ...0 = Able to receive extended + // concatenated SPDU: False + byte protocolOptions = pduBuffer.get(); + if (protocolOptions != 0x00) { + throw new IOException( + "SPDU Connect Accept Item/Protocol Options is " + protocolOptions + ", expected 0"); + } + + bytesToRead--; + break; + // Version Number + case 0x16: + // flags .... ..1. = Protocol Version 2: True + byte versionNumber = pduBuffer.get(); + if (versionNumber != 0x02) { + throw new IOException( + "SPDU Connect Accept Item/Version Number is " + versionNumber + ", expected 2"); + } + + bytesToRead--; + break; + default: + throw new IOException( + "SPDU Connect Accept Item: parameter not implemented: " + ca_parameterType); + } + } + break; + // Session Requirement (20) + case 0x14: + // flags: (.... .... .... ..1. = Duplex functional unit: True) + long sessionRequirement = extractInteger(pduBuffer, parameterLength); + if (sessionRequirement != 0x02) { + throw new IOException("SPDU header parameter 'Session Requirement (20)' is " + sessionRequirement + + ", expected 2"); + + } + break; + // Calling Session Selector (51) + case 0x33: + long css = extractInteger(pduBuffer, parameterLength); + if (css != 0x01) { + throw new IOException( + "SPDU header parameter 'Calling Session Selector (51)' is " + css + ", expected 1"); + + } + break; + // Called Session Selector (52) + case 0x34: + long calledSessionSelector = extractInteger(pduBuffer, parameterLength); + if (calledSessionSelector != 0x01) { + throw new IOException("SPDU header parameter 'Called Session Selector (52)' is " + + calledSessionSelector + ", expected 1"); + } + break; + // Session user data (193) + case 0xc1: + break parameter_loop; + default: + throw new IOException("SPDU header parameter type " + parameterType + " not implemented"); + } + } + + // got correct ACCEPT (AC) from the server + + connected = true; + + return pduBuffer; + } + + public void send(ByteBuffer payload) throws IOException { + + List ssduList = new ArrayList<>(); + List ssduOffsets = new LinkedList<>(); + List ssduLengths = new LinkedList<>(); + + encodePresentationLayer(payload, ssduList, ssduOffsets, ssduLengths); + + encodeSessionLayer(ssduList, ssduOffsets, ssduLengths); + + tConnection.send(ssduList, ssduOffsets, ssduLengths); + } + + private void encodePresentationLayer(ByteBuffer payload, List ssduList, List ssduOffsets, + List ssduLengths) throws IOException { + PDVList pdv_list = new PDVList(); + pdv_list.setPresentationContextIdentifier(new PresentationContextIdentifier(3l)); + + PDVList.PresentationDataValues presentationDataValues = new PDVList.PresentationDataValues(); + presentationDataValues.setSingleASN1Type( + new BerAny(Arrays.copyOfRange(payload.array(), payload.position(), payload.limit()))); + pdv_list.setPresentationDataValues(presentationDataValues); + + FullyEncodedData fully_encoded_data = new FullyEncodedData(); + List pdv_list_list = fully_encoded_data.getPDVList(); + pdv_list_list.add(pdv_list); + + UserData user_data = new UserData(); + user_data.setFullyEncodedData(fully_encoded_data); + + BerByteArrayOutputStream berOStream = new BerByteArrayOutputStream(200, true); + user_data.encode(berOStream); + + ssduList.add(berOStream.buffer); + ssduOffsets.add(berOStream.index + 1); + ssduLengths.add(berOStream.buffer.length - (berOStream.index + 1)); + + ssduList.add(payload.array()); + ssduOffsets.add(payload.arrayOffset() + payload.position()); + ssduLengths.add(payload.limit() - payload.position()); + } + + private void encodeSessionLayer(List ssduList, List ssduOffsets, List ssduLengths) + throws IOException { + + byte[] spduHeader = new byte[4]; + // --write iso 8327-1 Header-- + // write SPDU Type: give tokens PDU + spduHeader[0] = 0x01; + // length 0 + spduHeader[1] = 0; + // write SPDU Type: DATA TRANSFER (DT) + spduHeader[2] = 0x01; + // length 0 + spduHeader[3] = 0; + + ssduList.add(0, spduHeader); + ssduOffsets.add(0, 0); + ssduLengths.add(0, spduHeader.length); + + } + + /** + * Listens for a new PDU and writes it into the given buffer. Decodes all ACSE and lower layer headers. The + * resulting buffer's position points to the beginning of the ACSE SDU. The limit will point to the byte after the + * last byte of the ACSE SDU. + * + * @param pduBuffer + * buffer to write the received pdu into + * @throws DecodingException + * if a decoding error occurs + * @throws IOException + * if a non recoverable error occurs. Afterwards the association should be closed by the user + * @throws TimeoutException + * if a timeout occurs + */ + public void receive(ByteBuffer pduBuffer) throws DecodingException, IOException, TimeoutException { + if (connected == false) { + throw new IllegalStateException("ACSE Association not connected"); + } + tConnection.receive(pduBuffer); + + decodeSessionLayer(pduBuffer); + + decodePresentationLayer(pduBuffer); + } + + private void decodePresentationLayer(ByteBuffer pduBuffer) throws DecodingException { + // decode PPDU header + UserData user_data = new UserData(); + + try { + user_data.decode(new ByteBufferInputStream(pduBuffer), null); + } catch (IOException e) { + throw new DecodingException("error decoding PPDU header", e); + } + } + + private void decodeSessionLayer(ByteBuffer pduBuffer) throws EOFException, DecodingException { + int firstByte = pduBuffer.get(); + + if (firstByte == 25) { + // got an ABORT SPDU + throw new EOFException("Received an ABORT SPDU"); + } + + // -- read ISO 8327-1 header + // SPDU type: Give tokens PDU (1) + if (firstByte != 0x01) { + throw new DecodingException("SPDU header syntax errror: first SPDU type not 1"); + } + // length + if (pduBuffer.get() != 0) { + throw new DecodingException("SPDU header syntax errror: first SPDU type length not 0"); + } + // SPDU Type: DATA TRANSFER (DT) SPDU (1) + if (pduBuffer.get() != 0x01) { + throw new DecodingException("SPDU header syntax errror: second SPDU type not 1"); + } + // length + if (pduBuffer.get() != 0) { + throw new DecodingException("SPDU header syntax errror: second SPDU type length not 0"); + } + } + + /** + * Disconnects by sending a disconnect request at the Transport Layer and then closing the socket. + */ + public void disconnect() { + connected = false; + if (tConnection != null) { + tConnection.disconnect(); + } + } + + /** + * Closes the connection simply by closing the socket. + */ + public void close() { + connected = false; + if (tConnection != null) { + tConnection.close(); + } + } + + private long extractInteger(ByteBuffer buffer, int size) throws IOException { + switch (size) { + case 1: + return buffer.get(); + case 2: + return buffer.getShort(); + case 4: + return buffer.getInt(); + case 8: + return buffer.getLong(); + default: + throw new IOException("invalid length for reading numeric value"); + } + } + + ByteBuffer listenForCn(ByteBuffer pduBuffer) throws IOException, TimeoutException { + if (connected == true) { + throw new IllegalStateException("ACSE Association is already connected"); + } + int parameter; + int parameterLength; + + tConnection.receive(pduBuffer); + // start reading ISO 8327-1 header + // SPDU Type: CONNECT (CN) SPDU (13) + byte spduType = pduBuffer.get(); + if (spduType != 0x0d) { + throw new IOException("ISO 8327-1 header wrong SPDU type, expected CONNECT (13), got " + + getSPDUTypeString(spduType) + " (" + spduType + ")"); + } + pduBuffer.get(); // skip lenght byte + + parameter_loop: while (true) { + // read parameter code + parameter = pduBuffer.get() & 0xff; + // read parameter length + parameterLength = pduBuffer.get() & 0xff; + switch (parameter) { + // Connect Accept Item (5) + case 0x05: + int bytesToRead = parameterLength; + while (bytesToRead > 0) { + // read parameter type + int ca_parameterType = pduBuffer.get(); + // read parameter length + pduBuffer.get(); + + bytesToRead -= 2; + + switch (ca_parameterType & 0xff) { + // Protocol Options (19) + case 0x13: + // flags: .... ...0 = Able to receive extended + // concatenated SPDU: False + byte protocolOptions = pduBuffer.get(); + if (protocolOptions != 0x00) { + throw new IOException( + "SPDU Connect Accept Item/Protocol Options is " + protocolOptions + ", expected 0"); + } + + bytesToRead--; + break; + // Version Number + case 0x16: + // flags .... ..1. = Protocol Version 2: True + byte versionNumber = pduBuffer.get(); + if (versionNumber != 0x02) { + throw new IOException( + "SPDU Connect Accept Item/Version Number is " + versionNumber + ", expected 2"); + } + + bytesToRead--; + break; + default: + throw new IOException( + "SPDU Connect Accept Item: parameter not implemented: " + ca_parameterType); + } + } + break; + // Session Requirement (20) + case 0x14: + // flags: (.... .... .... ..1. = Duplex functional unit: True) + long sessionRequirement = extractInteger(pduBuffer, parameterLength); + if (sessionRequirement != 0x02) { + throw new IOException("SPDU header parameter 'Session Requirement (20)' is " + sessionRequirement + + ", expected 2"); + } + break; + // Calling Session Selector (51) + case 0x33: + extractInteger(pduBuffer, parameterLength); + break; + // Called Session Selector (52) + case 0x34: + long calledSessionSelector = extractInteger(pduBuffer, parameterLength); + if (calledSessionSelector != 0x01) { + throw new IOException("SPDU header parameter 'Called Session Selector (52)' is " + + calledSessionSelector + ", expected 1"); + } + break; + // Session user data (193) + case 0xc1: + break parameter_loop; + default: + throw new IOException("SPDU header parameter type " + parameter + " not implemented"); + } + + } + + CPType cpType = new CPType(); + InputStream iStream = new ByteBufferInputStream(pduBuffer); + cpType.decode(iStream, true); + + iStream = new ByteArrayInputStream(cpType.getNormalModeParameters() + .getUserData() + .getFullyEncodedData() + .getPDVList() + .get(0) + .getPresentationDataValues() + .getSingleASN1Type().value); + + ACSEApdu acseApdu = new ACSEApdu(); + acseApdu.decode(iStream, null); + return ByteBuffer.wrap( + acseApdu.getAarq().getUserInformation().getMyexternal().get(0).getEncoding().getSingleASN1Type().value); + + } + + public int getMessageTimeout() { + return tConnection.getMessageTimeout(); + } + + public void setMessageTimeout(int i) { + tConnection.setMessageTimeout(i); + } + + public static String getSPDUTypeString(byte spduType) { + switch (spduType) { + case 0: + return "EXCEPTION REPORT (ER)"; + case 1: + return "DATA TRANSFER (DT)"; + case 2: + return "PLEASE TOKENS (PT)"; + case 5: + return "EXPEDITED (EX)"; + case 7: + return "PREPARE (PR)"; + case 8: + return "NOT FINISHED (NF)"; + case 9: + return "FINISH (FN)"; + case 10: + return "DISCONNECT (DN)"; + case 12: + return "REFUSE (RF)"; + case 13: + return "CONNECT (CN)"; + case 14: + return "ACCEPT (AC)"; + case 15: + return "CONNECT DATA OVERFLOW (CDO)"; + case 16: + return "OVERFLOW ACCEPT (OA)"; + case 21: + return "GIVE TOKENS CONFIRM (GTC)"; + case 22: + return "GIVE TOKENS ACK (GTA)"; + case 25: + return "ABORT (AB)"; + case 26: + return "ABORT ACCEPT (AA)"; + case 29: + return "ACTIVITY RESUME (AR)"; + case 33: + return "TYPED DATA (TD)"; + case 34: + return "RESYNCHRONIZE ACK (RA)"; + case 41: + return "MAJOR SYNC POINT (MAP)"; + case 42: + return "MAJOR SYNC ACK (MAA)"; + case 45: + return "ACTIVITY START (AS)"; + case 48: + return "EXCEPTION DATA (ED)"; + case 49: + return "MINOR SYNC POINT (MIP)"; + case 50: + return "MINOR SYNC ACK (MIA)"; + case 53: + return "RESYNCHRONIZE (RS)"; + case 57: + return "ACTIVITY DISCARD (AD)"; + case 58: + return "ACTIVITY DISCARD ACK (ADA)"; + case 61: + return "CAPABILITY DATA (CD)"; + case 62: + return "CAPABILITY DATA ACK (CDA)"; + case 64: + return "UNIT DATA (UD)"; + default: + return ""; + } + } +} diff --git a/src/main/java/org/openmuc/josistack/AcseAssociationListener.java b/src/main/java/org/openmuc/josistack/AcseAssociationListener.java new file mode 100644 index 0000000..18c6fb7 --- /dev/null +++ b/src/main/java/org/openmuc/josistack/AcseAssociationListener.java @@ -0,0 +1,27 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.josistack; + +import java.io.IOException; +import java.nio.ByteBuffer; + +public interface AcseAssociationListener { + + public void connectionIndication(AcseAssociation acseAssociation, ByteBuffer data); + + public void serverStoppedListeningIndication(IOException e); +} diff --git a/src/main/java/org/openmuc/josistack/ByteBufferInputStream.java b/src/main/java/org/openmuc/josistack/ByteBufferInputStream.java new file mode 100644 index 0000000..ab73f0f --- /dev/null +++ b/src/main/java/org/openmuc/josistack/ByteBufferInputStream.java @@ -0,0 +1,59 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.josistack; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; + +/** + * Simple InputStream wrapper around a {@link ByteBuffer} object + * + * @author Karsten Mueller-Bier + */ +public final class ByteBufferInputStream extends InputStream { + + private final ByteBuffer buf; + + public ByteBufferInputStream(ByteBuffer buf) { + this.buf = buf; + } + + @Override + public int read() throws IOException { + if (buf.hasRemaining() == false) { + return -1; + } + return buf.get() & 0xFF; + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + if (buf.hasRemaining() == false) { + return -1; + } + int size = Math.min(len, available()); + + buf.get(b, off, size); + return size; + } + + @Override + public int available() throws IOException { + return buf.limit() - buf.position(); + } +} diff --git a/src/main/java/org/openmuc/josistack/ClientAcseSap.java b/src/main/java/org/openmuc/josistack/ClientAcseSap.java new file mode 100644 index 0000000..f00f9dd --- /dev/null +++ b/src/main/java/org/openmuc/josistack/ClientAcseSap.java @@ -0,0 +1,112 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.josistack; + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.ByteBuffer; + +import javax.net.SocketFactory; + +import org.openmuc.jositransport.ClientTSap; + +/** + * This class implements the Service Access Point (SAP) for the Application Control Service Element (ACSE) protocol as + * defined by ISO 8650 or ITU X.217/X.227. The ACSE provides services for establishing and releasing + * application-associations. The class also realizes the lower ISO Presentation Layer as defined by ISO 8823/ITU X226 + * and the ISO Session Layer as defined by 8327/ITU X.225. + * + */ +public final class ClientAcseSap { + + public ClientTSap tSap = null; + + static final byte[] P_SEL_DEFAULT = { 0, 0, 0, 1 }; + static final byte[] S_SEL_DEFAULT = { 0, 1 }; + + public byte[] pSelRemote = P_SEL_DEFAULT; + public byte[] pSelLocal = P_SEL_DEFAULT; + public byte[] sSelRemote = S_SEL_DEFAULT; + public byte[] sSelLocal = S_SEL_DEFAULT; + + private int[] apTitleCalled = new int[] { 1, 1, 999, 1, 1 }; + private int[] apTitleCalling = new int[] { 1, 1, 999, 1 }; + private int aeQualifierCalled = 12; + private int aeQualifierCalling = 12; + + /** + * Use this constructor to create a client ACSE Service Access Point (SAP) that will start connections to remote + * ACSE SAPs. Once constructed the AcseSAP contains a public TSAP that can be accessed to set its configuration. + */ + public ClientAcseSap() { + tSap = new ClientTSap(); + } + + public ClientAcseSap(SocketFactory socketFactory) { + tSap = new ClientTSap(socketFactory); + } + + public void setApTitleCalled(int[] title) { + this.apTitleCalled = title; + } + + public void setApTitleCalling(int[] title) { + this.apTitleCalling = title; + } + + public void setAeQualifierCalled(int qualifier) { + this.aeQualifierCalled = qualifier; + } + + public void setAeQualifierCalling(int qualifier) { + this.aeQualifierCalling = qualifier; + } + + /** + * Associate to a remote ServerAcseSAP that is listening at the destination address. + * + * @param address + * remote InetAddress + * @param port + * remote port + * @param localAddr + * local InetAddress + * @param localPort + * local port + * @param authenticationParameter + * an authentication parameter + * @param apdu + * the payload to send with the association request + * @return the association object + * @throws IOException + * if an error occurs connecting + */ + public AcseAssociation associate(InetAddress address, int port, InetAddress localAddr, int localPort, + String authenticationParameter, ByteBuffer apdu) throws IOException { + AcseAssociation acseAssociation = new AcseAssociation(null, pSelLocal); + try { + acseAssociation.startAssociation(apdu, address, port, localAddr, localPort, authenticationParameter, + sSelRemote, sSelLocal, pSelRemote, tSap, apTitleCalled, apTitleCalling, aeQualifierCalled, + aeQualifierCalling); + } catch (IOException e) { + acseAssociation.disconnect(); + throw e; + } + return acseAssociation; + } + +} diff --git a/src/main/java/org/openmuc/josistack/DecodingException.java b/src/main/java/org/openmuc/josistack/DecodingException.java new file mode 100644 index 0000000..ae65be4 --- /dev/null +++ b/src/main/java/org/openmuc/josistack/DecodingException.java @@ -0,0 +1,39 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.josistack; + +public final class DecodingException extends Exception { + + private static final long serialVersionUID = -4102153710148894434L; + + public DecodingException() { + super(); + } + + public DecodingException(String s) { + super(s); + } + + public DecodingException(Throwable cause) { + super(cause); + } + + public DecodingException(String s, Throwable cause) { + super(s, cause); + } + +} diff --git a/src/main/java/org/openmuc/josistack/ServerAcseSap.java b/src/main/java/org/openmuc/josistack/ServerAcseSap.java new file mode 100644 index 0000000..53132bd --- /dev/null +++ b/src/main/java/org/openmuc/josistack/ServerAcseSap.java @@ -0,0 +1,140 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.josistack; + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.ByteBuffer; +import java.util.concurrent.TimeoutException; + +import javax.net.ServerSocketFactory; + +import org.openmuc.jositransport.ServerTSap; +import org.openmuc.jositransport.TConnection; +import org.openmuc.jositransport.TConnectionListener; + +/** + * This class implements the server Service Access Point (SAP) for the Application Control Service Element (ACSE) + * protocol as defined by ISO 8650 or ITU X.217/X.227. The ACSE provides services for establishing and releasing + * application-associations. The class also realizes the lower ISO Presentation Layer as defined by ISO 8823/ITU X226 + * and the ISO Session Layer as defined by 8327/ITU X.225. + * + */ +public final class ServerAcseSap implements TConnectionListener { + + private AcseAssociationListener associationListener = null; + public ServerTSap serverTSap = null; + + public byte[] pSelLocal = ClientAcseSap.P_SEL_DEFAULT; + + /** + * Use this constructor to create a server ACSE SAP that listens on a fixed port. + * + * @param port + * the local port listen on + * @param backlog + * the backlog + * @param bindAddr + * the InetAddress to bind to + * @param associationListener + * the AssociationListener that will be notified when remote clients have associated. Once constructed + * the AcseSAP contains a public TSAP that can be accessed to set its configuration. + */ + public ServerAcseSap(int port, int backlog, InetAddress bindAddr, AcseAssociationListener associationListener) { + this(port, backlog, bindAddr, associationListener, ServerSocketFactory.getDefault()); + } + + /** + * Use this constructor to create a server ACSE SAP that listens on a fixed port. The server socket is created with + * the given socket factory. + * + * @param port + * the local port listen on + * @param backlog + * the backlog + * @param bindAddr + * the InetAddress to bind to + * @param associationListener + * the AssociationListener that will be notified when remote clients have associated. Once constructed + * the AcseSAP contains a public TSAP that can be accessed to set its configuration. + * @param serverSocketFactory + * the server socket factory to create the socket + */ + public ServerAcseSap(int port, int backlog, InetAddress bindAddr, AcseAssociationListener associationListener, + ServerSocketFactory serverSocketFactory) { + this.associationListener = associationListener; + serverTSap = new ServerTSap(port, backlog, bindAddr, this, serverSocketFactory); + } + + /** + * Start listening for incoming connections. Only for server SAPs. + * + * @throws IOException + * if an error occures starting to listen + */ + public void startListening() throws IOException { + if (associationListener == null || serverTSap == null) { + throw new IllegalStateException("AcseSAP is unable to listen because it was not initialized."); + } + serverTSap.startListening(); + } + + public void stopListening() { + serverTSap.stopListening(); + } + + /** + * This function is internal and should not be called by users of this class. + */ + @Override + public void serverStoppedListeningIndication(IOException e) { + associationListener.serverStoppedListeningIndication(e); + } + + /** + * This function is internal and should not be called by users of this class. + * + */ + @Override + public void connectionIndication(TConnection tConnection) { + + try { + + AcseAssociation acseAssociation = new AcseAssociation(tConnection, pSelLocal); + + ByteBuffer asdu = ByteBuffer.allocate(1000); + try { + asdu = acseAssociation.listenForCn(asdu); + } catch (IOException e) { + // Server: Connection unsuccessful. + tConnection.close(); + return; + } catch (TimeoutException e) { + // Illegal state: Timeout should not occur here + tConnection.close(); + return; + } + + associationListener.connectionIndication(acseAssociation, asdu); + + } catch (Exception e) { + // Association closed because of an unexpected exception. + tConnection.close(); + } + + } +} diff --git a/src/main/java/org/openmuc/jositransport/ClientTSap.java b/src/main/java/org/openmuc/jositransport/ClientTSap.java new file mode 100644 index 0000000..1fe3d4a --- /dev/null +++ b/src/main/java/org/openmuc/jositransport/ClientTSap.java @@ -0,0 +1,174 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.jositransport; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.Socket; + +import javax.net.SocketFactory; + +/** + * This class implements a client Transport Service Access Point (TSAP) over TCP/IP as defined in RFC 1006, ISO 8072, + * and ISO 8073. It can be used to create TConnections that connect to remote ServerTSAPs. + * + */ +public final class ClientTSap { + + private int maxTPDUSizeParam = 16; + private SocketFactory socketFactory = null; + private int messageTimeout = 0; + private int messageFragmentTimeout = 60000; + + public byte[] tSelRemote = null; + public byte[] tSelLocal = null; + + /** + * Use this constructor to create a client TSAP that will start connections to remote TSAPs. + */ + public ClientTSap() { + socketFactory = SocketFactory.getDefault(); + } + + /** + * Use this constructor to create a client TSAP that will start connections to remote TSAPs. You could pass an + * SSLSocketFactory to enable SSL. + * + * @param socketFactory + * the socket factory to create the underlying socket + */ + public ClientTSap(SocketFactory socketFactory) { + this.socketFactory = socketFactory; + } + + /** + * Set the TConnection timeout for waiting for the first byte of a new message. Default is 0 (unlimited) + * + * @param messageTimeout + * in milliseconds + */ + public void setMessageTimeout(int messageTimeout) { + this.messageTimeout = messageTimeout; + } + + /** + * Set the TConnection timeout for receiving data once the beginning of a message has been received. Default is + * 60000 (60seconds) + * + * @param messageFragmentTimeout + * in milliseconds + */ + public void setMessageFragmentTimeout(int messageFragmentTimeout) { + this.messageFragmentTimeout = messageFragmentTimeout; + } + + /** + * Set the maxTPDUSize. The default maxTPduSize is 65531 (see RFC 1006). + * + * @param maxTPduSizeParam + * The maximum length is equal to 2^(maxTPduSizeParam) octets. Note that the actual TSDU size that can be + * transfered is equal to TPduSize-3. Default is 65531 octets (see RFC 1006), 7 <= maxTPduSizeParam + * <= 16, needs to be set before listening or connecting + */ + public void setMaxTPDUSizeParam(int maxTPduSizeParam) { + if (maxTPduSizeParam < 7 || maxTPduSizeParam > 16) { + throw new IllegalArgumentException("maxTPDUSizeParam is out of bound"); + } + this.maxTPDUSizeParam = maxTPduSizeParam; + } + + /** + * Get the maximum TPDU size parameter to be used by this TSAP + * + * @return the maximum TPDU size parameter + */ + public int getMaxTPDUSizeParam() { + return maxTPDUSizeParam; + } + + /** + * Calculates and returns the maximum TPDUSize. This is equal to 2^(maxTPDUSizeParam) + * + * @param maxTPDUSizeParam + * the size parameter + * @return the maximum TPDU size + */ + public static int getMaxTPDUSize(int maxTPDUSizeParam) { + if (maxTPDUSizeParam < 7 || maxTPDUSizeParam > 16) { + throw new IllegalArgumentException("maxTPDUSizeParam is out of bound"); + } + if (maxTPDUSizeParam == 16) { + return 65531; + } + else { + return (int) Math.pow(2, maxTPDUSizeParam); + } + } + + /** + * Connect to a remote TSAP that is listening at the destination address. + * + * @param address + * remote IP + * @param port + * remote port + * @return the Connection Object + * @throws IOException + * is thrown if connection was unsuccessful. + */ + public TConnection connectTo(InetAddress address, int port) throws IOException { + return connectTo(address, port, null, -1); + } + + /** + * Connect to a remote TSAP that is listening at the destination address. + * + * @param address + * remote IP + * @param port + * remote port + * @param localAddr + * local IP + * @param localPort + * local port + * @return the Connection Object + * @throws IOException + * is thrown if connection was unsuccessful. + */ + public TConnection connectTo(InetAddress address, int port, InetAddress localAddr, int localPort) + throws IOException { + Socket socket; + if (localAddr == null) { + socket = socketFactory.createSocket(address, port); + } + else { + socket = socketFactory.createSocket(address, port, localAddr, localPort); + } + TConnection tConnection = new TConnection(socket, maxTPDUSizeParam, messageTimeout, messageFragmentTimeout, + null); + tConnection.tSelRemote = tSelRemote; + tConnection.tSelLocal = tSelLocal; + tConnection.startConnection(); + + return tConnection; + } + + public void setSocketFactory(SocketFactory socketFactory) { + this.socketFactory = socketFactory; + } + +} diff --git a/src/main/java/org/openmuc/jositransport/ServerTSap.java b/src/main/java/org/openmuc/jositransport/ServerTSap.java new file mode 100644 index 0000000..965fe4a --- /dev/null +++ b/src/main/java/org/openmuc/jositransport/ServerTSap.java @@ -0,0 +1,220 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.jositransport; + +import java.io.IOException; +import java.net.InetAddress; + +import javax.net.ServerSocketFactory; + +/** + * This class implements the server Transport Service Access Point (TSAP) over TCP/IP as defined in RFC 1006, ISO 8072, + * and ISO 8073. It can be used to listen for incoming TConnections. + * + */ +public class ServerTSap { + + private ServerThread serverThread; + + private final int port; + private final InetAddress bindAddr; + private final int backlog; + private final TConnectionListener connectionListener; + private final ServerSocketFactory serverSocketFactory; + + private boolean started = false; + private int maxTPDUSizeParam = 16; + private int maxConnections = 100; + private int messageTimeout = 0; + private int messageFragmentTimeout = 60000; + + /** + * Use this constructor to create a server TSAP that can listen on a port. + * + * @param port + * the TCP port that the ServerSocket will connect to. Should be between 1 and 65535. + * @param conListener + * the ConnectionListener that will be notified when remote TSAPs are connecting or the server stopped + * listening. + */ + public ServerTSap(int port, TConnectionListener conListener) { + this(port, 0, null, conListener, ServerSocketFactory.getDefault()); + } + + /** + * Use this constructor to create a server TSAP that can listen on a port. + * + * @param port + * the TCP port that the ServerSocket will connect to. Should be between 1 and 65535. + * @param conListener + * the ConnectionListener that will be notified when remote TSAPs are connecting or the server stopped + * listening. + * @param backlog + * is passed to the java.net.ServerSocket + * @param bindAddr + * the IP address to bind to. It is passed to java.net.ServerSocket + */ + public ServerTSap(int port, int backlog, InetAddress bindAddr, TConnectionListener conListener) { + this(port, backlog, bindAddr, conListener, ServerSocketFactory.getDefault()); + } + + /** + * Use this constructor to create a server TSAP that can listen on a port, with a specified ServerSocketFactory. + * + * @param port + * the TCP port that the ServerSocket will connect to. Should be between 1 and 65535. + * @param connectionListener + * the ConnectionListener that will be notified when remote TSAPs are connecting or the server stopped + * listening. + * @param backlog + * is passed to the java.net.ServerSocket + * @param bindAddr + * the IP address to bind to. It is passed to java.net.ServerSocket + * @param serverSocketFactory + * The ServerSocketFactory to be used to create the ServerSocket + */ + public ServerTSap(int port, int backlog, InetAddress bindAddr, TConnectionListener connectionListener, + ServerSocketFactory serverSocketFactory) { + if (port < 1 || port > 65535) { + throw new IllegalArgumentException("port number is out of bound"); + } + + this.port = port; + this.backlog = backlog; + this.bindAddr = bindAddr; + this.connectionListener = connectionListener; + this.serverSocketFactory = serverSocketFactory; + } + + /** + * Starts a new thread that listens on the configured port. This method is non-blocking. + * + * @throws IOException + * if a starting to listen fails + */ + public void startListening() throws IOException { + started = true; + serverThread = new ServerThread(serverSocketFactory.createServerSocket(port, backlog, bindAddr), + maxTPDUSizeParam, maxConnections, messageTimeout, messageFragmentTimeout, connectionListener); + serverThread.start(); + } + + /** + * Stop listing on the port. Stops the server thread. + */ + public void stopListening() { + if (serverThread != null) { + serverThread.stopServer(); + } + serverThread = null; + started = false; + } + + /** + * Set the maxTPDUSize. The default maxTPduSize is 65531 (see RFC 1006). + * + * @param maxTPduSizeParam + * The maximum length is equal to 2^(maxTPduSizeParam) octets. Note that the actual TSDU size that can be + * transfered is equal to TPduSize-3. Default is 65531 octets (see RFC 1006), 7 <= maxTPduSizeParam + * <= 16, needs to be set before listening or connecting + */ + public void setMaxTPDUSizeParam(int maxTPduSizeParam) { + if (started == true) { + throw new RuntimeException("Trying to set parameter although server has started."); + } + if (maxTPduSizeParam < 7 || maxTPduSizeParam > 16) { + throw new IllegalArgumentException("maxTPDUSizeParam is out of bound"); + } + this.maxTPDUSizeParam = maxTPduSizeParam; + } + + /** + * Set the maximum number of connections that are allowed in parallel by the Server SAP. + * + * @param maxConnections + * the number of connections allowed (default is 100) + */ + public void setMaxConnections(int maxConnections) { + if (started == true) { + throw new RuntimeException("Trying to set parameter although server has started."); + } + if (maxConnections < 0) { + throw new IllegalArgumentException("maxConnections is out of bound"); + } + this.maxConnections = maxConnections; + } + + /** + * Set the TConnection timeout for waiting for the first byte of a new message. Default is 0 (unlimited) + * + * @param messageTimeout + * in milliseconds + */ + public void setMessageTimeout(int messageTimeout) { + if (started == true) { + throw new RuntimeException("Message timeout may not be set while the server SAP ist listening."); + } + this.messageTimeout = messageTimeout; + } + + /** + * Set the TConnection timeout for receiving data once the beginning of a message has been received. Default is + * 60000 (60 seconds) + * + * @param messageFragmentTimeout + * in milliseconds + */ + public void setMessageFragmentTimeout(int messageFragmentTimeout) { + if (started == true) { + throw new RuntimeException("Message fragment timeout may not be set while the server SAP ist listening."); + } + this.messageFragmentTimeout = messageFragmentTimeout; + } + + /** + * Get the maximum TPDU size parameter to be used by this TSAP + * + * @return the maximum TPDU size parameter + */ + public int getMaxTPDUSizeParam() { + return maxTPDUSizeParam; + } + + /** + * Calculates and returns the maximum TPDUSize. This is equal to 2^(maxTPDUSizeParam) + * + * @param maxTPDUSizeParam + * the size parameter + * @return the maximum TPDU size + */ + public static int getMaxTPDUSize(int maxTPDUSizeParam) { + if (maxTPDUSizeParam < 7 || maxTPDUSizeParam > 16) { + throw new IllegalArgumentException("maxTPDUSizeParam is out of bound"); + } + if (maxTPDUSizeParam == 16) { + return 65531; + } + else { + return (int) Math.pow(2, maxTPDUSizeParam); + } + } + + TConnectionListener getConnectionListener() { + return connectionListener; + } + +} diff --git a/src/main/java/org/openmuc/jositransport/ServerThread.java b/src/main/java/org/openmuc/jositransport/ServerThread.java new file mode 100644 index 0000000..27aff2b --- /dev/null +++ b/src/main/java/org/openmuc/jositransport/ServerThread.java @@ -0,0 +1,147 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.jositransport; + +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * This class extends Thread. It is started by ServerTSAP and listens on a socket for connections and hands them to the + * ConnectionHandler class. It notifies ConnectionListener if the socket is closed. + * + * @author Stefan Feuerhahn + * + */ +final class ServerThread extends Thread { + + private final ServerSocket serverSocket; + private final int maxTPduSizeParam; + private final int messageTimeout; + private final int messageFragmentTimeout; + private final int maxConnections; + private final TConnectionListener connectionListener; + + private boolean stopServer = false; + private int numConnections = 0; + + ServerThread(ServerSocket socket, int maxTPduSizeParam, int maxConnections, int messageTimeout, + int messageFragmentTimeout, TConnectionListener connectionListener) { + serverSocket = socket; + this.maxTPduSizeParam = maxTPduSizeParam; + this.maxConnections = maxConnections; + this.messageTimeout = messageTimeout; + this.messageFragmentTimeout = messageFragmentTimeout; + this.connectionListener = connectionListener; + } + + public final class ConnectionHandler extends Thread { + + private final Socket socket; + private final ServerThread serverThread; + + ConnectionHandler(Socket socket, ServerThread serverThread) { + this.socket = socket; + this.serverThread = serverThread; + } + + @Override + public void run() { + + TConnection tConnection; + try { + tConnection = new TConnection(socket, maxTPduSizeParam, messageTimeout, messageFragmentTimeout, + serverThread); + } catch (IOException e) { + synchronized (ServerThread.this) { + numConnections--; + } + return; + } + try { + tConnection.listenForCR(); + } catch (IOException e) { + tConnection.close(); + return; + } + connectionListener.connectionIndication(tConnection); + + } + } + + @Override + public void run() { + + ExecutorService executor = Executors.newCachedThreadPool(); + try { + + Socket clientSocket = null; + + while (true) { + try { + clientSocket = serverSocket.accept(); + } catch (IOException e) { + if (stopServer == false) { + connectionListener.serverStoppedListeningIndication(e); + } + return; + } + + boolean startConnection = false; + + synchronized (this) { + if (numConnections < maxConnections) { + numConnections++; + startConnection = true; + } + } + + if (startConnection) { + executor.execute(new ConnectionHandler(clientSocket, this)); + } + else { + // Maximum number of connections reached. Ignoring connection request. + } + + } + } finally { + executor.shutdown(); + } + } + + void connectionClosedSignal() { + synchronized (this) { + numConnections--; + } + } + + /** + * Stops listening for new connections. Existing connections are not touched. + */ + void stopServer() { + stopServer = true; + if (serverSocket.isBound()) { + try { + serverSocket.close(); + } catch (IOException e) { + } + } + } + +} diff --git a/src/main/java/org/openmuc/jositransport/TConnection.java b/src/main/java/org/openmuc/jositransport/TConnection.java new file mode 100644 index 0000000..512b931 --- /dev/null +++ b/src/main/java/org/openmuc/jositransport/TConnection.java @@ -0,0 +1,683 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.jositransport; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.EOFException; +import java.io.IOException; +import java.net.Socket; +import java.net.SocketTimeoutException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeoutException; + +public final class TConnection { + + // private static final Logger logger = LoggerFactory.getLogger(TConnection.class); + + private final Socket socket; + private final DataOutputStream os; + private final DataInputStream is; + private static Integer connectionCounter = 0; + + public byte[] tSelRemote = null; + public byte[] tSelLocal = null; + + private int srcRef; + private int dstRef; + private int maxTPduSizeParam; + private int maxTPduSize; + private int messageTimeout; + private int messageFragmentTimeout; + + private boolean closed = false; + + private final ServerThread serverThread; + + TConnection(Socket socket, int maxTPduSizeParam, int messageTimeout, int messageFragmentTimeout, + ServerThread serverThread) throws IOException { + if (maxTPduSizeParam < 7 || maxTPduSizeParam > 16) { + throw new RuntimeException("maxTPduSizeParam is incorrect"); + } + this.socket = socket; + os = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); + is = new DataInputStream(new BufferedInputStream(socket.getInputStream())); + + synchronized (socket) { + connectionCounter++; + connectionCounter %= 65520; + if (connectionCounter == 0) { + connectionCounter = 1; // some servers do not like srcRef 0 + } + srcRef = connectionCounter; + } + + this.messageTimeout = messageTimeout; + this.messageFragmentTimeout = messageFragmentTimeout; + this.maxTPduSizeParam = maxTPduSizeParam; + maxTPduSize = ClientTSap.getMaxTPDUSize(maxTPduSizeParam); + + this.serverThread = serverThread; + } + + /** + * This function is called once a client has connected to the server. It listens for a Connection Request (CR). If + * this is successful it replies afterwards with a Connection Confirm (CC). According to the norm a syntax error in + * the CR should be followed by an ER. This implementation does not send an ER because it seems unnecessary. + * + * @throws IOException + */ + void listenForCR() throws IOException { + + socket.setSoTimeout(messageFragmentTimeout); + + byte myByte; + int lengthIndicator; + int parameterLength; + + // start reading rfc 1006 header + if (is.read() != 0x03) { + throw new IOException(); + } + if (is.read() != 0) { + throw new IOException(); + } + // read Packet length, but is not needed + is.readShort(); + // reading rfc 1006 header finished + + lengthIndicator = is.read() & 0xff; + // 0xe0 is the CR-Code + if ((is.read() & 0xff) != 0xe0) { + throw new IOException(); + } + // DST-REF needs to be 0 in a CR packet + if (is.readShort() != 0) { + throw new IOException(); + } + // read the srcRef which is the dstRef for this end-point + dstRef = is.readShort() & 0xffff; + // read class + if ((is.read() & 0xff) != 0) { + throw new IOException(); + } + int variableBytesRead = 0; + while (lengthIndicator > (6 + variableBytesRead)) { + // read parameter code + myByte = is.readByte(); + switch (myByte & 0xff) { + case 0xc2: + parameterLength = is.readByte() & 0xff; + + if (tSelLocal == null) { + tSelLocal = new byte[parameterLength]; + is.readFully(tSelLocal); + } + else { + if (parameterLength != tSelLocal.length) { + throw new IOException("local T-SElECTOR is wrong."); + } + for (int i = 0; i < parameterLength; i++) { + if ((tSelLocal[i] & 0xff) != is.read()) { + throw new IOException("local T-SElECTOR is wrong."); + } + } + } + variableBytesRead += 2 + parameterLength; + break; + case 0xc1: + parameterLength = is.readByte() & 0xff; + + if (tSelRemote == null) { + tSelRemote = new byte[parameterLength]; + is.readFully(tSelRemote); + } + else { + if (parameterLength != tSelRemote.length) { + throw new IOException("remote T-SElECTOR is wrong."); + } + for (int i = 0; i < parameterLength; i++) { + if ((tSelRemote[i] & 0xff) != is.read()) { + throw new IOException("remote T-SElECTOR is wrong."); + } + } + } + variableBytesRead += 2 + parameterLength; + break; + + case 0xc0: + if ((is.readByte() & 0xff) != 1) { + throw new IOException(); + } + myByte = is.readByte(); + int newMaxTPDUSizeParam = (myByte & 0xff); + if (newMaxTPDUSizeParam < 7 || newMaxTPDUSizeParam > 16) { + throw new IOException("maxTPDUSizeParam is out of bound"); + } + else { + if (newMaxTPDUSizeParam < maxTPduSizeParam) { + maxTPduSizeParam = newMaxTPDUSizeParam; + maxTPduSize = ClientTSap.getMaxTPDUSize(maxTPduSizeParam); + } + } + variableBytesRead += 3; + break; + default: + throw new IOException(); + } + + } + + // write RFC 1006 Header + os.write(0x03); + os.write(0x00); + // write complete packet length + + int variableLength = 3; + + if (tSelLocal != null) { + variableLength += 2 + tSelLocal.length; + } + if (tSelRemote != null) { + variableLength += 2 + tSelRemote.length; + } + os.writeShort(4 + 7 + variableLength); + + // write connection request (CR) TPDU (§13.3) + + // write length indicator + os.write(6 + variableLength); + + // write fixed part + // write CC CDT + os.write(0xd0); + // write DST-REF + os.writeShort(dstRef); + // write SRC-REF + os.writeShort(srcRef); + // write class + os.write(0); + + // write variable part + if (tSelLocal != null) { + os.write(0xc2); + os.write(tSelLocal.length); + os.write(tSelLocal); + } + + if (tSelRemote != null) { + os.write(0xc1); + os.write(tSelRemote.length); + os.write(tSelRemote); + } + // write proposed maximum TPDU Size + os.write(0xc0); + os.write(1); + os.write(maxTPduSizeParam); + + os.flush(); + + } + + /** + * Starts a connection, sends a CR, waits for a CC and throws an IOException if not successful + * + * @throws IOException + */ + void startConnection() throws IOException { + + // write RFC 1006 Header + os.write(0x03); + os.write(0x00); + + // write complete packet length + int variableLength = 3; + + if (tSelLocal != null) { + variableLength += 2 + tSelLocal.length; + } + if (tSelRemote != null) { + variableLength += 2 + tSelRemote.length; + } + os.writeShort(4 + 7 + variableLength); + // writing RFC 1006 Header finished + + // write connection request (CR) TPDU (§13.3) + + // write length indicator + os.write(6 + variableLength); + + // write fixed part + // write CR CDT + os.write(0xe0); + // write DST-REF + os.write(0); + os.write(0); + // write SRC-REF + os.writeShort(srcRef); + // write class + os.write(0); + + // write variable part + // write proposed maximum TPDU Size + os.write(0xc0); + os.write(1); + os.write(maxTPduSizeParam); + + if (tSelRemote != null) { + os.write(0xc2); + os.write(tSelRemote.length); + os.write(tSelRemote); + } + if (tSelLocal != null) { + os.write(0xc1); + os.write(tSelLocal.length); + os.write(tSelLocal); + } + + os.flush(); + + socket.setSoTimeout(messageTimeout); + + byte myByte; + int lengthIndicator; + int parameterLength; + if (is.readByte() != 0x03) { + throw new IOException(); + } + if (is.readByte() != 0) { + throw new IOException(); + } + // read packet length, but is not needed + is.readShort(); + lengthIndicator = is.readByte() & 0xff; + if ((is.readByte() & 0xff) != 0xd0) { + throw new IOException(); + } + // read the dstRef which is the srcRef for this end-point + is.readShort(); + // read the srcRef which is the dstRef for this end-point + dstRef = is.readShort() & 0xffff; + // read class + if (is.readByte() != 0) { + throw new IOException(); + } + + int variableBytesRead = 0; + while (lengthIndicator > (6 + variableBytesRead)) { + // read parameter code + myByte = is.readByte(); + switch (myByte & 0xff) { + + case 0xc1: + parameterLength = is.readByte() & 0xff; + + if (tSelLocal == null) { + tSelLocal = new byte[parameterLength]; + is.readFully(tSelLocal); + } + else { + for (int i = 0; i < parameterLength; i++) { + is.read(); + } + } + variableBytesRead += 2 + parameterLength; + break; + case 0xc2: + parameterLength = is.readByte() & 0xff; + + if (tSelRemote == null) { + tSelRemote = new byte[parameterLength]; + is.readFully(tSelRemote); + } + else { + for (int i = 0; i < parameterLength; i++) { + is.read(); + } + } + variableBytesRead += 2 + parameterLength; + break; + + case 0xc0: + if (is.readByte() != 1) { + throw new IOException("maxTPduSizeParam size is not equal to 1"); + } + myByte = is.readByte(); + if ((myByte & 0xff) < 7 || (myByte & 0xff) > maxTPduSizeParam) { + throw new IOException("maxTPduSizeParam out of bound"); + } + else { + if ((myByte & 0xff) < maxTPduSizeParam) { + maxTPduSizeParam = (myByte & 0xff); + } + } + variableBytesRead += 4; + break; + default: + throw new IOException(); + } + + } + + } + + public void send(List tsdus, List offsets, List lengths) throws IOException { + + int bytesLeft = 0; + // for (byte[] tsdu : tsdus) { + // bytesLeft += tsdu.length; + // } + for (int length : lengths) { + bytesLeft += length; + } + int tsduOffset = 0; + int byteArrayListIndex = 0; + int numBytesToWrite; + boolean lastPacket = false; + int maxTSDUSize = maxTPduSize - 3; + while (bytesLeft > 0) { + + if (bytesLeft > maxTSDUSize) { + numBytesToWrite = maxTSDUSize; + } + else { + numBytesToWrite = bytesLeft; + lastPacket = true; + } + + // --write RFC 1006 Header-- + // write Version + os.write(0x03); + // write reserved bits + os.write(0); + // write packet Length + os.writeShort(numBytesToWrite + 7); + + // --write 8073 Header-- + // write Length Indicator of header + os.write(0x02); + // write TPDU Code for DT Data + os.write(0xf0); + // write TPDU-NR and EOT, TPDU-NR is always 0 for class 0 + if (lastPacket) { + os.write(0x80); + } + else { + os.write(0x00); + } + + bytesLeft -= numBytesToWrite; + while (numBytesToWrite > 0) { + byte[] tsdu = tsdus.get(byteArrayListIndex); + int length = lengths.get(byteArrayListIndex); + int offset = offsets.get(byteArrayListIndex); + + int tsduWriteLength = length - tsduOffset; + + if (numBytesToWrite > tsduWriteLength) { + os.write(tsdu, offset + tsduOffset, tsduWriteLength); + numBytesToWrite -= tsduWriteLength; + tsduOffset = 0; + byteArrayListIndex++; + } + else { + os.write(tsdu, offset + tsduOffset, numBytesToWrite); + if (numBytesToWrite == tsduWriteLength) { + tsduOffset = 0; + byteArrayListIndex++; + } + else { + tsduOffset += numBytesToWrite; + } + numBytesToWrite = 0; + } + } + + os.flush(); + } + } + + public void send(byte[] tsdu, int offset, int length) throws IOException { + List tsdus = new ArrayList<>(); + tsdus.add(tsdu); + List offsets = new ArrayList<>(); + offsets.add(offset); + List lengths = new ArrayList<>(); + lengths.add(length); + send(tsdus, offsets, lengths); + } + + public int getMessageTimeout() { + return messageTimeout; + } + + /** + * Set the TConnection timeout for waiting for the first byte of a new message. Default is 0 (unlimited) + * + * @param messageTimeout + * in milliseconds + */ + public void setMessageTimeout(int messageTimeout) { + this.messageTimeout = messageTimeout; + } + + public int getMessageFragmentTimeout() { + return messageFragmentTimeout; + } + + /** + * Set the TConnection timeout for receiving data once the beginning of a message has been received. Default is + * 60000 (60 seconds) + * + * @param messageFragmentTimeout + * in milliseconds + */ + public void setMessageFragmentTimeout(int messageFragmentTimeout) { + this.messageFragmentTimeout = messageFragmentTimeout; + } + + /** + * Listens for a new TPDU and writes the extracted TSDU into the passed buffer. + * + * @param tSduBuffer + * the buffer that is filled with the received TSDU data. + * @throws EOFException + * if a Disconnect Request (DR) was received or the socket was simply closed + * @throws SocketTimeoutException + * if a messageFragmentTimeout is thrown by the socket while receiving the remainder of a message + * @throws IOException + * if an ErrorPDU (ER) was received, any syntax error in the received message header was detected or the + * tSduBuffer is too small to hold the complete PDU. + * @throws TimeoutException + * this exception is thrown if the first byte of new message is not received within the message timeout. + */ + public void receive(ByteBuffer tSduBuffer) + throws EOFException, SocketTimeoutException, IOException, TimeoutException { + + tSduBuffer.mark(); + + int packetLength; + int eot = 0; + int li = 0; + int tPduCode; + + socket.setSoTimeout(messageTimeout); + byte version; + try { + version = is.readByte(); + } catch (SocketTimeoutException e) { + throw (new TimeoutException()); + } + socket.setSoTimeout(messageFragmentTimeout); + + do { + // read version + if (version != 3) { + throw new IOException("Syntax error at beginning of RFC1006 header: version not equal to 3"); + } + + // read reserved + if (is.readByte() != 0) { + throw new IOException("Syntax errorat beginning of RFC1006 header: reserved not equal to 0"); + } + + // read packet length + packetLength = is.readShort() & 0xffff; + if (packetLength <= 7) { + throw new IOException("Syntax error: packet length parameter < 7"); + } + + // read length indicator + li = is.readByte() & 0xff; + + // read TPDU code + tPduCode = is.readByte() & 0xff; + + if (tPduCode == 0xf0) { + // Data Transfer (DT) Code + + if (li != 2) { + throw new IOException("Syntax error: LI field does not equal 2"); + } + + // read EOT + eot = is.readByte() & 0xff; + if (eot != 0 && eot != 0x80) { + throw new IOException("Syntax error: eot wrong"); + } + + if (packetLength - 7 > tSduBuffer.limit() - tSduBuffer.position()) { + throw new IOException("tSduBuffer size is too small to hold the complete TSDU"); + } + is.readFully(tSduBuffer.array(), tSduBuffer.arrayOffset() + tSduBuffer.position(), packetLength - 7); + tSduBuffer.position(tSduBuffer.position() + packetLength - 7); + } + else if (tPduCode == 0x80) { + // Disconnect Request (DR) + + if (li != 6) { + throw new IOException("Syntax error: LI field does not equal 6"); + } + + // check if the DST-REF field is set to the reference of the + // receiving entity -> srcRef + if (is.readShort() != srcRef) { + throw new IOException("Syntax error: srcRef wrong"); + } + + // check if the SRC-REF field is that of the entity sending + // the DR + if (is.readShort() != dstRef) { + throw new IOException("Syntax error: dstRef wrong"); + } + + // check the reason field, for class 0 only between 1 and 4 + int reason = is.readByte() & 0xff; + if (reason > 4) { + throw new IOException("Syntax error: reason out of bound"); + } + + // Disconnect is valid, throw exception + throw new EOFException("Disconnect request. Reason:" + reason); + + } + else if (tPduCode == 0x70) { + throw new IOException("Got TPDU error (ER) message"); + } + else { + throw new IOException("Syntax error: unknown TPDU code"); + } + + if (eot != 0x80) { + version = is.readByte(); + } + + } while (eot != 0x80); + + tSduBuffer.limit(tSduBuffer.position()); + tSduBuffer.reset(); + + } + + /** + * This function sends a Disconnect Request but does not wait for a Disconnect Confirm. + */ + public void disconnect() { + + try { + // write header for rfc + // write version + os.write(0x03); + // write reserved + os.write(0x00); + + // write packet length + os.writeShort(4 + 7); // this does not include the variable part + // which + // contains additional user information for + // disconnect + + // beginning of ISO 8073 header + // write LI + os.write(0x06); + + // write DR + os.write(0x80); + + // write DST-REF + os.writeShort(dstRef); + + // write SRC-REF + os.writeShort(srcRef); + + // write reason - 0x00 corresponds to reason not specified. Can + // write + // the reasons as case structure, but need input from client + os.write(0x00); + + os.flush(); + } catch (IOException e) { + } finally { + close(); + } + } + + /** + * Will close the TCP connection if its still open and free any resources of this connection. + */ + public void close() { + if (!closed) { + closed = true; + try { + // will also close socket + os.close(); + } catch (Exception e) { + } + try { + is.close(); + } catch (Exception e) { + } + if (serverThread != null) { + serverThread.connectionClosedSignal(); + } + } + } +} diff --git a/src/main/java/org/openmuc/jositransport/TConnectionListener.java b/src/main/java/org/openmuc/jositransport/TConnectionListener.java new file mode 100644 index 0000000..8b59b22 --- /dev/null +++ b/src/main/java/org/openmuc/jositransport/TConnectionListener.java @@ -0,0 +1,33 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.jositransport; + +import java.io.IOException; + +public interface TConnectionListener { + + public void connectionIndication(TConnection tConnection); + + /** + * This function is only called when an IOException in ServerSocket.accept() occurred which was not forced using + * ServerTSAP.stopListening() + * + * @param e + * The IOException caught form ServerSocket.accept() + */ + public void serverStoppedListeningIndication(IOException e); +} diff --git a/src/main/java/org/openmuc/openiec61850/AcseListener.java b/src/main/java/org/openmuc/openiec61850/AcseListener.java new file mode 100644 index 0000000..31db8bf --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/AcseListener.java @@ -0,0 +1,43 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.io.IOException; +import java.nio.ByteBuffer; + +import org.openmuc.josistack.AcseAssociation; +import org.openmuc.josistack.AcseAssociationListener; + +final class AcseListener implements AcseAssociationListener { + + ServerSap serverSap; + + AcseListener(ServerSap serverSap) { + this.serverSap = serverSap; + } + + @Override + public void connectionIndication(AcseAssociation acseAssociation, ByteBuffer psdu) { + serverSap.connectionIndication(acseAssociation, psdu); + } + + @Override + public void serverStoppedListeningIndication(IOException e) { + serverSap.serverStoppedListeningIndication(e); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/Array.java b/src/main/java/org/openmuc/openiec61850/Array.java new file mode 100644 index 0000000..c49fa08 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/Array.java @@ -0,0 +1,170 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.TypeSpecification; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned32; + +/** + * An Array can contain up to n instances of one and the same DataObject, ConstructedDataAttribute, or + * BasicDataAttribute. The children of the array have the name that equals the index in the array (e.g. "0","1" etc.) + * + * @author Stefan Feuerhahn + * + */ +public final class Array extends FcModelNode { + + private final List items; + + /** + * Creates an array object. + * + * @param objectReference + * the reference of the array + * @param fc + * the functional constraint of the array + * @param children + * the children of the array + */ + public Array(ObjectReference objectReference, Fc fc, List children) { + this.objectReference = objectReference; + this.fc = fc; + items = new ArrayList<>(children.size()); + for (ModelNode child : children) { + items.add(child); + child.setParent(this); + } + } + + @Override + public Collection getChildren() { + return new ArrayList<>(items); + } + + @Override + public Iterator iterator() { + return items.iterator(); + } + + @Override + public ModelNode getChild(String childName, Fc fc) { + return items.get(Integer.parseInt(childName)); + } + + public ModelNode getChild(int index) { + return items.get(index); + } + + @Override + public ModelNode copy() { + List itemsCopy = new ArrayList<>(items.size()); + for (ModelNode item : items) { + itemsCopy.add((FcModelNode) item.copy()); + } + return new Array(objectReference, fc, itemsCopy); + } + + @Override + public List getBasicDataAttributes() { + List subBasicDataAttributes = new LinkedList<>(); + for (ModelNode item : items) { + subBasicDataAttributes.addAll(item.getBasicDataAttributes()); + } + return subBasicDataAttributes; + } + + public int size() { + return items.size(); + } + + @Override + Data getMmsDataObj() { + + Data.Array dataArray = new Data.Array(); + List arrayDataList = dataArray.getData(); + + for (ModelNode modelNode : items) { + Data mmsArrayItem = modelNode.getMmsDataObj(); + if (mmsArrayItem == null) { + throw new IllegalArgumentException( + "Unable to convert Child: " + modelNode.objectReference + " to MMS Data Object."); + } + arrayDataList.add(mmsArrayItem); + } + + if (arrayDataList.size() == 0) { + throw new IllegalArgumentException("Converting ModelNode: " + objectReference + + " to MMS Data Object resulted in Sequence of size zero."); + } + + Data data = new Data(); + data.setArray(dataArray); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getArray() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: array"); + } + if (data.getArray().getData().size() != items.size()) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, + "expected type: array with " + children.size() + " elements"); + } + + Iterator iterator = data.getArray().getData().iterator(); + for (ModelNode child : items) { + child.setValueFromMmsDataObj(iterator.next()); + } + } + + @Override + TypeDescription getMmsTypeSpec() { + + TypeSpecification elementType = new TypeSpecification(); + elementType.setTypeDescription(items.get(0).getMmsTypeSpec()); + + TypeDescription.Array array = new TypeDescription.Array(); + array.setNumberOfElements(new Unsigned32(items.size())); + array.setElementType(elementType); + + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setArray(array); + + return typeDescription; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getReference().toString()).append(" [").append(fc).append("]"); + for (ModelNode childNode : items) { + sb.append("\n"); + sb.append(childNode.toString()); + } + return sb.toString(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BasicDataAttribute.java b/src/main/java/org/openmuc/openiec61850/BasicDataAttribute.java new file mode 100644 index 0000000..cbaebcd --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BasicDataAttribute.java @@ -0,0 +1,113 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +abstract public class BasicDataAttribute extends FcModelNode { + + BasicDataAttribute mirror; + + /** attribute value type */ + BdaType basicType = null; + + /** short address, can be used by SCSM and for local data mapping */ + String sAddr = null; + + boolean dchg; + boolean qchg; + boolean dupd; + + List chgRcbs = null; + List dupdRcbs = null; + + BasicDataAttribute(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + this.objectReference = objectReference; + this.fc = fc; + this.sAddr = sAddr; + this.dchg = dchg; + this.dupd = dupd; + + if (dchg) { + chgRcbs = new ArrayList<>(); + } + if (dupd) { + dupdRcbs = new ArrayList<>(); + } + } + + public boolean getDchg() { + return dchg; + } + + public boolean getDupd() { + return dupd; + } + + public boolean getQchg() { + return dupd; + } + + public BdaType getBasicType() { + return basicType; + } + + public String getSAddr() { + return sAddr; + } + + @Override + public ModelNode getChild(String childName, Fc fc) { + return null; + } + + @Override + public ModelNode getChild(String childName) { + return null; + } + + @Override + public Collection getChildren() { + return null; + } + + @Override + public Iterator iterator() { + return Collections.emptyList().iterator(); + } + + abstract public void setDefault(); + + @Override + public List getBasicDataAttributes() { + List subBasicDataAttributes = new LinkedList<>(); + subBasicDataAttributes.add(this); + return subBasicDataAttributes; + } + + abstract void setValueFrom(BasicDataAttribute bda); + + void setMirror(BasicDataAttribute bda) { + mirror = bda; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaBitString.java b/src/main/java/org/openmuc/openiec61850/BdaBitString.java new file mode 100644 index 0000000..9bafd5e --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaBitString.java @@ -0,0 +1,102 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.Integer32; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; + +abstract public class BdaBitString extends BasicDataAttribute { + + byte[] value; + final int maxNumBits; + + public BdaBitString(ObjectReference objectReference, Fc fc, String sAddr, int maxNumBits, boolean dchg, + boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + this.maxNumBits = maxNumBits; + } + + public byte[] getValue() { + return value; + } + + public void setValue(byte[] value) { + if (value.length != ((maxNumBits - 1) / 8 + 1)) { + throw new IllegalArgumentException("value does not have correct length."); + } + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + byte[] srcValue = ((BdaBitString) bda).getValue(); + if (value.length != srcValue.length) { + value = new byte[srcValue.length]; + } + System.arraycopy(srcValue, 0, value, 0, srcValue.length); + } + + public int getMaxNumBits() { + return maxNumBits; + } + + /** + * Initializes BIT_STRING with all zeros + */ + @Override + public void setDefault() { + value = new byte[(maxNumBits - 1) / 8 + 1]; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setBitString(new BerBitString(value, maxNumBits)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getBitString() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: bit_string"); + } + if (data.getBitString().numBits > maxNumBits) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, objectReference + + ": bit_string is bigger than type's size: " + data.getBitString().numBits + ">" + maxNumBits); + } + if (data.getBitString().numBits < maxNumBits) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, objectReference + + ": bit_string is smaller than type's size: " + data.getBitString().numBits + "<" + maxNumBits); + } + value = data.getBitString().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setBitString(new Integer32(maxNumBits * -1)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + HexConverter.toHexString(value); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaBoolean.java b/src/main/java/org/openmuc/openiec61850/BdaBoolean.java new file mode 100644 index 0000000..9543fca --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaBoolean.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerBoolean; +import org.openmuc.jasn1.ber.types.BerNull; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; + +public final class BdaBoolean extends BasicDataAttribute { + + private boolean value; + + public BdaBoolean(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.BOOLEAN; + setDefault(); + } + + public void setValue(boolean value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + value = ((BdaBoolean) bda).getValue(); + } + + public boolean getValue() { + return value; + } + + @Override + public void setDefault() { + value = false; + } + + @Override + public BdaBoolean copy() { + BdaBoolean copy = new BdaBoolean(objectReference, fc, sAddr, dchg, dupd); + copy.setValue(value); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setBool(new BerBoolean(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getBool() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: boolean"); + } + value = data.getBool().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setBool(new BerNull()); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + value; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaCheck.java b/src/main/java/org/openmuc/openiec61850/BdaCheck.java new file mode 100644 index 0000000..79fe74b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaCheck.java @@ -0,0 +1,79 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +/** + * + * Check packed list according to 61850-7-2 + * + */ +public final class BdaCheck extends BdaBitString { + + public BdaCheck(ObjectReference objectReference) { + super(objectReference, Fc.CO, null, 2, false, false); + basicType = BdaType.CHECK; + setDefault(); + } + + public boolean getSynchrocheck() { + return ((value[0] & 0x80) == 0x80); + } + + public boolean getInterlockCheck() { + return ((value[0] & 0x40) == 0x40); + } + + public void setSynchrocheck(boolean synchrocheck) { + if (synchrocheck) { + value[0] = (byte) (value[0] | 0x80); + } + else { + value[0] = (byte) (value[0] & 0x7f); + } + } + + public void setInterlockCheck(boolean interlockCheck) { + if (interlockCheck) { + value[0] = (byte) (value[0] | 0x40); + } + else { + value[0] = (byte) (value[0] & 0xbf); + } + } + + @Override + public BdaCheck copy() { + BdaCheck copy = new BdaCheck(objectReference); + + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + public String toString() { + return getReference().toString() + ": " + String.format("0x%x", value[0]); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaDoubleBitPos.java b/src/main/java/org/openmuc/openiec61850/BdaDoubleBitPos.java new file mode 100644 index 0000000..5978bf4 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaDoubleBitPos.java @@ -0,0 +1,98 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public final class BdaDoubleBitPos extends BdaBitString { + + public enum DoubleBitPos { + INTERMEDIATE_STATE(0), + OFF(1), + ON(2), + BAD_STATE(3); + private final int value; + + private DoubleBitPos(int value) { + this.value = value; + } + + public int getIntValue() { + return value; + } + } + + public BdaDoubleBitPos(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, 2, dchg, dupd); + basicType = BdaType.DOUBLE_BIT_POS; + setDefault(); + } + + /** + * Sets the value to DoubleBitPos.OFF + */ + @Override + public void setDefault() { + value = new byte[] { 0x40 }; + } + + @Override + public BdaDoubleBitPos copy() { + BdaDoubleBitPos copy = new BdaDoubleBitPos(objectReference, fc, sAddr, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + public DoubleBitPos getDoubleBitPos() { + + if ((value[0] & 0xC0) == 0xC0) { + return DoubleBitPos.BAD_STATE; + } + + if ((value[0] & 0x80) == 0x80) { + return DoubleBitPos.ON; + } + + if ((value[0] & 0x40) == 0x40) { + return DoubleBitPos.OFF; + } + + return DoubleBitPos.INTERMEDIATE_STATE; + } + + public void setDoubleBitPos(DoubleBitPos doubleBitPos) { + if (doubleBitPos == DoubleBitPos.BAD_STATE) { + value[0] = (byte) 0xC0; + } + else if (doubleBitPos == DoubleBitPos.ON) { + value[0] = (byte) 0x80; + } + else if (doubleBitPos == DoubleBitPos.OFF) { + value[0] = (byte) 0x40; + } + else { + value[0] = (byte) 0; + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaEntryTime.java b/src/main/java/org/openmuc/openiec61850/BdaEntryTime.java new file mode 100644 index 0000000..b4d4c50 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaEntryTime.java @@ -0,0 +1,134 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerBoolean; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TimeOfDay; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; + +/** + * + * BdaEntryTime stores time in terms of days and ms since 1984. + * + * @author Stefan Feuerhahn + * + */ +public final class BdaEntryTime extends BasicDataAttribute { + + private byte[] value; + + public BdaEntryTime(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.ENTRY_TIME; + setDefault(); + } + + /** + * Set the value of this object to the given timestamp, where timestamp is the number of ms since epoch 1970-01-01 + * 00:00:00 UTC. Note that timestamps before 1984 are not valid as they cannot be stored. + * + * @param timestamp + * the number of ms since epoch 1970-01-01 + */ + public void setTimestamp(long timestamp) { + long msSince1984 = timestamp - 441763200000l; + int days = (int) (msSince1984 / 86400000); + int ms = (int) (msSince1984 % 86400000); + value = new byte[] { (byte) (ms >> 24), (byte) (ms >> 16), (byte) (ms >> 8), (byte) (ms), (byte) (days >> 8), + (byte) days }; + } + + public long getTimestampValue() { + if (value.length != 6) { + return -1; + } + return ((value[0] & 0xffl) << 24) + ((value[1] & 0xffl) << 16) + ((value[2] & 0xffl) << 8) + (value[3] & 0xffl) + + (((value[4] & 0xffl) << 8) + (value[5] & 0xffl)) * 86400000l; + } + + public void setValue(byte[] value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + byte[] srcValue = ((BdaEntryTime) bda).getValue(); + if (value.length != srcValue.length) { + value = new byte[srcValue.length]; + } + System.arraycopy(srcValue, 0, value, 0, srcValue.length); + } + + public byte[] getValue() { + return value; + } + + /** + * Sets EntryTime to byte[6] with all zeros + */ + @Override + public void setDefault() { + value = new byte[6]; + } + + @Override + public BdaEntryTime copy() { + BdaEntryTime copy = new BdaEntryTime(objectReference, fc, sAddr, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + if (value == null) { + return null; + } + Data data = new Data(); + data.setBinaryTime(new TimeOfDay(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getBinaryTime() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: binary_time/EntryTime"); + } + value = data.getBinaryTime().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setBinaryTime(new BerBoolean(true)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + getTimestampValue(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaFloat32.java b/src/main/java/org/openmuc/openiec61850/BdaFloat32.java new file mode 100644 index 0000000..8d29d54 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaFloat32.java @@ -0,0 +1,117 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.nio.ByteBuffer; + +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.FloatingPoint; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaFloat32 extends BasicDataAttribute { + + private byte[] value; + + public BdaFloat32(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.FLOAT32; + setDefault(); + } + + public void setValue(byte[] value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + byte[] srcValue = ((BdaFloat32) bda).getValue(); + if (value.length != srcValue.length) { + value = new byte[srcValue.length]; + } + System.arraycopy(srcValue, 0, value, 0, srcValue.length); + } + + public void setFloat(Float value) { + this.value = ByteBuffer.allocate(1 + 4).put((byte) 8).putFloat(value).array(); + } + + public byte[] getValue() { + return value; + } + + public Float getFloat() { + return Float.intBitsToFloat(((0xff & value[1]) << 24) | ((0xff & value[2]) << 16) | ((0xff & value[3]) << 8) + | ((0xff & value[4]) << 0)); + } + + @Override + public void setDefault() { + value = new byte[] { 8, 0, 0, 0, 0 }; + } + + @Override + public BdaFloat32 copy() { + BdaFloat32 copy = new BdaFloat32(objectReference, fc, sAddr, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + if (value == null) { + return null; + } + Data data = new Data(); + data.setFloatingPoint(new FloatingPoint(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getFloatingPoint() == null || data.getFloatingPoint().value.length != 5) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, + "expected type: floating_point as an octet string of size 5"); + } + value = data.getFloatingPoint().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription.FloatingPoint floatingPointTypeDescription = new TypeDescription.FloatingPoint(); + floatingPointTypeDescription.setFormatWidth(new Unsigned8(32)); + floatingPointTypeDescription.setExponentWidth(new Unsigned8(8)); + + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setFloatingPoint(floatingPointTypeDescription); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + getFloat(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaFloat64.java b/src/main/java/org/openmuc/openiec61850/BdaFloat64.java new file mode 100644 index 0000000..cd03cd8 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaFloat64.java @@ -0,0 +1,124 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.nio.ByteBuffer; + +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.FloatingPoint; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaFloat64 extends BasicDataAttribute { + + private byte[] value = new byte[] { 11, 0, 0, 0, 0, 0, 0, 0, 0 }; + + public BdaFloat64(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.FLOAT64; + setDefault(); + } + + public void setValue(byte[] value) { + if (value != null && value.length != 9) { + throw new IllegalArgumentException("value does not have length 9"); + } + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + byte[] srcValue = ((BdaFloat64) bda).getValue(); + if (value.length != srcValue.length) { + value = new byte[srcValue.length]; + } + System.arraycopy(srcValue, 0, value, 0, srcValue.length); + } + + public void setDouble(Double value) { + this.value = ByteBuffer.allocate(1 + 8).put((byte) 11).putDouble(value).array(); + } + + public byte[] getValue() { + return value; + } + + public Double getDouble() { + if (value == null) { + return null; + } + return Double.longBitsToDouble(((0xffL & (value[1])) << 56) | ((0xffL & (value[2])) << 48) + | ((0xffL & (value[3])) << 40) | ((0xffL & (value[4])) << 32) | ((0xffL & (value[5])) << 24) + | ((0xffL & (value[6])) << 16) | ((0xffL & (value[7])) << 8) | ((0xffL & (value[8])) << 0)); + } + + @Override + public void setDefault() { + value = new byte[] { 11, 0, 0, 0, 0, 0, 0, 0, 0 }; + } + + @Override + public BdaFloat64 copy() { + BdaFloat64 copy = new BdaFloat64(objectReference, fc, sAddr, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + if (value == null) { + return null; + } + Data data = new Data(); + data.setFloatingPoint(new FloatingPoint(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getFloatingPoint() == null || data.getFloatingPoint().value.length != 9) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, + "expected type: floating_point as an octet string of size 9"); + } + value = data.getFloatingPoint().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription.FloatingPoint floatingPointTypeDescription = new TypeDescription.FloatingPoint(); + floatingPointTypeDescription.setFormatWidth(new Unsigned8(64)); + floatingPointTypeDescription.setExponentWidth(new Unsigned8(11)); + + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setFloatingPoint(floatingPointTypeDescription); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + getDouble(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaInt16.java b/src/main/java/org/openmuc/openiec61850/BdaInt16.java new file mode 100644 index 0000000..7ab81af --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaInt16.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaInt16 extends BasicDataAttribute { + + private short value; + + public BdaInt16(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.INT16; + setDefault(); + } + + public void setValue(short value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + value = ((BdaInt16) bda).getValue(); + } + + public short getValue() { + return value; + } + + @Override + public void setDefault() { + value = 0; + } + + @Override + public BdaInt16 copy() { + BdaInt16 copy = new BdaInt16(objectReference, fc, sAddr, dchg, dupd); + copy.setValue(value); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setInteger(new BerInteger(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getInteger() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: integer"); + } + value = data.getInteger().value.shortValue(); + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setInteger(new Unsigned8(16)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + value; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaInt16U.java b/src/main/java/org/openmuc/openiec61850/BdaInt16U.java new file mode 100644 index 0000000..3e9b34b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaInt16U.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaInt16U extends BasicDataAttribute { + + private int value; + + public BdaInt16U(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.INT16U; + setDefault(); + } + + public void setValue(int value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + value = ((BdaInt16U) bda).getValue(); + } + + public int getValue() { + return value; + } + + @Override + public void setDefault() { + value = 0; + } + + @Override + public BdaInt16U copy() { + BdaInt16U copy = new BdaInt16U(objectReference, fc, sAddr, dchg, dupd); + copy.setValue(value); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setUnsigned(new BerInteger(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getUnsigned() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: unsigned"); + } + value = data.getUnsigned().value.intValue(); + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setUnsigned(new Unsigned8(16)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + value; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaInt32.java b/src/main/java/org/openmuc/openiec61850/BdaInt32.java new file mode 100644 index 0000000..fabdfdc --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaInt32.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaInt32 extends BasicDataAttribute { + + private int value; + + public BdaInt32(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.INT32; + setDefault(); + } + + public void setValue(int value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + value = ((BdaInt32) bda).getValue(); + } + + public int getValue() { + return value; + } + + @Override + public void setDefault() { + value = 0; + } + + @Override + public BdaInt32 copy() { + BdaInt32 copy = new BdaInt32(objectReference, fc, sAddr, dchg, dupd); + copy.setValue(value); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setInteger(new BerInteger(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getInteger() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: integer"); + } + value = data.getInteger().value.intValue(); + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setInteger(new Unsigned8(32)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + value; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaInt32U.java b/src/main/java/org/openmuc/openiec61850/BdaInt32U.java new file mode 100644 index 0000000..926a962 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaInt32U.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaInt32U extends BasicDataAttribute { + + private long value; + + public BdaInt32U(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.INT32U; + setDefault(); + } + + public void setValue(long value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + value = ((BdaInt32U) bda).getValue(); + } + + public long getValue() { + return value; + } + + @Override + public void setDefault() { + value = 0; + } + + @Override + public BdaInt32U copy() { + BdaInt32U copy = new BdaInt32U(objectReference, fc, sAddr, dchg, dupd); + copy.setValue(value); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setUnsigned(new BerInteger(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getUnsigned() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: unsigned"); + } + value = data.getUnsigned().value.longValue(); + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setUnsigned(new Unsigned8(32)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + value; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaInt64.java b/src/main/java/org/openmuc/openiec61850/BdaInt64.java new file mode 100644 index 0000000..468d7d5 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaInt64.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaInt64 extends BasicDataAttribute { + + private long value; + + public BdaInt64(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.INT64; + setDefault(); + } + + public void setValue(long value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + value = ((BdaInt64) bda).getValue(); + } + + public long getValue() { + return value; + } + + @Override + public void setDefault() { + value = 0; + } + + @Override + public BdaInt64 copy() { + BdaInt64 copy = new BdaInt64(objectReference, fc, sAddr, dchg, dupd); + copy.setValue(value); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setInteger(new BerInteger(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getInteger() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: integer"); + } + value = data.getInteger().value.longValue(); + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setInteger(new Unsigned8(64)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + value; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaInt8.java b/src/main/java/org/openmuc/openiec61850/BdaInt8.java new file mode 100644 index 0000000..7edbe5b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaInt8.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaInt8 extends BasicDataAttribute { + + private byte value; + + public BdaInt8(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.INT8; + setDefault(); + } + + public void setValue(byte value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + value = ((BdaInt8) bda).getValue(); + } + + public byte getValue() { + return value; + } + + @Override + public void setDefault() { + value = 0; + } + + @Override + public BdaInt8 copy() { + BdaInt8 copy = new BdaInt8(objectReference, fc, sAddr, dchg, dupd); + copy.setValue(value); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setInteger(new BerInteger(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getInteger() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: integer"); + } + value = data.getInteger().value.byteValue(); + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setInteger(new Unsigned8(8)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + value; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaInt8U.java b/src/main/java/org/openmuc/openiec61850/BdaInt8U.java new file mode 100644 index 0000000..ee0d117 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaInt8U.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned8; + +public final class BdaInt8U extends BasicDataAttribute { + + private short value; + + public BdaInt8U(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.INT8U; + setDefault(); + } + + public void setValue(short value) { + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + value = ((BdaInt8U) bda).getValue(); + } + + public short getValue() { + return value; + } + + @Override + public void setDefault() { + value = 0; + } + + @Override + public BdaInt8U copy() { + BdaInt8U copy = new BdaInt8U(objectReference, fc, sAddr, dchg, dupd); + copy.setValue(value); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setUnsigned(new BerInteger(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getUnsigned() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: unsigned"); + } + value = data.getUnsigned().value.shortValue(); + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setUnsigned(new Unsigned8(8)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + value; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaOctetString.java b/src/main/java/org/openmuc/openiec61850/BdaOctetString.java new file mode 100644 index 0000000..f116144 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaOctetString.java @@ -0,0 +1,110 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.Arrays; + +import org.openmuc.jasn1.ber.types.BerOctetString; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.Integer32; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; + +public final class BdaOctetString extends BasicDataAttribute { + + private byte[] value; + private final int maxLength; + + public BdaOctetString(ObjectReference objectReference, Fc fc, String sAddr, int maxLength, boolean dchg, + boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.OCTET_STRING; + this.maxLength = maxLength; + setDefault(); + } + + public byte[] getValue() { + return value; + } + + public void setValue(byte[] value) { + if (value != null && value.length > maxLength) { + throw new IllegalArgumentException("OCTET_STRING value size exceeds maxLength of " + maxLength); + } + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + byte[] srcValue = ((BdaOctetString) bda).getValue(); + if (value.length != srcValue.length) { + value = new byte[srcValue.length]; + } + System.arraycopy(srcValue, 0, value, 0, srcValue.length); + } + + public int getMaxLength() { + return maxLength; + } + + @Override + public void setDefault() { + value = new byte[0]; + } + + @Override + public BdaOctetString copy() { + BdaOctetString copy = new BdaOctetString(objectReference, fc, sAddr, maxLength, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setOctetString(new BerOctetString(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getOctetString() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: octet_string"); + } + value = data.getOctetString().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setOctetString(new Integer32(maxLength * -1)); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + Arrays.toString(value); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaOptFlds.java b/src/main/java/org/openmuc/openiec61850/BdaOptFlds.java new file mode 100644 index 0000000..e42ad8b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaOptFlds.java @@ -0,0 +1,170 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public final class BdaOptFlds extends BdaBitString { + + public BdaOptFlds(ObjectReference objectReference, Fc fc) { + super(objectReference, fc, null, 10, false, false); + basicType = BdaType.OPTFLDS; + setDefault(); + } + + @Override + public void setDefault() { + /* default of buffer overflow is true by default in IEC 61850-6 sec. 9.3.8 */ + value = new byte[] { 0x02, 0x00 }; + } + + @Override + public BdaOptFlds copy() { + BdaOptFlds copy = new BdaOptFlds(objectReference, fc); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + public boolean isSequenceNumber() { + return (value[0] & 0x40) == 0x40; + } + + public boolean isReportTimestamp() { + return (value[0] & 0x20) == 0x20; + } + + public boolean isReasonForInclusion() { + return (value[0] & 0x10) == 0x10; + } + + /** + * Will the data set reference (not just the name) be included in the report. + * + * @return true if the data set reference (not just the name) will be included in the report + */ + public boolean isDataSetName() { + return (value[0] & 0x08) == 0x08; + } + + public boolean isDataReference() { + return (value[0] & 0x04) == 0x04; + } + + public boolean isBufferOverflow() { + return (value[0] & 0x02) == 0x02; + } + + public boolean isEntryId() { + return (value[0] & 0x01) == 0x01; + } + + public boolean isConfigRevision() { + return (value[1] & 0x80) == 0x80; + } + + public boolean isSegmentation() { + return (value[1] & 0x40) == 0x40; + } + + public void setSequenceNumber(boolean sequenceNumber) { + if (sequenceNumber) { + value[0] = (byte) (value[0] | 0x40); + } + else { + value[0] = (byte) (value[0] & 0xbf); + } + } + + public void setReportTimestamp(boolean reportTimestamp) { + if (reportTimestamp) { + value[0] = (byte) (value[0] | 0x20); + } + else { + value[0] = (byte) (value[0] & 0x2f); + } + } + + public void setReasonForInclusion(boolean reasonForInclusion) { + if (reasonForInclusion) { + value[0] = (byte) (value[0] | 0x10); + } + else { + value[0] = (byte) (value[0] & 0xef); + } + } + + public void setDataSetName(boolean dataSetName) { + if (dataSetName) { + value[0] = (byte) (value[0] | 0x08); + } + else { + value[0] = (byte) (value[0] & 0xf7); + } + } + + public void setDataReference(boolean dataReference) { + if (dataReference) { + value[0] = (byte) (value[0] | 0x04); + } + else { + value[0] = (byte) (value[0] & 0xfb); + } + } + + public void setBufferOverflow(boolean bufferOverflow) { + if (bufferOverflow) { + value[0] = (byte) (value[0] | 0x02); + } + else { + value[0] = (byte) (value[0] & 0xfd); + } + } + + public void setEntryId(boolean entryId) { + if (entryId) { + value[0] = (byte) (value[0] | 0x01); + } + else { + value[0] = (byte) (value[0] & 0xfe); + } + } + + public void setConfigRevision(boolean configRevision) { + if (configRevision) { + value[1] = (byte) (value[1] | 0x80); + } + else { + value[1] = (byte) (value[1] & 0x7f); + } + } + + public void setSegmentation(boolean segmentation) { + if (segmentation) { + value[1] = (byte) (value[1] | 0x40); + } + else { + value[1] = (byte) (value[1] & 0xbf); + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaQuality.java b/src/main/java/org/openmuc/openiec61850/BdaQuality.java new file mode 100644 index 0000000..c172a0b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaQuality.java @@ -0,0 +1,250 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; + +public final class BdaQuality extends BdaBitString { + + public enum Validity { + GOOD(0), + INVALID(1), + RESERVED(2), + QUESTIONABLE(3); + private final int value; + + private Validity(int value) { + this.value = value; + } + + public int getIntValue() { + return value; + } + } + + public BdaQuality(ObjectReference objectReference, Fc fc, String sAddr, boolean qchg) { + super(objectReference, fc, sAddr, 13, false, false); + this.qchg = qchg; + basicType = BdaType.QUALITY; + if (qchg) { + chgRcbs = new ArrayList<>(); + } + setDefault(); + } + + @Override + public void setDefault() { + value = new byte[] { 0x00, 0x00 }; + } + + @Override + public BdaQuality copy() { + BdaQuality copy = new BdaQuality(objectReference, fc, sAddr, qchg); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + public Validity getValidity() { + if ((value[0] & 0xC0) == 0xC0) { + return Validity.QUESTIONABLE; + } + + if ((value[0] & 0x80) == 0x80) { + return Validity.RESERVED; + } + + if ((value[0] & 0x40) == 0x40) { + return Validity.INVALID; + } + + return Validity.GOOD; + } + + public boolean isOverflow() { + return (value[0] & 0x20) == 0x20; + } + + public boolean isOutOfRange() { + return (value[0] & 0x10) == 0x10; + } + + public boolean isBadReference() { + return (value[0] & 0x08) == 0x08; + } + + public boolean isOscillatory() { + return (value[0] & 0x04) == 0x04; + } + + public boolean isFailure() { + return (value[0] & 0x02) == 0x02; + } + + public boolean isOldData() { + return (value[0] & 0x01) == 0x01; + } + + public boolean isInconsistent() { + return (value[1] & 0x80) == 0x80; + } + + public boolean isInaccurate() { + return (value[1] & 0x40) == 0x40; + } + + public boolean isSubstituted() { + return (value[1] & 0x20) == 0x20; + } + + public boolean isTest() { + return (value[1] & 0x10) == 0x10; + } + + public boolean isOperatorBlocked() { + return (value[1] & 0x08) == 0x08; + } + + public void setValidity(Validity validity) { + if (validity == Validity.QUESTIONABLE) { + value[0] = (byte) (value[0] | 0xC0); + } + else if (validity == Validity.RESERVED) { + value[0] = (byte) (value[0] | 0x80); + value[0] = (byte) (value[0] & 0xbf); + } + else if (validity == Validity.INVALID) { + value[0] = (byte) (value[0] & 0x7f); + value[0] = (byte) (value[0] | 0x40); + } + else { + value[0] = (byte) (value[0] & 0x03); + } + } + + public void setOverflow(boolean overflow) { + if (overflow) { + value[0] = (byte) (value[0] | 0x20); + } + else { + value[0] = (byte) (value[0] & 0xdf); + } + } + + public void setOutOfRange(boolean outOfRange) { + if (outOfRange) { + value[0] = (byte) (value[0] | 0x10); + } + else { + value[0] = (byte) (value[0] & 0xef); + } + } + + public void setBadReference(boolean badReference) { + if (badReference) { + value[0] = (byte) (value[0] | 0x08); + } + else { + value[0] = (byte) (value[0] & 0xf7); + } + } + + public void setOscillatory(boolean oscillatory) { + if (oscillatory) { + value[0] = (byte) (value[0] | 0x04); + } + else { + value[0] = (byte) (value[0] & 0xfb); + } + } + + public void setFailure(boolean failure) { + if (failure) { + value[0] = (byte) (value[0] | 0x02); + } + else { + value[0] = (byte) (value[0] & 0xfd); + } + } + + public void setOldData(boolean oldData) { + if (oldData) { + value[0] = (byte) (value[0] | 0x01); + } + else { + value[0] = (byte) (value[0] & 0xfe); + } + } + + public void setInconsistent(boolean inconsistent) { + if (inconsistent) { + value[1] = (byte) (value[0] | 0x80); + } + else { + value[1] = (byte) (value[0] & 0x7f); + } + } + + public void setInaccurate(boolean inaccurate) { + if (inaccurate) { + value[1] = (byte) (value[0] | 0x40); + } + else { + value[1] = (byte) (value[0] & 0xbf); + } + } + + public void setSubstituted(boolean substituted) { + if (substituted) { + value[1] = (byte) (value[0] | 0x20); + } + else { + value[1] = (byte) (value[0] & 0xdf); + } + } + + public void setTest(boolean test) { + if (test) { + value[1] = (byte) (value[0] | 0x10); + } + else { + value[1] = (byte) (value[0] & 0xef); + } + } + + public void setOperatorBlocked(boolean operatorBlocked) { + if (operatorBlocked) { + value[1] = (byte) (value[0] | 0x08); + } + else { + value[1] = (byte) (value[0] & 0xf7); + } + } + + @Override + public String toString() { + return getReference().toString() + ": " + String.format("0x%x, 0x%x", value[0], value[1]); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaReasonForInclusion.java b/src/main/java/org/openmuc/openiec61850/BdaReasonForInclusion.java new file mode 100644 index 0000000..6dab5bc --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaReasonForInclusion.java @@ -0,0 +1,120 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public final class BdaReasonForInclusion extends BdaBitString { + + public BdaReasonForInclusion(ObjectReference objectReference) { + super(objectReference, null, null, 7, false, false); + basicType = BdaType.REASON_FOR_INCLUSION; + setDefault(); + } + + @Override + public BdaReasonForInclusion copy() { + BdaReasonForInclusion copy = new BdaReasonForInclusion(objectReference); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + public boolean isDataChange() { + return (value[0] & 0x40) == 0x40; + } + + public boolean isQualityChange() { + return (value[0] & 0x20) == 0x20; + } + + public boolean isDataUpdate() { + return (value[0] & 0x10) == 0x10; + } + + public boolean isIntegrity() { + return (value[0] & 0x08) == 0x08; + } + + public boolean isGeneralInterrogation() { + return (value[0] & 0x04) == 0x04; + } + + public boolean isApplicationTrigger() { + return (value[0] & 0x02) == 0x02; + } + + public void setDataChange(boolean dataChange) { + if (dataChange) { + value[0] = (byte) (value[0] | 0x40); + } + else { + value[0] = (byte) (value[0] & 0xbf); + } + } + + public void setQualityChange(boolean qualityChange) { + if (qualityChange) { + value[0] = (byte) (value[0] | 0x20); + } + else { + value[0] = (byte) (value[0] & 0xdf); + } + } + + public void setDataUpdate(boolean dataUpdate) { + if (dataUpdate) { + value[0] = (byte) (value[0] | 0x10); + } + else { + value[0] = (byte) (value[0] & 0xef); + } + } + + public void setIntegrity(boolean integrity) { + if (integrity) { + value[0] = (byte) (value[0] | 0x08); + } + else { + value[0] = (byte) (value[0] & 0xf7); + } + } + + public void setGeneralInterrogation(boolean generalInterrogation) { + if (generalInterrogation) { + value[0] = (byte) (value[0] | 0x04); + } + else { + value[0] = (byte) (value[0] & 0xfb); + } + } + + public void setApplicationTrigger(boolean applicationTrigger) { + if (applicationTrigger) { + value[0] = (byte) (value[0] | 0x02); + } + else { + value[0] = (byte) (value[0] & 0xfd); + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaTapCommand.java b/src/main/java/org/openmuc/openiec61850/BdaTapCommand.java new file mode 100644 index 0000000..cc67b4a --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaTapCommand.java @@ -0,0 +1,99 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public final class BdaTapCommand extends BdaBitString { + + public enum TapCommand { + STOP(0), + LOWER(1), + HIGHER(2), + RESERVED(3); + private final int value; + + private TapCommand(int value) { + this.value = value; + } + + public int getIntValue() { + return value; + } + } + + public BdaTapCommand(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, 2, dchg, dupd); + basicType = BdaType.TAP_COMMAND; + setDefault(); + } + + /** + * Sets the value to TapCommand.STOP + */ + @Override + public void setDefault() { + value = new byte[] { 0x00 }; + } + + @Override + public BdaTapCommand copy() { + BdaTapCommand copy = new BdaTapCommand(objectReference, fc, sAddr, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + public TapCommand getTapCommand() { + + if ((value[0] & 0xC0) == 0xC0) { + return TapCommand.RESERVED; + } + + if ((value[0] & 0x80) == 0x80) { + return TapCommand.HIGHER; + } + + if ((value[0] & 0x40) == 0x40) { + return TapCommand.LOWER; + } + + return TapCommand.STOP; + + } + + public void setTapCommand(TapCommand tapCommand) { + if (tapCommand == TapCommand.RESERVED) { + value[0] = (byte) 0xC0; + } + else if (tapCommand == TapCommand.HIGHER) { + value[0] = (byte) 0x80; + } + else if (tapCommand == TapCommand.LOWER) { + value[0] = (byte) 0x40; + } + else { + value[0] = (byte) 0x00; + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaTimestamp.java b/src/main/java/org/openmuc/openiec61850/BdaTimestamp.java new file mode 100644 index 0000000..3f41ac9 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaTimestamp.java @@ -0,0 +1,244 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.Calendar; +import java.util.Date; + +import org.openmuc.jasn1.ber.types.BerNull; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.UtcTime; + +public final class BdaTimestamp extends BasicDataAttribute { + + private byte[] value; + + public BdaTimestamp(ObjectReference objectReference, Fc fc, String sAddr, boolean dchg, boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.TIMESTAMP; + setDefault(); + } + + /** + * The SecondSinceEpoch shall be the interval in seconds continuously counted from the epoch 1970-01-01 00:00:00 UTC + */ + + /** + * Returns the value as the number of seconds since epoch 1970-01-01 00:00:00 UTC + * + * @return the number of seconds since epoch 1970-01-01 00:00:00 UTC + */ + private long getSecondsSinceEpoch() { + return ((0xffL & value[0]) << 24 | (0xffL & value[1]) << 16 | (0xffL & value[2]) << 8 | (0xffL & value[3])); + } + + /** + * The attribute FractionOfSecond shall be the fraction of the current second when the value of the TimeStamp has + * been determined. The fraction of second shall be calculated as + * (SUM from I = 0 to 23 of bi*2**–(I+1) s). + * + * NOTE 1 The resolution is the smallest unit by which the time stamp is updated. The 24 bits of the integer + * provides 1 out of 16777216 counts as the smallest unit; calculated by 1/2**24 which equals approximately 60 ns. + * + * NOTE 2 The resolution of a time stamp may be 1/2**1 (= 0,5 s) if only the first bit is used; or may be 1/2**2 (= + * 0,25 s) if the first two bits are used; or may be approximately 60 ns if all 24 bits are used. The resolution + * provided by an IED is outside the scope of this standard. + * + * @return the fraction of seconds + */ + private int getFractionOfSecond() { + return ((0xff & value[4]) << 16 | (0xff & value[5]) << 8 | (0xff & value[6])); + } + + public void setDate(Date date) { + if (value == null) { + value = new byte[8]; + } + + int secondsSinceEpoch = (int) (date.getTime() / 1000L); + int fractionOfSecond = (int) ((date.getTime() % 1000L) / 1000.0 * (1 << 24)); + + // 0x8a = time accuracy of 10 and LeapSecondsKnown = true, ClockFailure + // = false, ClockNotSynchronized = false + value = new byte[] { (byte) ((secondsSinceEpoch >> 24) & 0xff), (byte) ((secondsSinceEpoch >> 16) & 0xff), + (byte) ((secondsSinceEpoch >> 8) & 0xff), (byte) (secondsSinceEpoch & 0xff), + (byte) ((fractionOfSecond >> 16) & 0xff), (byte) ((fractionOfSecond >> 8) & 0xff), + (byte) (fractionOfSecond & 0xff), (byte) 0x8a }; + + } + + public void setDate(Date date, boolean leapSecondsKnown, boolean clockFailure, boolean clockNotSynchronized, + int timeAccuracy) { + if (value == null) { + value = new byte[8]; + } + + int secondsSinceEpoch = (int) (date.getTime() / 1000L); + int fractionOfSecond = (int) ((date.getTime() % 1000L) / 1000.0 * (1 << 24)); + + int timeQuality = timeAccuracy & 0x1f; + if (leapSecondsKnown) { + timeQuality = timeQuality | 0x80; + } + if (clockFailure) { + timeQuality = timeQuality | 0x40; + } + if (clockNotSynchronized) { + timeQuality = timeQuality | 0x20; + } + + value = new byte[] { (byte) ((secondsSinceEpoch >> 24) & 0xff), (byte) ((secondsSinceEpoch >> 16) & 0xff), + (byte) ((secondsSinceEpoch >> 8) & 0xff), (byte) (secondsSinceEpoch & 0xff), + (byte) ((fractionOfSecond >> 16) & 0xff), (byte) ((fractionOfSecond >> 8) & 0xff), + (byte) (fractionOfSecond & 0xff), (byte) timeQuality }; + + } + + public void setValue(byte[] value) { + if (value == null) { + this.value = new byte[8]; + } + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + byte[] srcValue = ((BdaTimestamp) bda).getValue(); + if (value.length != srcValue.length) { + value = new byte[srcValue.length]; + } + System.arraycopy(srcValue, 0, value, 0, srcValue.length); + } + + public Date getDate() { + if (value == null || value.length == 0) { + return null; + } + long time = getSecondsSinceEpoch() * 1000L + (long) (((float) getFractionOfSecond()) / (1 << 24) * 1000 + 0.5); + return new Date(time); + } + + public byte[] getValue() { + return value; + } + + /** + * The value TRUE of the attribute LeapSecondsKnown shall indicate that the value for SecondSinceEpoch takes into + * account all leap seconds occurred. If it is FALSE then the value does not take into account the leap seconds that + * occurred before the initialization of the time source of the device. + * + * Java {@link Date} and {@link Calendar} objects do handle leap seconds, so this is usually true. + * + * @return TRUE of the attribute LeapSecondsKnown shall indicate that the value for SecondSinceEpoch takes into + * account all leap seconds occurred + */ + public boolean getLeapSecondsKnown() { + return ((value[7] & 0x80) != 0); + } + + /** + * The attribute clockFailure shall indicate that the time source of the sending device is unreliable. The value of + * the TimeStamp shall be ignored. + * + * @return true if the time source of the sending device is unreliable + */ + public boolean getClockFailure() { + return ((value[7] & 0x40) != 0); + } + + /** + * The attribute clockNotSynchronized shall indicate that the time source of the sending device is not synchronized + * with the external UTC time. + * + * @return true if the time source of the sending device is not synchronized + */ + public boolean getClockNotSynchronized() { + return ((value[7] & 0x20) != 0); + } + + /** + * The attribute TimeAccuracy shall represent the time accuracy class of the time source of the sending device + * relative to the external UTC time. The timeAccuracy classes shall represent the number of significant bits in the + * FractionOfSecond + * + * If the time is set via Java {@link Date} objects, the accuracy is 1 ms, that is a timeAccuracy value of 10. + * + * @return the time accuracy + */ + public int getTimeAccuracy() { + return ((value[7] & 0x1f)); + } + + /** + * Sets Timestamp the empty byte array (indicating an invalid Timestamp) + */ + @Override + public void setDefault() { + value = new byte[8]; + } + + /** + * Sets Timestamp to current time + */ + public void setCurrentTime() { + setDate(new Date()); + } + + @Override + public BdaTimestamp copy() { + BdaTimestamp copy = new BdaTimestamp(objectReference, fc, sAddr, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setUtcTime(new UtcTime(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getUtcTime() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: utc_time/timestamp"); + } + value = data.getUtcTime().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setUtcTime(new BerNull()); + return typeDescription; + } + + @Override + public String toString() { + return getReference().toString() + ": " + getDate(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaTriggerConditions.java b/src/main/java/org/openmuc/openiec61850/BdaTriggerConditions.java new file mode 100644 index 0000000..3d3ccc6 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaTriggerConditions.java @@ -0,0 +1,113 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public final class BdaTriggerConditions extends BdaBitString { + + public BdaTriggerConditions(ObjectReference objectReference, Fc fc) { + super(objectReference, fc, null, 6, false, false); + basicType = BdaType.TRIGGER_CONDITIONS; + setDefault(); + } + + @Override + public void setDefault() { + /* default of GI is true by default in IEC 61850-6 sec. 9.3.8 */ + value = new byte[] { 0x04 }; + } + + @Override + public BdaTriggerConditions copy() { + BdaTriggerConditions copy = new BdaTriggerConditions(objectReference, fc); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + public boolean isDataChange() { + return (value[0] & 0x40) == 0x40; + } + + public boolean isQualityChange() { + return (value[0] & 0x20) == 0x20; + } + + public boolean isDataUpdate() { + return (value[0] & 0x10) == 0x10; + } + + public boolean isIntegrity() { + return (value[0] & 0x08) == 0x08; + } + + public boolean isGeneralInterrogation() { + return (value[0] & 0x04) == 0x04; + } + + public void setDataChange(boolean dataChange) { + if (dataChange) { + value[0] = (byte) (value[0] | 0x40); + } + else { + value[0] = (byte) (value[0] & 0xbf); + } + } + + public void setQualityChange(boolean qualityChange) { + if (qualityChange) { + value[0] = (byte) (value[0] | 0x20); + } + else { + value[0] = (byte) (value[0] & 0xdf); + } + } + + public void setDataUpdate(boolean dataUpdate) { + if (dataUpdate) { + value[0] = (byte) (value[0] | 0x10); + } + else { + value[0] = (byte) (value[0] & 0xef); + } + } + + public void setIntegrity(boolean integrity) { + if (integrity) { + value[0] = (byte) (value[0] | 0x08); + } + else { + value[0] = (byte) (value[0] & 0xf7); + } + } + + public void setGeneralInterrogation(boolean generalInterrogation) { + if (generalInterrogation) { + value[0] = (byte) (value[0] | 0x04); + } + else { + value[0] = (byte) (value[0] & 0xfb); + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaType.java b/src/main/java/org/openmuc/openiec61850/BdaType.java new file mode 100644 index 0000000..681f6c5 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaType.java @@ -0,0 +1,48 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +/** + * This Enumeration includes all possible Types for IEC 61850 leave nodes ( {@link BasicDataAttribute}). This includes + * BasicTypes and CommonACSITypes as defined in part 7-2. + * + */ +public enum BdaType { + + BOOLEAN, + INT8, + INT16, + INT32, + INT64, + INT8U, + INT16U, + INT32U, + FLOAT32, + FLOAT64, + OCTET_STRING, + VISIBLE_STRING, + UNICODE_STRING, + TIMESTAMP, + ENTRY_TIME, + CHECK, + QUALITY, + DOUBLE_BIT_POS, + TAP_COMMAND, + TRIGGER_CONDITIONS, + OPTFLDS, + REASON_FOR_INCLUSION; +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaUnicodeString.java b/src/main/java/org/openmuc/openiec61850/BdaUnicodeString.java new file mode 100644 index 0000000..f3221f6 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaUnicodeString.java @@ -0,0 +1,112 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.Integer32; +import org.openmuc.openiec61850.internal.mms.asn1.MMSString; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; + +public final class BdaUnicodeString extends BasicDataAttribute { + + private byte[] value; + private final int maxLength; + + public BdaUnicodeString(ObjectReference objectReference, Fc fc, String sAddr, int maxLength, boolean dchg, + boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.UNICODE_STRING; + this.maxLength = maxLength; + setDefault(); + } + + public byte[] getValue() { + return value; + } + + public void setValue(byte[] value) { + if (value == null || value.length > maxLength) { + throw new IllegalArgumentException( + "Value was null or UNICODE_STRING value size exceeds maxLength of " + maxLength); + } + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + byte[] srcValue = ((BdaUnicodeString) bda).getValue(); + if (value.length != srcValue.length) { + value = new byte[srcValue.length]; + } + System.arraycopy(srcValue, 0, value, 0, srcValue.length); + } + + public int getMaxLength() { + return maxLength; + } + + @Override + public void setDefault() { + value = new byte[0]; + } + + @Override + public BdaUnicodeString copy() { + BdaUnicodeString copy = new BdaUnicodeString(objectReference, fc, sAddr, maxLength, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setMMSString(new MMSString(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getMMSString() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: mms_string/unicode_string"); + } + value = data.getMMSString().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setMMSString(new Integer32(maxLength * -1)); + return typeDescription; + } + + @Override + public String toString() { + if (value == null) { + return getReference().toString() + ": null"; + } + return getReference().toString() + ": " + new String(value); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/BdaVisibleString.java b/src/main/java/org/openmuc/openiec61850/BdaVisibleString.java new file mode 100644 index 0000000..c6a813f --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/BdaVisibleString.java @@ -0,0 +1,123 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import org.openmuc.jasn1.ber.types.string.BerVisibleString; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.Integer32; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; + +public final class BdaVisibleString extends BasicDataAttribute { + + private byte[] value; + private final int maxLength; + + public BdaVisibleString(ObjectReference objectReference, Fc fc, String sAddr, int maxLength, boolean dchg, + boolean dupd) { + super(objectReference, fc, sAddr, dchg, dupd); + basicType = BdaType.VISIBLE_STRING; + this.maxLength = maxLength; + setDefault(); + } + + public byte[] getValue() { + return value; + } + + public void setValue(byte[] value) { + if (value == null || value.length > maxLength) { + throw new IllegalArgumentException( + "value was null or VISIBLE_STRING value size exceeds maxLength of " + maxLength); + } + this.value = value; + } + + @Override + void setValueFrom(BasicDataAttribute bda) { + byte[] srcValue = ((BdaVisibleString) bda).getValue(); + if (value.length != srcValue.length) { + value = new byte[srcValue.length]; + } + System.arraycopy(srcValue, 0, value, 0, srcValue.length); + } + + public void setValue(String value) { + setValue(value.getBytes()); + } + + public int getMaxLength() { + return maxLength; + } + + public String getStringValue() { + return new String(value); + } + + @Override + public void setDefault() { + value = new byte[0]; + } + + @Override + public BdaVisibleString copy() { + BdaVisibleString copy = new BdaVisibleString(objectReference, fc, sAddr, maxLength, dchg, dupd); + byte[] valueCopy = new byte[value.length]; + System.arraycopy(value, 0, valueCopy, 0, value.length); + copy.setValue(valueCopy); + if (mirror == null) { + copy.mirror = this; + } + else { + copy.mirror = mirror; + } + return copy; + } + + @Override + Data getMmsDataObj() { + Data data = new Data(); + data.setVisibleString(new BerVisibleString(value)); + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getVisibleString() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: visible_string"); + } + value = data.getVisibleString().value; + } + + @Override + TypeDescription getMmsTypeSpec() { + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setVisibleString(new Integer32(maxLength * -1)); + return typeDescription; + } + + @Override + public String toString() { + if (value == null) { + return getReference().toString() + ": null"; + } + if (value.length == 0 || value[0] == (byte) 0) { + return getReference().toString() + ": ''"; + } + return getReference().toString() + ": " + new String(value); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/Brcb.java b/src/main/java/org/openmuc/openiec61850/Brcb.java new file mode 100644 index 0000000..7982110 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/Brcb.java @@ -0,0 +1,59 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.List; + +public class Brcb extends Rcb { + + public Brcb(ObjectReference objectReference, List children) { + super(objectReference, Fc.BR, children); + } + + public BdaBoolean getPurgeBuf() { + return (BdaBoolean) children.get("PurgeBuf"); + } + + public BdaOctetString getEntryId() { + return (BdaOctetString) children.get("EntryID"); + } + + public BdaEntryTime getTimeOfEntry() { + return (BdaEntryTime) children.get("TimeOfEntry"); + } + + /** + * Gets the ResvTms attribute. This attribute is optional. Will return NULL if the attribute is not available. + * + * @return the ResvTms attribute, null if not available. + */ + public BdaInt16 getResvTms() { + return (BdaInt16) children.get("ResvTms"); + } + + @Override + public FcDataObject copy() { + List childCopies = new ArrayList<>(children.size()); + for (ModelNode childNode : children.values()) { + childCopies.add((FcModelNode) childNode.copy()); + } + Brcb brcb = new Brcb(objectReference, childCopies); + brcb.dataSet = dataSet; + return brcb; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/ClientAssociation.java b/src/main/java/org/openmuc/openiec61850/ClientAssociation.java new file mode 100644 index 0000000..389d3a0 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ClientAssociation.java @@ -0,0 +1,1772 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.jasn1.ber.types.BerBoolean; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerNull; +import org.openmuc.jasn1.ber.types.string.BerVisibleString; +import org.openmuc.josistack.AcseAssociation; +import org.openmuc.josistack.ByteBufferInputStream; +import org.openmuc.josistack.ClientAcseSap; +import org.openmuc.josistack.DecodingException; +import org.openmuc.openiec61850.internal.mms.asn1.AccessResult; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedRequestPDU; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedResponsePDU; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedServiceRequest; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedServiceResponse; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.DefineNamedVariableListRequest; +import org.openmuc.openiec61850.internal.mms.asn1.DeleteNamedVariableListRequest; +import org.openmuc.openiec61850.internal.mms.asn1.DeleteNamedVariableListRequest.ListOfVariableListName; +import org.openmuc.openiec61850.internal.mms.asn1.DeleteNamedVariableListResponse; +import org.openmuc.openiec61850.internal.mms.asn1.GetNameListRequest; +import org.openmuc.openiec61850.internal.mms.asn1.GetNameListRequest.ObjectScope; +import org.openmuc.openiec61850.internal.mms.asn1.GetNameListResponse; +import org.openmuc.openiec61850.internal.mms.asn1.GetNamedVariableListAttributesRequest; +import org.openmuc.openiec61850.internal.mms.asn1.GetNamedVariableListAttributesResponse; +import org.openmuc.openiec61850.internal.mms.asn1.GetVariableAccessAttributesRequest; +import org.openmuc.openiec61850.internal.mms.asn1.Identifier; +import org.openmuc.openiec61850.internal.mms.asn1.InitiateRequestPDU; +import org.openmuc.openiec61850.internal.mms.asn1.InitiateResponsePDU; +import org.openmuc.openiec61850.internal.mms.asn1.Integer16; +import org.openmuc.openiec61850.internal.mms.asn1.Integer32; +import org.openmuc.openiec61850.internal.mms.asn1.Integer8; +import org.openmuc.openiec61850.internal.mms.asn1.MMSpdu; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectClass; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectName; +import org.openmuc.openiec61850.internal.mms.asn1.ParameterSupportOptions; +import org.openmuc.openiec61850.internal.mms.asn1.ReadRequest; +import org.openmuc.openiec61850.internal.mms.asn1.ReadResponse; +import org.openmuc.openiec61850.internal.mms.asn1.RejectPDU.RejectReason; +import org.openmuc.openiec61850.internal.mms.asn1.ServiceError.ErrorClass; +import org.openmuc.openiec61850.internal.mms.asn1.ServiceSupportOptions; +import org.openmuc.openiec61850.internal.mms.asn1.UnconfirmedPDU; +import org.openmuc.openiec61850.internal.mms.asn1.UnconfirmedService; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned32; +import org.openmuc.openiec61850.internal.mms.asn1.VariableAccessSpecification; +import org.openmuc.openiec61850.internal.mms.asn1.VariableDefs; +import org.openmuc.openiec61850.internal.mms.asn1.WriteRequest; +import org.openmuc.openiec61850.internal.mms.asn1.WriteRequest.ListOfData; +import org.openmuc.openiec61850.internal.mms.asn1.WriteResponse; + +/** + * Represents an association/connection to an IEC 61850 MMS server. An instance of ClientAssociation is + * obtained using ClientSap. An association object can be used to execute the IEC 61850 ACSI services. Note + * that not all ACSI services have a corresponding function in this API. For example all GetDirectory and GetDefinition + * services are covered by retrieveModel(). The control services can be executed by using getDataValues and + * setDataValues on the control objects in the data model. + * + */ +public final class ClientAssociation { + + private static final Integer16 version = new Integer16(new byte[] { (byte) 0x01, (byte) 0x01 }); + private static final ParameterSupportOptions proposedParameterCbbBitString = new ParameterSupportOptions( + new byte[] { 0x03, 0x05, (byte) 0xf1, 0x00 }); + + private AcseAssociation acseAssociation = null; + private final ClientReceiver clientReceiver; + + private final BlockingQueue incomingResponses = new LinkedBlockingQueue<>(); + + private final BerByteArrayOutputStream berOStream = new BerByteArrayOutputStream(500, true); + + ServerModel serverModel; + + private int responseTimeout; + + private int invokeId = 0; + + private int negotiatedMaxPduSize; + private ClientEventListener reportListener = null; + + private boolean closed = false; + + final class ClientReceiver extends Thread { + + private Integer expectedResponseId; + private final ByteBuffer pduBuffer; + + private IOException lastIOException = null; + + public ClientReceiver(int maxMmsPduSize) { + pduBuffer = ByteBuffer.allocate(maxMmsPduSize + 400); + } + + @Override + public void run() { + try { + while (true) { + + pduBuffer.clear(); + try { + acseAssociation.receive(pduBuffer); + } catch (TimeoutException e) { + // Illegal state: A timeout exception was thrown. + throw new IllegalStateException(); + } catch (DecodingException e) { + // Error decoding the OSI headers of the received packet + continue; + } + + MMSpdu decodedResponsePdu = new MMSpdu(); + try { + decodedResponsePdu.decode(new ByteBufferInputStream(pduBuffer), null); + } catch (IOException e) { + // Error decoding the received MMS PDU + continue; + } + + if (decodedResponsePdu.getUnconfirmedPDU() != null) { + if (decodedResponsePdu.getUnconfirmedPDU() + .getService() + .getInformationReport() + .getVariableAccessSpecification() + .getListOfVariable() != null) { + // Discarding LastApplError Report + } + else { + if (reportListener != null) { + final Report report = processReport(decodedResponsePdu); + + Thread t1 = new Thread(new Runnable() { + @Override + public void run() { + reportListener.newReport(report); + } + }); + t1.start(); + } + else { + // discarding report because no ReportListener was registered. + } + } + } + else if (decodedResponsePdu.getRejectPDU() != null) { + synchronized (incomingResponses) { + if (expectedResponseId == null) { + // Discarding Reject MMS PDU because no listener for request was found. + continue; + } + else if (decodedResponsePdu.getRejectPDU().getOriginalInvokeID().value + .intValue() != expectedResponseId) { + // Discarding Reject MMS PDU because no listener with fitting invokeID was found. + continue; + } + else { + try { + incomingResponses.put(decodedResponsePdu); + } catch (InterruptedException e) { + } + } + } + } + else if (decodedResponsePdu.getConfirmedErrorPDU() != null) { + synchronized (incomingResponses) { + if (expectedResponseId == null) { + // Discarding ConfirmedError MMS PDU because no listener for request was found. + continue; + } + else if (decodedResponsePdu.getConfirmedErrorPDU().getInvokeID().value + .intValue() != expectedResponseId) { + // Discarding ConfirmedError MMS PDU because no listener with fitting invokeID was + // found. + continue; + } + else { + try { + incomingResponses.put(decodedResponsePdu); + } catch (InterruptedException e) { + } + } + } + } + else { + synchronized (incomingResponses) { + if (expectedResponseId == null) { + // Discarding ConfirmedResponse MMS PDU because no listener for request was found. + continue; + } + else if (decodedResponsePdu.getConfirmedResponsePDU().getInvokeID().value + .intValue() != expectedResponseId) { + // Discarding ConfirmedResponse MMS PDU because no listener with fitting invokeID was + // found. + continue; + } + else { + try { + incomingResponses.put(decodedResponsePdu); + } catch (InterruptedException e) { + } + } + } + + } + } + } catch (IOException e) { + close(e); + } catch (Exception e) { + close(new IOException("unexpected exception while receiving", e)); + } + } + + public void setResponseExpected(int invokeId) { + expectedResponseId = invokeId; + } + + private void disconnect() { + synchronized (this) { + if (closed == false) { + closed = true; + acseAssociation.disconnect(); + lastIOException = new IOException("Connection disconnected by client"); + if (reportListener != null) { + Thread t1 = new Thread(new Runnable() { + @Override + public void run() { + reportListener.associationClosed(lastIOException); + } + }); + t1.start(); + } + + MMSpdu mmsPdu = new MMSpdu(); + mmsPdu.setConfirmedRequestPDU(new ConfirmedRequestPDU()); + try { + incomingResponses.put(mmsPdu); + } catch (InterruptedException e1) { + } + } + } + } + + private void close(IOException e) { + synchronized (this) { + if (closed == false) { + closed = true; + acseAssociation.close(); + lastIOException = e; + Thread t1 = new Thread(new Runnable() { + @Override + public void run() { + reportListener.associationClosed(lastIOException); + } + }); + t1.start(); + + MMSpdu mmsPdu = new MMSpdu(); + mmsPdu.setConfirmedRequestPDU(new ConfirmedRequestPDU()); + try { + incomingResponses.put(mmsPdu); + } catch (InterruptedException e1) { + } + } + } + } + + IOException getLastIOException() { + return lastIOException; + } + + MMSpdu removeExpectedResponse() { + synchronized (incomingResponses) { + expectedResponseId = null; + return incomingResponses.poll(); + } + } + + } + + ClientAssociation(InetAddress address, int port, InetAddress localAddr, int localPort, + String authenticationParameter, ClientAcseSap acseSap, int proposedMaxMmsPduSize, + int proposedMaxServOutstandingCalling, int proposedMaxServOutstandingCalled, + int proposedDataStructureNestingLevel, byte[] servicesSupportedCalling, int responseTimeout, + int messageFragmentTimeout, ClientEventListener reportListener) throws IOException { + + this.responseTimeout = responseTimeout; + + acseSap.tSap.setMessageFragmentTimeout(messageFragmentTimeout); + acseSap.tSap.setMessageTimeout(responseTimeout); + + negotiatedMaxPduSize = proposedMaxMmsPduSize; + + this.reportListener = reportListener; + + associate(address, port, localAddr, localPort, authenticationParameter, acseSap, proposedMaxMmsPduSize, + proposedMaxServOutstandingCalling, proposedMaxServOutstandingCalled, proposedDataStructureNestingLevel, + servicesSupportedCalling); + + acseAssociation.setMessageTimeout(0); + + clientReceiver = new ClientReceiver(negotiatedMaxPduSize); + clientReceiver.start(); + } + + /** + * Sets the response timeout. The response timeout is used whenever a request is sent to the server. The client will + * wait for this amount of time for the server's response before throwing a ServiceError.TIMEOUT. Responses received + * after the timeout will be automatically discarded. + * + * @param timeout + * the response timeout in milliseconds. + */ + public void setResponseTimeout(int timeout) { + responseTimeout = timeout; + } + + /** + * Gets the response timeout. The response timeout is used whenever a request is sent to the server. The client will + * wait for this amount of time for the server's response before throwing a ServiceError.TIMEOUT. Responses received + * after the timeout will be automatically discarded. + * + * @return the response timeout in milliseconds. + */ + public int getResponseTimeout() { + return responseTimeout; + } + + private int getInvokeId() { + invokeId = (invokeId + 1) % 2147483647; + return invokeId; + } + + private static ServiceError mmsDataAccessErrorToServiceError(BerInteger dataAccessError) { + + switch (dataAccessError.value.intValue()) { + case 1: + return new ServiceError(ServiceError.FAILED_DUE_TO_SERVER_CONSTRAINT, + "MMS DataAccessError: hardware-fault"); + case 2: + return new ServiceError(ServiceError.INSTANCE_LOCKED_BY_OTHER_CLIENT, + "MMS DataAccessError: temporarily-unavailable"); + case 3: + return new ServiceError(ServiceError.ACCESS_VIOLATION, "MMS DataAccessError: object-access-denied"); + case 5: + return new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, "MMS DataAccessError: invalid-address"); + case 7: + return new ServiceError(ServiceError.TYPE_CONFLICT, "MMS DataAccessError: type-inconsistent"); + case 10: + return new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, "MMS DataAccessError: object-non-existent"); + case 11: + return new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, + "MMS DataAccessError: object-value-invalid"); + default: + return new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "MMS DataAccessError: " + dataAccessError.value); + } + + } + + private static void testForErrorResponse(MMSpdu mmsResponsePdu) throws ServiceError { + if (mmsResponsePdu.getConfirmedErrorPDU() == null) { + return; + } + + ErrorClass errClass = mmsResponsePdu.getConfirmedErrorPDU().getServiceError().getErrorClass(); + if (errClass != null) { + if (errClass.getAccess() != null) { + if (errClass.getAccess().value.intValue() == 3) { + throw new ServiceError(ServiceError.ACCESS_VIOLATION, + "MMS confirmed error: class: \"access\", error code: \"object-access-denied\""); + } + else if (errClass.getAccess().value.intValue() == 2) { + + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "MMS confirmed error: class: \"access\", error code: \"object-non-existent\""); + } + } + } + + if (mmsResponsePdu.getConfirmedErrorPDU().getServiceError().getAdditionalDescription() != null) { + throw new ServiceError(ServiceError.UNKNOWN, "MMS confirmed error. Description: " + + mmsResponsePdu.getConfirmedErrorPDU().getServiceError().getAdditionalDescription().toString()); + } + throw new ServiceError(ServiceError.UNKNOWN, "MMS confirmed error."); + } + + private static void testForRejectResponse(MMSpdu mmsResponsePdu) throws ServiceError { + if (mmsResponsePdu.getRejectPDU() == null) { + return; + } + + RejectReason rejectReason = mmsResponsePdu.getRejectPDU().getRejectReason(); + if (rejectReason != null) { + if (rejectReason.getPduError() != null) { + if (rejectReason.getPduError().value.intValue() == 1) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, + "MMS reject: type: \"pdu-error\", reject code: \"invalid-pdu\""); + } + } + } + throw new ServiceError(ServiceError.UNKNOWN, "MMS confirmed error."); + } + + private static void testForInitiateErrorResponse(MMSpdu mmsResponsePdu) throws ServiceError { + if (mmsResponsePdu.getInitiateErrorPDU() != null) { + + ErrorClass errClass = mmsResponsePdu.getInitiateErrorPDU().getErrorClass(); + if (errClass != null) { + if (errClass.getVmdState() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"vmd_state\" with val: " + errClass.getVmdState().value); + } + if (errClass.getApplicationReference() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"application_reference\" with val: " + + errClass.getApplicationReference().value); + } + if (errClass.getDefinition() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"definition\" with val: " + errClass.getDefinition().value); + } + if (errClass.getResource() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"resource\" with val: " + errClass.getResource().value); + } + if (errClass.getService() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"service\" with val: " + errClass.getService().value); + } + if (errClass.getServicePreempt() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"service_preempt\" with val: " + errClass.getServicePreempt().value); + } + if (errClass.getTimeResolution() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"time_resolution\" with val: " + errClass.getTimeResolution().value); + } + if (errClass.getAccess() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"access\" with val: " + errClass.getAccess().value); + } + if (errClass.getInitiate() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"initiate\" with val: " + errClass.getInitiate().value); + } + if (errClass.getConclude() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"conclude\" with val: " + errClass.getConclude()); + } + if (errClass.getCancel() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"cancel\" with val: " + errClass.getCancel().value); + } + if (errClass.getFile() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"file\" with val: " + errClass.getFile().value); + } + if (errClass.getOthers() != null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "error class \"others\" with val: " + errClass.getOthers().value); + } + } + + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, "unknown error class"); + } + } + + private ConfirmedServiceResponse encodeWriteReadDecode(ConfirmedServiceRequest serviceRequest) + throws ServiceError, IOException { + + int currentInvokeId = getInvokeId(); + + ConfirmedRequestPDU confirmedRequestPdu = new ConfirmedRequestPDU(); + confirmedRequestPdu.setInvokeID(new Unsigned32(currentInvokeId)); + confirmedRequestPdu.setService(serviceRequest); + + MMSpdu requestPdu = new MMSpdu(); + requestPdu.setConfirmedRequestPDU(confirmedRequestPdu); + + berOStream.reset(); + + try { + requestPdu.encode(berOStream); + } catch (Exception e) { + IOException e2 = new IOException("Error encoding MmsPdu.", e); + clientReceiver.close(e2); + throw e2; + } + + clientReceiver.setResponseExpected(currentInvokeId); + try { + acseAssociation.send(berOStream.getByteBuffer()); + } catch (IOException e) { + IOException e2 = new IOException("Error sending packet.", e); + clientReceiver.close(e2); + throw e2; + } + + MMSpdu decodedResponsePdu = null; + + try { + if (responseTimeout == 0) { + decodedResponsePdu = incomingResponses.take(); + } + else { + decodedResponsePdu = incomingResponses.poll(responseTimeout, TimeUnit.MILLISECONDS); + } + } catch (InterruptedException e) { + } + + if (decodedResponsePdu == null) { + decodedResponsePdu = clientReceiver.removeExpectedResponse(); + if (decodedResponsePdu == null) { + throw new ServiceError(ServiceError.TIMEOUT); + } + } + + if (decodedResponsePdu.getConfirmedRequestPDU() != null) { + incomingResponses.add(decodedResponsePdu); + throw clientReceiver.getLastIOException(); + } + + testForInitiateErrorResponse(decodedResponsePdu); + testForErrorResponse(decodedResponsePdu); + testForRejectResponse(decodedResponsePdu); + + ConfirmedResponsePDU confirmedResponsePdu = decodedResponsePdu.getConfirmedResponsePDU(); + if (confirmedResponsePdu == null) { + throw new IllegalStateException("Response PDU is not a confirmed response pdu"); + } + + return confirmedResponsePdu.getService(); + + } + + private void associate(InetAddress address, int port, InetAddress localAddr, int localPort, + String authenticationParameter, ClientAcseSap acseSap, int proposedMaxPduSize, + int proposedMaxServOutstandingCalling, int proposedMaxServOutstandingCalled, + int proposedDataStructureNestingLevel, byte[] servicesSupportedCalling) throws IOException { + + MMSpdu initiateRequestMMSpdu = constructInitRequestPdu(proposedMaxPduSize, proposedMaxServOutstandingCalling, + proposedMaxServOutstandingCalled, proposedDataStructureNestingLevel, servicesSupportedCalling); + + BerByteArrayOutputStream berOStream = new BerByteArrayOutputStream(500, true); + initiateRequestMMSpdu.encode(berOStream); + + try { + acseAssociation = acseSap.associate(address, port, localAddr, localPort, authenticationParameter, + berOStream.getByteBuffer()); + + ByteBuffer initResponse = acseAssociation.getAssociateResponseAPdu(); + + MMSpdu initiateResponseMmsPdu = new MMSpdu(); + + initiateResponseMmsPdu.decode(new ByteBufferInputStream(initResponse), null); + + handleInitiateResponse(initiateResponseMmsPdu, proposedMaxPduSize, proposedMaxServOutstandingCalling, + proposedMaxServOutstandingCalled, proposedDataStructureNestingLevel); + } catch (IOException e) { + if (acseAssociation != null) { + acseAssociation.close(); + } + throw e; + } + } + + private static MMSpdu constructInitRequestPdu(int proposedMaxPduSize, int proposedMaxServOutstandingCalling, + int proposedMaxServOutstandingCalled, int proposedDataStructureNestingLevel, + byte[] servicesSupportedCalling) { + + InitiateRequestPDU.InitRequestDetail initRequestDetail = new InitiateRequestPDU.InitRequestDetail(); + initRequestDetail.setProposedVersionNumber(version); + initRequestDetail.setProposedParameterCBB(proposedParameterCbbBitString); + initRequestDetail.setServicesSupportedCalling(new ServiceSupportOptions(servicesSupportedCalling, 85)); + + InitiateRequestPDU initiateRequestPdu = new InitiateRequestPDU(); + initiateRequestPdu.setLocalDetailCalling(new Integer32(proposedMaxPduSize)); + initiateRequestPdu.setProposedMaxServOutstandingCalling(new Integer16(proposedMaxServOutstandingCalling)); + initiateRequestPdu.setProposedMaxServOutstandingCalled(new Integer16(proposedMaxServOutstandingCalled)); + initiateRequestPdu.setProposedDataStructureNestingLevel(new Integer8(proposedDataStructureNestingLevel)); + initiateRequestPdu.setInitRequestDetail(initRequestDetail); + + MMSpdu initiateRequestMMSpdu = new MMSpdu(); + initiateRequestMMSpdu.setInitiateRequestPDU(initiateRequestPdu); + + return initiateRequestMMSpdu; + } + + private void handleInitiateResponse(MMSpdu responsePdu, int proposedMaxPduSize, + int proposedMaxServOutstandingCalling, int proposedMaxServOutstandingCalled, + int proposedDataStructureNestingLevel) throws IOException { + + if (responsePdu.getInitiateErrorPDU() != null) { + throw new IOException("Got response error of class: " + responsePdu.getInitiateErrorPDU().getErrorClass()); + } + + if (responsePdu.getInitiateResponsePDU() == null) { + acseAssociation.disconnect(); + throw new IOException("Error decoding InitiateResponse Pdu"); + } + + InitiateResponsePDU initiateResponsePdu = responsePdu.getInitiateResponsePDU(); + + if (initiateResponsePdu.getLocalDetailCalled() != null) { + negotiatedMaxPduSize = initiateResponsePdu.getLocalDetailCalled().intValue(); + } + + int negotiatedMaxServOutstandingCalling = initiateResponsePdu.getNegotiatedMaxServOutstandingCalling() + .intValue(); + int negotiatedMaxServOutstandingCalled = initiateResponsePdu.getNegotiatedMaxServOutstandingCalled().intValue(); + + int negotiatedDataStructureNestingLevel; + if (initiateResponsePdu.getNegotiatedDataStructureNestingLevel() != null) { + negotiatedDataStructureNestingLevel = initiateResponsePdu.getNegotiatedDataStructureNestingLevel() + .intValue(); + } + else { + negotiatedDataStructureNestingLevel = proposedDataStructureNestingLevel; + } + + if (negotiatedMaxPduSize < ClientSap.MINIMUM_MMS_PDU_SIZE || negotiatedMaxPduSize > proposedMaxPduSize + || negotiatedMaxServOutstandingCalling > proposedMaxServOutstandingCalling + || negotiatedMaxServOutstandingCalling < 0 + || negotiatedMaxServOutstandingCalled > proposedMaxServOutstandingCalled + || negotiatedMaxServOutstandingCalled < 0 + || negotiatedDataStructureNestingLevel > proposedDataStructureNestingLevel + || negotiatedDataStructureNestingLevel < 0) { + acseAssociation.disconnect(); + throw new IOException("Error negotiating parameters"); + } + + int version = initiateResponsePdu.getInitResponseDetail().getNegotiatedVersionNumber().intValue(); + if (version != 1) { + throw new IOException("Unsupported version number was negotiated."); + } + + byte[] servicesSupported = initiateResponsePdu.getInitResponseDetail().getServicesSupportedCalled().value; + if ((servicesSupported[0] & 0x40) != 0x40) { + throw new IOException("Obligatory services are not supported by the server."); + } + } + + /** + * Parses the given SCL File and returns the server model that is described by it. This function can be used instead + * of retrieveModel in order to get the server model that is needed to call the other ACSI services. + * + * @param sclFilePath + * the path to the SCL file that is to be parsed. + * @return The ServerNode that is the root node of the complete server model. + * @throws SclParseException + * if any kind of fatal error occurs in the parsing process. + */ + public ServerModel getModelFromSclFile(String sclFilePath) throws SclParseException { + List serverSaps = ServerSap.getSapsFromSclFile(sclFilePath); + if (serverSaps == null || serverSaps.size() == 0) { + throw new SclParseException("No AccessPoint found in SCL file."); + } + serverModel = serverSaps.get(0).serverModel; + return serverModel; + } + + /** + * Triggers all GetDirectory and GetDefinition ACSI services needed to get the complete server model. Because in MMS + * SubDataObjects cannot be distinguished from Constructed Data Attributes they will always be represented as + * Constructed Data Attributes in the returned model. + * + * @return the ServerModel that is the root node of the complete server model. + * @throws ServiceError + * if a ServiceError occurs while calling any of the ASCI services. + * @throws IOException + * if a fatal association error occurs. The association object will be closed and can no longer be used + * after this exception is thrown. + */ + public ServerModel retrieveModel() throws ServiceError, IOException { + + List ldNames = retrieveLogicalDevices(); + List> lnNames = new ArrayList<>(ldNames.size()); + + for (int i = 0; i < ldNames.size(); i++) { + lnNames.add(retrieveLogicalNodeNames(ldNames.get(i))); + } + List lds = new ArrayList<>(); + for (int i = 0; i < ldNames.size(); i++) { + List lns = new ArrayList<>(); + for (int j = 0; j < lnNames.get(i).size(); j++) { + lns.add(retrieveDataDefinitions(new ObjectReference(ldNames.get(i) + "/" + lnNames.get(i).get(j)))); + } + lds.add(new LogicalDevice(new ObjectReference(ldNames.get(i)), lns)); + } + + serverModel = new ServerModel(lds, null); + + updateDataSets(); + + return serverModel; + } + + private List retrieveLogicalDevices() throws ServiceError, IOException { + ConfirmedServiceRequest serviceRequest = constructGetServerDirectoryRequest(); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + return decodeGetServerDirectoryResponse(confirmedServiceResponse); + } + + private ConfirmedServiceRequest constructGetServerDirectoryRequest() { + ObjectClass objectClass = new ObjectClass(); + objectClass.setBasicObjectClass(new BerInteger(9)); + + GetNameListRequest.ObjectScope objectScope = new GetNameListRequest.ObjectScope(); + objectScope.setVmdSpecific(new BerNull()); + + GetNameListRequest getNameListRequest = new GetNameListRequest(); + getNameListRequest.setObjectClass(objectClass); + getNameListRequest.setObjectScope(objectScope); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setGetNameList(getNameListRequest); + + return confirmedServiceRequest; + } + + private List decodeGetServerDirectoryResponse(ConfirmedServiceResponse confirmedServiceResponse) + throws ServiceError { + + if (confirmedServiceResponse.getGetNameList() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "Error decoding Get Server Directory Response Pdu"); + } + + List identifiers = confirmedServiceResponse.getGetNameList().getListOfIdentifier().getIdentifier(); + ArrayList objectRefs = new ArrayList<>(); // ObjectReference[identifiers.size()]; + + for (BerVisibleString identifier : identifiers) { + objectRefs.add(identifier.toString()); + } + + return objectRefs; + } + + private List retrieveLogicalNodeNames(String ld) throws ServiceError, IOException { + List lns = new LinkedList<>(); + String continueAfterRef = ""; + do { + ConfirmedServiceRequest serviceRequest = constructGetDirectoryRequest(ld, continueAfterRef, true); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + continueAfterRef = decodeGetDirectoryResponse(confirmedServiceResponse, lns); + + } while (continueAfterRef != ""); + return lns; + } + + private ConfirmedServiceRequest constructGetDirectoryRequest(String ldRef, String continueAfter, + boolean logicalDevice) { + + ObjectClass objectClass = new ObjectClass(); + + if (logicalDevice) { + objectClass.setBasicObjectClass(new BerInteger(0)); + } + else { // for data sets + objectClass.setBasicObjectClass(new BerInteger(2)); + } + + GetNameListRequest getNameListRequest = null; + + ObjectScope objectScopeChoiceType = new ObjectScope(); + objectScopeChoiceType.setDomainSpecific(new Identifier(ldRef.getBytes())); + + getNameListRequest = new GetNameListRequest(); + getNameListRequest.setObjectClass(objectClass); + getNameListRequest.setObjectScope(objectScopeChoiceType); + if (continueAfter != "") { + getNameListRequest.setContinueAfter(new Identifier(continueAfter.getBytes())); + } + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setGetNameList(getNameListRequest); + return confirmedServiceRequest; + + } + + /** + * Decodes an MMS response which contains the structure of a LD and its LNs including names of DOs. + */ + private String decodeGetDirectoryResponse(ConfirmedServiceResponse confirmedServiceResponse, List lns) + throws ServiceError { + + if (confirmedServiceResponse.getGetNameList() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "decodeGetLDDirectoryResponse: Error decoding server response"); + } + + GetNameListResponse getNameListResponse = confirmedServiceResponse.getGetNameList(); + + List identifiers = getNameListResponse.getListOfIdentifier().getIdentifier(); + + if (identifiers.size() == 0) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "decodeGetLDDirectoryResponse: Instance not available"); + } + + BerVisibleString identifier = null; + Iterator it = identifiers.iterator(); + + String idString; + + while (it.hasNext()) { + identifier = it.next(); + idString = identifier.toString(); + + if (idString.indexOf('$') == -1) { + lns.add(idString); + } + } + + if (getNameListResponse.getMoreFollows() != null && getNameListResponse.getMoreFollows().value == false) { + return ""; + } + else { + return identifier.toString(); + } + } + + private LogicalNode retrieveDataDefinitions(ObjectReference lnRef) throws ServiceError, IOException { + ConfirmedServiceRequest serviceRequest = constructGetDataDefinitionRequest(lnRef); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + return decodeGetDataDefinitionResponse(confirmedServiceResponse, lnRef); + } + + private ConfirmedServiceRequest constructGetDataDefinitionRequest(ObjectReference lnRef) { + + ObjectName.DomainSpecific domainSpec = new ObjectName.DomainSpecific(); + domainSpec.setDomainID(new Identifier(lnRef.get(0).getBytes())); + domainSpec.setItemID(new Identifier(lnRef.get(1).getBytes())); + + ObjectName objectName = new ObjectName(); + objectName.setDomainSpecific(domainSpec); + + GetVariableAccessAttributesRequest getVariableAccessAttributesRequest = new GetVariableAccessAttributesRequest(); + getVariableAccessAttributesRequest.setName(objectName); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setGetVariableAccessAttributes(getVariableAccessAttributesRequest); + + return confirmedServiceRequest; + } + + private LogicalNode decodeGetDataDefinitionResponse(ConfirmedServiceResponse confirmedServiceResponse, + ObjectReference lnRef) throws ServiceError { + + return DataDefinitionResParser.parseGetDataDefinitionResponse(confirmedServiceResponse, lnRef); + } + + /** + * The implementation of the GetDataValues ACSI service. Will send an MMS read request for the given model node. + * After a successful return, the Basic Data Attributes of the passed model node will contain the values read. If + * one of the Basic Data Attributes cannot be read then none of the values will be read and a + * ServiceError will be thrown. + * + * @param modelNode + * the functionally constrained model node that is to be read. + * @throws ServiceError + * if a ServiceError is returned by the server. + * @throws IOException + * if a fatal association error occurs. The association object will be closed and can no longer be used + * after this exception is thrown. + */ + public void getDataValues(FcModelNode modelNode) throws ServiceError, IOException { + ConfirmedServiceRequest serviceRequest = constructGetDataValuesRequest(modelNode); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + decodeGetDataValuesResponse(confirmedServiceResponse, modelNode); + } + + /** + * Will update all data inside the model except for control variables (those that have FC=CO). Control variables are + * not meant to be read. Update is done by calling getDataValues on the FCDOs below the Logical Nodes. + * + * @throws ServiceError + * if a ServiceError is returned by the server. + * @throws IOException + * if a fatal association error occurs. The association object will be closed and can no longer be used + * after this exception is thrown. + */ + public void getAllDataValues() throws ServiceError, IOException { + for (ModelNode logicalDevice : serverModel.getChildren()) { + for (ModelNode logicalNode : logicalDevice.getChildren()) { + for (ModelNode dataObject : logicalNode.getChildren()) { + FcModelNode fcdo = (FcModelNode) dataObject; + if (fcdo.getFc() != Fc.CO) { + getDataValues(fcdo); + } + } + } + } + } + + private ConfirmedServiceRequest constructGetDataValuesRequest(FcModelNode modelNode) { + VariableAccessSpecification varAccessSpec = constructVariableAccessSpecification(modelNode); + + ReadRequest readRequest = new ReadRequest(); + readRequest.setVariableAccessSpecification(varAccessSpec); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setRead(readRequest); + + return confirmedServiceRequest; + } + + private void decodeGetDataValuesResponse(ConfirmedServiceResponse confirmedServiceResponse, ModelNode modelNode) + throws ServiceError { + + if (confirmedServiceResponse.getRead() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "Error decoding GetDataValuesReponsePdu"); + } + + List listOfAccessResults = confirmedServiceResponse.getRead() + .getListOfAccessResult() + .getAccessResult(); + + if (listOfAccessResults.size() != 1) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, "Multiple results received."); + } + + AccessResult accRes = listOfAccessResults.get(0); + + if (accRes.getFailure() != null) { + throw mmsDataAccessErrorToServiceError(accRes.getFailure()); + } + modelNode.setValueFromMmsDataObj(accRes.getSuccess()); + } + + /** + * The implementation of the SetDataValues ACSI service. Will send an MMS write request with the values of all Basic + * Data Attributes of the given model node. Will simply return if all values have been successfully written. If one + * of the Basic Data Attributes could not be written then a ServiceError will be thrown. In this case + * it is not possible to find out which of several Basic Data Attributes could not be written. + * + * @param modelNode + * the functionally constrained model node that is to be written. + * @throws ServiceError + * if a ServiceError is returned by the server. + * @throws IOException + * if a fatal association error occurs. The association object will be closed and can no longer be used + * after this exception is thrown. + */ + public void setDataValues(FcModelNode modelNode) throws ServiceError, IOException { + ConfirmedServiceRequest serviceRequest = constructSetDataValuesRequest(modelNode); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + decodeSetDataValuesResponse(confirmedServiceResponse); + } + + private ConfirmedServiceRequest constructSetDataValuesRequest(FcModelNode modelNode) throws ServiceError { + + VariableAccessSpecification variableAccessSpecification = constructVariableAccessSpecification(modelNode); + + ListOfData listOfData = new ListOfData(); + List dataList = listOfData.getData(); + dataList.add(modelNode.getMmsDataObj()); + + WriteRequest writeRequest = new WriteRequest(); + writeRequest.setListOfData(listOfData); + writeRequest.setVariableAccessSpecification(variableAccessSpecification); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setWrite(writeRequest); + + return confirmedServiceRequest; + } + + private VariableAccessSpecification constructVariableAccessSpecification(FcModelNode modelNode) { + VariableDefs listOfVariable = new VariableDefs(); + + List variableDefsSeqOf = listOfVariable.getSEQUENCE(); + variableDefsSeqOf.add(modelNode.getMmsVariableDef()); + + VariableAccessSpecification variableAccessSpecification = new VariableAccessSpecification(); + variableAccessSpecification.setListOfVariable(listOfVariable); + + return variableAccessSpecification; + } + + private void decodeSetDataValuesResponse(ConfirmedServiceResponse confirmedServiceResponse) throws ServiceError { + + WriteResponse writeResponse = confirmedServiceResponse.getWrite(); + + if (writeResponse == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "SetDataValuesResponse: improper response"); + } + + WriteResponse.CHOICE subChoice = writeResponse.getCHOICE().get(0); + + if (subChoice.getFailure() != null) { + throw mmsDataAccessErrorToServiceError(subChoice.getFailure()); + } + } + + /** + * This function will get the definition of all persistent DataSets from the server and update the DataSets in the + * ServerModel that were returned by the retrieveModel() or getModelFromSclFile() functions. It will delete DataSets + * that have been deleted since the last update and add any new DataSets + * + * @throws ServiceError + * if a ServiceError is returned by the server. + * @throws IOException + * if a fatal association error occurs. The association object will be closed and can no longer be used + * after this exception is thrown. + */ + public void updateDataSets() throws ServiceError, IOException { + + if (serverModel == null) { + throw new IllegalStateException( + "Before calling this function you have to get the ServerModel using the retrieveModel() function"); + } + + Collection lds = serverModel.getChildren(); + + for (ModelNode ld : lds) { + ConfirmedServiceRequest serviceRequest = constructGetDirectoryRequest(ld.getName(), "", false); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + decodeAndRetrieveDsNamesAndDefinitions(confirmedServiceResponse, (LogicalDevice) ld); + } + } + + private void decodeAndRetrieveDsNamesAndDefinitions(ConfirmedServiceResponse confirmedServiceResponse, + LogicalDevice ld) throws ServiceError, IOException { + + if (confirmedServiceResponse.getGetNameList() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "decodeGetDataSetResponse: Error decoding server response"); + } + + GetNameListResponse getNameListResponse = confirmedServiceResponse.getGetNameList(); + + List identifiers = getNameListResponse.getListOfIdentifier().getIdentifier(); + + if (identifiers.size() == 0) { + return; + } + + for (Identifier identifier : identifiers) { + // TODO delete DataSets that no longer exist + getDataSetDirectory(identifier, ld); + } + + if (getNameListResponse.getMoreFollows() != null && getNameListResponse.getMoreFollows().value == true) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT); + } + } + + private void getDataSetDirectory(Identifier dsId, LogicalDevice ld) throws ServiceError, IOException { + ConfirmedServiceRequest serviceRequest = constructGetDataSetDirectoryRequest(dsId, ld); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + decodeGetDataSetDirectoryResponse(confirmedServiceResponse, dsId, ld); + } + + private ConfirmedServiceRequest constructGetDataSetDirectoryRequest(Identifier dsId, LogicalDevice ld) + throws ServiceError { + ObjectName.DomainSpecific domainSpecificObjectName = new ObjectName.DomainSpecific(); + domainSpecificObjectName.setDomainID(new Identifier(ld.getName().getBytes())); + domainSpecificObjectName.setItemID(dsId); + + GetNamedVariableListAttributesRequest dataSetObj = new GetNamedVariableListAttributesRequest(); + dataSetObj.setDomainSpecific(domainSpecificObjectName); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setGetNamedVariableListAttributes(dataSetObj); + + return confirmedServiceRequest; + } + + private void decodeGetDataSetDirectoryResponse(ConfirmedServiceResponse confirmedServiceResponse, + BerVisibleString dsId, LogicalDevice ld) throws ServiceError { + + if (confirmedServiceResponse.getGetNamedVariableListAttributes() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "decodeGetDataSetDirectoryResponse: Error decoding server response"); + } + + GetNamedVariableListAttributesResponse getNamedVariableListAttResponse = confirmedServiceResponse + .getGetNamedVariableListAttributes(); + boolean deletable = getNamedVariableListAttResponse.getMmsDeletable().value; + List variables = getNamedVariableListAttResponse.getListOfVariable().getSEQUENCE(); + + if (variables.size() == 0) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "decodeGetDataSetDirectoryResponse: Instance not available"); + } + + List dsMems = new ArrayList<>(); + + for (VariableDefs.SEQUENCE variableDef : variables) { + + FcModelNode member; + // TODO remove this try catch statement once all possible FCs are + // supported + // it is only there so that Functional Constraints such as GS will + // be ignored and DataSet cotaining elements with these FCs are + // ignored and not created. + try { + member = serverModel.getNodeFromVariableDef(variableDef); + } catch (ServiceError e) { + return; + } + if (member == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "decodeGetDataSetDirectoryResponse: data set memeber does not exist, you might have to call retrieveModel first"); + } + dsMems.add(member); + } + + String dsObjRef = ld.getName() + "/" + dsId.toString().replace('$', '.'); + + DataSet dataSet = new DataSet(dsObjRef, dsMems, deletable); + + if (ld.getChild(dsId.toString().substring(0, dsId.toString().indexOf('$'))) == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "decodeGetDataSetDirectoryResponse: LN for returned DataSet is not available"); + } + + DataSet existingDs = serverModel.getDataSet(dsObjRef); + if (existingDs == null) { + serverModel.addDataSet(dataSet); + } + else if (!existingDs.isDeletable()) { + return; + } + else { + serverModel.removeDataSet(dsObjRef.toString()); + serverModel.addDataSet(dataSet); + } + + } + + /** + * The client should create the data set first and add it to either the non-persistent list or to the model. Then it + * should call this method for creation on the server side + * + * @param dataSet + * the data set to be created on the server side + * @throws ServiceError + * if a ServiceError is returned by the server. + * @throws IOException + * if a fatal IO error occurs. The association object will be closed and can no longer be used after + * this exception is thrown. + */ + public void createDataSet(DataSet dataSet) throws ServiceError, IOException { + ConfirmedServiceRequest serviceRequest = constructCreateDataSetRequest(dataSet); + encodeWriteReadDecode(serviceRequest); + handleCreateDataSetResponse(dataSet); + } + + /** + * dsRef = either LD/LN.DataSetName (persistent) or @DataSetname (non-persistent) Names in dsMemberRef should be in + * the form: LD/LNName.DoName or LD/LNName.DoName.DaName + */ + private ConfirmedServiceRequest constructCreateDataSetRequest(DataSet dataSet) throws ServiceError { + + VariableDefs listOfVariable = new VariableDefs(); + + List variableDefs = listOfVariable.getSEQUENCE(); + for (FcModelNode dsMember : dataSet) { + variableDefs.add(dsMember.getMmsVariableDef()); + } + + DefineNamedVariableListRequest createDSRequest = new DefineNamedVariableListRequest(); + createDSRequest.setVariableListName(dataSet.getMmsObjectName()); + createDSRequest.setListOfVariable(listOfVariable); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setDefineNamedVariableList(createDSRequest); + + return confirmedServiceRequest; + } + + private void handleCreateDataSetResponse(DataSet dataSet) throws ServiceError { + serverModel.addDataSet(dataSet); + } + + public void deleteDataSet(DataSet dataSet) throws ServiceError, IOException { + ConfirmedServiceRequest serviceRequest = constructDeleteDataSetRequest(dataSet); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + decodeDeleteDataSetResponse(confirmedServiceResponse, dataSet); + } + + private ConfirmedServiceRequest constructDeleteDataSetRequest(DataSet dataSet) throws ServiceError { + + ListOfVariableListName listOfVariableListName = new ListOfVariableListName(); + + List objectList = listOfVariableListName.getObjectName(); + objectList.add(dataSet.getMmsObjectName()); + + DeleteNamedVariableListRequest requestDeleteDS = new DeleteNamedVariableListRequest(); + requestDeleteDS.setListOfVariableListName(listOfVariableListName); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setDeleteNamedVariableList(requestDeleteDS); + + return confirmedServiceRequest; + } + + private void decodeDeleteDataSetResponse(ConfirmedServiceResponse confirmedServiceResponse, DataSet dataSet) + throws ServiceError { + + if (confirmedServiceResponse.getDeleteNamedVariableList() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "decodeDeleteDataSetResponse: Error decoding server response"); + } + + DeleteNamedVariableListResponse deleteNamedVariableListResponse = confirmedServiceResponse + .getDeleteNamedVariableList(); + + if (deleteNamedVariableListResponse.getNumberDeleted().intValue() != 1) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, "number deleted not 1"); + } + + if (serverModel.removeDataSet(dataSet.getReferenceStr()) == null) { + throw new ServiceError(ServiceError.UNKNOWN, "unable to delete dataset locally"); + } + + } + + /** + * The implementation of the GetDataSetValues ACSI service. After a successful return, the Basic Data Attributes of + * the data set members will contain the values read. If one of the data set members could not be read, this will be + * indicated in the returned list. The returned list will have the same size as the member list of the data set. For + * each member it will contain null if reading was successful and a ServiceError if reading of this + * member failed. + * + * @param dataSet + * the DataSet that is to be read. + * @return a list indicating ServiceErrors that may have occurred. + * @throws IOException + * if a fatal IO error occurs. The association object will be closed and can no longer be used after + * this exception is thrown. + */ + public List getDataSetValues(DataSet dataSet) throws IOException { + + ConfirmedServiceResponse confirmedServiceResponse; + try { + ConfirmedServiceRequest serviceRequest = constructGetDataSetValuesRequest(dataSet); + confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + } catch (ServiceError e) { + int dataSetSize = dataSet.getMembers().size(); + List serviceErrors = new ArrayList<>(dataSetSize); + for (int i = 0; i < dataSetSize; i++) { + serviceErrors.add(e); + } + return serviceErrors; + } + return decodeGetDataSetValuesResponse(confirmedServiceResponse, dataSet); + } + + private ConfirmedServiceRequest constructGetDataSetValuesRequest(DataSet dataSet) throws ServiceError { + + VariableAccessSpecification varAccSpec = new VariableAccessSpecification(); + varAccSpec.setVariableListName(dataSet.getMmsObjectName()); + + ReadRequest getDataSetValuesRequest = new ReadRequest(); + getDataSetValuesRequest.setSpecificationWithResult(new BerBoolean(true)); + getDataSetValuesRequest.setVariableAccessSpecification(varAccSpec); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setRead(getDataSetValuesRequest); + + return confirmedServiceRequest; + } + + private List decodeGetDataSetValuesResponse(ConfirmedServiceResponse confirmedServiceResponse, + DataSet ds) { + + int dataSetSize = ds.getMembers().size(); + List serviceErrors = new ArrayList<>(dataSetSize); + + if (confirmedServiceResponse.getRead() == null) { + ServiceError serviceError = new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "Error decoding GetDataValuesReponsePdu"); + for (int i = 0; i < dataSetSize; i++) { + serviceErrors.add(serviceError); + } + return serviceErrors; + } + + ReadResponse readResponse = confirmedServiceResponse.getRead(); + List listOfAccessResults = readResponse.getListOfAccessResult().getAccessResult(); + + if (listOfAccessResults.size() != ds.getMembers().size()) { + ServiceError serviceError = new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "Number of AccessResults does not match the number of DataSet members."); + for (int i = 0; i < dataSetSize; i++) { + serviceErrors.add(serviceError); + } + return serviceErrors; + } + + Iterator accessResultIterator = listOfAccessResults.iterator(); + + for (FcModelNode dsMember : ds) { + AccessResult accessResult = accessResultIterator.next(); + if (accessResult.getSuccess() != null) { + try { + dsMember.setValueFromMmsDataObj(accessResult.getSuccess()); + } catch (ServiceError e) { + serviceErrors.add(e); + } + serviceErrors.add(null); + } + else { + serviceErrors.add(mmsDataAccessErrorToServiceError(accessResult.getFailure())); + } + } + + return serviceErrors; + } + + public List setDataSetValues(DataSet dataSet) throws ServiceError, IOException { + ConfirmedServiceRequest serviceRequest = constructSetDataSetValues(dataSet); + ConfirmedServiceResponse confirmedServiceResponse = encodeWriteReadDecode(serviceRequest); + return decodeSetDataSetValuesResponse(confirmedServiceResponse); + } + + private ConfirmedServiceRequest constructSetDataSetValues(DataSet dataSet) throws ServiceError { + VariableAccessSpecification varAccessSpec = new VariableAccessSpecification(); + varAccessSpec.setVariableListName(dataSet.getMmsObjectName()); + + ListOfData listOfData = new ListOfData(); + List dataList = listOfData.getData(); + + for (ModelNode member : dataSet) { + dataList.add(member.getMmsDataObj()); + } + + WriteRequest writeRequest = new WriteRequest(); + writeRequest.setVariableAccessSpecification(varAccessSpec); + writeRequest.setListOfData(listOfData); + + ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); + confirmedServiceRequest.setWrite(writeRequest); + + return confirmedServiceRequest; + } + + private List decodeSetDataSetValuesResponse(ConfirmedServiceResponse confirmedServiceResponse) + throws ServiceError { + + if (confirmedServiceResponse.getWrite() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "Error decoding SetDataSetValuesReponsePdu"); + } + + WriteResponse writeResponse = confirmedServiceResponse.getWrite(); + List writeResChoiceType = writeResponse.getCHOICE(); + List serviceErrors = new ArrayList<>(writeResChoiceType.size()); + + for (WriteResponse.CHOICE accessResult : writeResChoiceType) { + if (accessResult.getSuccess() != null) { + serviceErrors.add(null); + } + else { + serviceErrors.add(mmsDataAccessErrorToServiceError(accessResult.getFailure())); + } + } + return serviceErrors; + + } + + public void getRcbValues(Rcb rcb) throws ServiceError, IOException { + getDataValues(rcb); + } + + public void reserveUrcb(Urcb urcb) throws ServiceError, IOException { + BdaBoolean resvBda = urcb.getResv(); + resvBda.setValue(true); + setDataValues(resvBda); + } + + public void reserveBrcb(Brcb brcb, short resvTime) throws ServiceError, IOException { + BdaInt16 resvTmsBda = brcb.getResvTms(); + resvTmsBda.setValue(resvTime); + setDataValues(resvTmsBda); + } + + public void cancelUrcbReservation(Urcb urcb) throws ServiceError, IOException { + BdaBoolean resvBda = urcb.getResv(); + resvBda.setValue(false); + setDataValues(resvBda); + } + + public void enableReporting(Rcb rcb) throws ServiceError, IOException { + BdaBoolean rptEnaBda = rcb.getRptEna(); + rptEnaBda.setValue(true); + setDataValues(rptEnaBda); + } + + public void disableReporting(Rcb rcb) throws ServiceError, IOException { + BdaBoolean rptEnaBda = rcb.getRptEna(); + rptEnaBda.setValue(false); + setDataValues(rptEnaBda); + } + + public void startGi(Rcb rcb) throws ServiceError, IOException { + BdaBoolean rptGiBda = (BdaBoolean) rcb.getChild("GI"); + rptGiBda.setValue(true); + setDataValues(rptGiBda); + } + + /** + * Sets the selected values of the given report control block. Note that all these parameters may only be set if + * reporting for this report control block is not enabled and if it is not reserved by another client. The + * parameters PurgeBuf, EntryId are only applicable if the given rcb is of type BRCB. + * + * @param rcb + * the report control block + * @param setRptId + * whether to set the report ID + * @param setDatSet + * whether to set the data set + * @param setOptFlds + * whether to set the optional fields + * @param setBufTm + * whether to set the buffer time + * @param setTrgOps + * whether to set the trigger options + * @param setIntgPd + * whether to set the integrity period + * @param setPurgeBuf + * whether to set purge buffer + * @param setEntryId + * whether to set the entry ID + * @return a list indicating ServiceErrors that may have occurred. + * @throws IOException + * if a fatal IO error occurs. The association object will be closed and can no longer be used after + * this exception is thrown. + */ + public List setRcbValues(Rcb rcb, boolean setRptId, boolean setDatSet, boolean setOptFlds, + boolean setBufTm, boolean setTrgOps, boolean setIntgPd, boolean setPurgeBuf, boolean setEntryId) + throws IOException { + + List parametersToSet = new ArrayList<>(6); + + if (setRptId == true) { + parametersToSet.add(rcb.getRptId()); + } + if (setDatSet == true) { + parametersToSet.add(rcb.getDatSet()); + } + if (setOptFlds == true) { + parametersToSet.add(rcb.getOptFlds()); + } + if (setBufTm == true) { + parametersToSet.add(rcb.getBufTm()); + } + if (setTrgOps == true) { + parametersToSet.add(rcb.getTrgOps()); + } + if (setIntgPd == true) { + parametersToSet.add(rcb.getIntgPd()); + } + if (rcb instanceof Brcb) { + Brcb brcb = (Brcb) rcb; + if (setPurgeBuf == true) { + parametersToSet.add(brcb.getPurgeBuf()); + } + if (setEntryId == true) { + parametersToSet.add(brcb.getEntryId()); + } + } + + List serviceErrors = new ArrayList<>(parametersToSet.size()); + + for (FcModelNode child : parametersToSet) { + try { + setDataValues(child); + serviceErrors.add(null); + } catch (ServiceError e) { + serviceErrors.add(e); + } + } + + return serviceErrors; + } + + private Report processReport(MMSpdu mmsPdu) throws ServiceError { + + if (mmsPdu.getUnconfirmedPDU() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "getReport: Error decoding server response"); + } + + UnconfirmedPDU unconfirmedRes = mmsPdu.getUnconfirmedPDU(); + + if (unconfirmedRes.getService() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "getReport: Error decoding server response"); + } + + UnconfirmedService unconfirmedServ = unconfirmedRes.getService(); + + if (unconfirmedServ.getInformationReport() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "getReport: Error decoding server response"); + } + + List listRes = unconfirmedServ.getInformationReport().getListOfAccessResult().getAccessResult(); + int index = 0; + + if (listRes.get(index).getSuccess().getVisibleString() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "processReport: report does not contain RptID"); + } + + String rptId; + BdaOptFlds optFlds; + Integer sqNum = null; + Integer subSqNum = null; + boolean moreSegmentsFollow = false; + String dataSetRef = null; + boolean bufOvfl = false; + Long confRev = null; + BdaEntryTime timeOfEntry = null; + BdaOctetString entryId = null; + + DataSet dataSet = null; + + rptId = listRes.get(index++).getSuccess().getVisibleString().toString(); + + if (listRes.get(index).getSuccess().getBitString() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "processReport: report does not contain OptFlds"); + } + + optFlds = new BdaOptFlds(new ObjectReference("none"), null); + optFlds.setValue(listRes.get(index++).getSuccess().getBitString().value); + + if (optFlds.isSequenceNumber()) { + sqNum = listRes.get(index++).getSuccess().getUnsigned().intValue(); + } + + if (optFlds.isReportTimestamp()) { + timeOfEntry = new BdaEntryTime(new ObjectReference("none"), null, "", false, false); + timeOfEntry.setValueFromMmsDataObj(listRes.get(index++).getSuccess()); + } + + if (optFlds.isDataSetName()) { + dataSetRef = (listRes.get(index++).getSuccess().getVisibleString().toString()); + } + + if (optFlds.isBufferOverflow()) { + bufOvfl = (listRes.get(index++).getSuccess().getBool().value); + } + + if (optFlds.isEntryId()) { + entryId = new BdaOctetString(new ObjectReference("none"), null, "", 8, false, false); + entryId.setValue(listRes.get(index++).getSuccess().getOctetString().value); + } + + if (optFlds.isConfigRevision()) { + confRev = listRes.get(index++).getSuccess().getUnsigned().longValue(); + } + + if (optFlds.isSegmentation()) { + subSqNum = listRes.get(index++).getSuccess().getUnsigned().intValue(); + moreSegmentsFollow = listRes.get(index++).getSuccess().getBool().value; + } + + BerBitString inclusionBitString = listRes.get(index++).getSuccess().getBitString(); + + if (optFlds.isDataReference()) { + // this is just to move the index to the right place + // The next part will process the changes to the values + // without the dataRefs + for (int i = 0; i < inclusionBitString.numBits; i++) { + if ((inclusionBitString.value[i / 8] & (1 << (7 - i % 8))) == (1 << (7 - i % 8))) { + index++; + } + } + } + + if (dataSetRef == null) { + for (Urcb urcb : serverModel.getUrcbs()) { + if ((urcb.getRptId() != null && urcb.getRptId().getStringValue().equals(rptId)) + || urcb.getReference().toString().equals(rptId)) { + dataSetRef = urcb.getDatSet().getStringValue(); + break; + } + } + } + + if (dataSetRef == null) { + for (Brcb brcb : serverModel.getBrcbs()) { + if ((brcb.getRptId() != null && brcb.getRptId().getStringValue().equals(rptId)) + || brcb.getReference().toString().equals(rptId)) { + dataSetRef = brcb.getDatSet().getStringValue(); + break; + } + } + } + + if (dataSetRef == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "unable to find URCB that matches the given RptID in the report."); + } + + // updating of data set copy - original stays the same + dataSet = serverModel.getDataSet(dataSetRef.replace('$', '.')).copy(); + int shiftNum = 0; + for (ModelNode child : dataSet.getMembers()) { + if ((inclusionBitString.value[shiftNum / 8] & (1 << (7 - shiftNum % 8))) == (1 << (7 - shiftNum % 8))) { + + AccessResult accessRes = listRes.get(index++); + child.setValueFromMmsDataObj(accessRes.getSuccess()); + } + shiftNum++; + } + + List reasonCodes = null; + if (optFlds.isReasonForInclusion()) { + reasonCodes = new ArrayList<>(dataSet.getMembers().size()); + for (int i = 0; i < dataSet.getMembers().size(); i++) { + + if ((inclusionBitString.value[i / 8] & (1 << (7 - i % 8))) == (1 << (7 - i % 8))) { + + BdaReasonForInclusion reasonForInclusion = new BdaReasonForInclusion(null); + + reasonCodes.add(reasonForInclusion); + + byte[] reason = listRes.get(index++).getSuccess().getBitString().value; + + reasonForInclusion.setValue(reason); + + } + + } + } + + return new Report(rptId, optFlds, sqNum, subSqNum, moreSegmentsFollow, dataSetRef, bufOvfl, confRev, + timeOfEntry, entryId, inclusionBitString.value, reasonCodes, dataSet); + + } + + /** + * Performs the Select ACSI Service of the control model on the given controllable Data Object (DO). By selecting a + * controllable DO you can reserve it for exclusive control/operation. This service is only applicable if the + * ctlModel Data Attribute is set to "sbo-with-normal-security" (2). + * + * The selection is canceled in one of the following events: + *

    + *
  • The "Cancel" ACSI service is issued.
  • + *
  • The sboTimemout (select before operate timeout) runs out. If the given controlDataObject contains a + * sboTimeout Data Attribute it is possible to change the timeout after which the selection/reservation is + * automatically canceled by the server. Otherwise the timeout is a local issue of the server.
  • + *
  • The connection to the server is closed.
  • + *
  • An operate service failed because of some error
  • + *
  • The sboClass is set to "operate-once" then the selection is also canceled after a successful operate service. + *
  • + *
+ * + * @param controlDataObject + * needs to be a controllable Data Object that contains a Data Attribute named "SBO". + * @return false if the selection/reservation was not successful (because it is already selected by another client). + * Otherwise true is returned. + * @throws ServiceError + * if a ServiceError is returned by the server. + * @throws IOException + * if a fatal IO error occurs. The association object will be closed and can no longer be used after + * this exception is thrown. + */ + public boolean select(FcModelNode controlDataObject) throws ServiceError, IOException { + BdaVisibleString sbo; + try { + sbo = (BdaVisibleString) controlDataObject.getChild("SBO"); + } catch (Exception e) { + throw new IllegalArgumentException("ModelNode needs to conain a child node named SBO in order to select"); + } + + getDataValues(sbo); + + if (sbo.getValue().length == 0) { + return false; + } + return true; + + } + + /** + * Executes the Operate ACSI Service on the given controllable Data Object (DO). The following subnodes of the given + * control DO should be set according your needs before calling this function. (Note that you can probably leave + * most attributes with their default value): + *
    + *
  • Oper.ctlVal - has to be set to actual control value that is to be written using the operate service.
  • + *
  • Oper.operTm (type: BdaTimestamp) - is an optional sub data attribute of Oper (thus it may not exist). If it + * exists it can be used to set the timestamp when the operation shall be performed by the server. Thus the server + * will delay execution of the operate command until the given date is reached. Can be set to an empty byte array + * (new byte[0]) or null so that the server executes the operate command immediately. This is also the default.
  • + *
  • Oper.check (type: BdaCheck) is used to tell the server whether to perform the synchrocheck and + * interlockcheck. By default they are turned off.
  • + *
  • Oper.orign - contains the two data attributes orCat (origin category, type: BdaInt8) and orIdent (origin + * identifier, type BdaOctetString). Origin is optionally reflected in the status Data Attribute controlDO.origin. + * By reading this data attribute other clients can see who executed the last operate command. The default value for + * orCat is 0 ("not-supported") and the default value for orIdent is ""(the empty string).
  • + *
  • Oper.Test (BdaBoolean) - if true this operate command is sent for test purposes only. Default is false.
  • + *
+ * + * All other operate parameters are automatically handled by this function. + * + * @param controlDataObject + * needs to be a controllable Data Object that contains a Data Attribute named "Oper". + * @throws ServiceError + * if a ServiceError is returned by the server + * @throws IOException + * if a fatal IO error occurs. The association object will be closed and can no longer be used after + * this exception is thrown. + */ + public void operate(FcModelNode controlDataObject) throws ServiceError, IOException { + ConstructedDataAttribute oper; + try { + oper = (ConstructedDataAttribute) controlDataObject.getChild("Oper"); + } catch (Exception e) { + throw new IllegalArgumentException("ModelNode needs to conain a child node named \"Oper\"."); + } + + ((BdaInt8U) oper.getChild("ctlNum")).setValue((short) 1); + ((BdaTimestamp) oper.getChild("T")).setDate(new Date(System.currentTimeMillis())); + + setDataValues(oper); + } + + /** + * Will close the connection simply by closing the TCP socket. + */ + public void close() { + clientReceiver.close(new IOException("Connection closed by client")); + } + + /** + * Will send a disconnect request first and then close the TCP socket. + */ + public void disconnect() { + clientReceiver.disconnect(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/ClientEventListener.java b/src/main/java/org/openmuc/openiec61850/ClientEventListener.java new file mode 100644 index 0000000..a8ae212 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ClientEventListener.java @@ -0,0 +1,48 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.io.IOException; + +/** + * The listener interface for receiving incoming reports and association closed events. A listener is registered through + * the {@link ClientSap#associate(java.net.InetAddress, int, String, ClientEventListener) associate} method. + * + * @author Stefan Feuerhahn + * + */ +public interface ClientEventListener { + + /** + * Invoked when a new report arrives. Note that the implementation of this method needs to be thread safe as it can + * be called in parallel if a new report arrives while an old one is still being processed. + * + * @param report + * the report that arrived. + */ + public void newReport(Report report); + + /** + * Invoked when an IOException occurred for the association. An IOException implies that the ClientAssociation that + * feeds this listener was automatically closed and can no longer be used to receive reports. + * + * @param e + * the exception that occured. + */ + public void associationClosed(IOException e); + +} diff --git a/src/main/java/org/openmuc/openiec61850/ClientSap.java b/src/main/java/org/openmuc/openiec61850/ClientSap.java new file mode 100644 index 0000000..5bac7a1 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ClientSap.java @@ -0,0 +1,341 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.io.IOException; +import java.net.InetAddress; + +import javax.net.SocketFactory; + +import org.openmuc.josistack.ClientAcseSap; + +/** + * The ClientSap class represents the IEC 61850 service access point for client applications. A client + * application that wants to connect to a server should first create an instance of ClientSap. Next all the + * necessary configuration parameters can be set. Finally the associate function is called to connect to + * the server. An instance of ClientSap can be used to create an unlimited number of associations. Changing + * the parameters of a ClientSap has no affect on associations that have already been created. + */ +public final class ClientSap { + + static final int MINIMUM_MMS_PDU_SIZE = 64; + private static final int MAXIMUM_MMS_PDU_SIZE = 65000; + + private static final byte[] DEFAULT_TSEL_LOCAL = new byte[] { 0, 0 }; + private static final byte[] DEFAULT_TSEL_REMOTE = new byte[] { 0, 1 }; + private static final int DEFAUTL_TPDU_SIZE_PARAMETER = 10; // size = 1024 + + private int proposedMaxMmsPduSize = 65000; + private final int proposedMaxServOutstandingCalling = 5; + private final int proposedMaxServOutstandingCalled = 5; + private final int proposedDataStructureNestingLevel = 10; + private byte[] servicesSupportedCalling = new byte[] { (byte) 0xee, 0x1c, 0, 0, 0x04, 0x08, 0, 0, 0x79, (byte) 0xef, + 0x18 }; + + private int messageFragmentTimeout = 10000; + private int responseTimeout = 20000; + + private final ClientAcseSap acseSap; + + /** + * Use this constructor to create a default client SAP. + */ + public ClientSap() { + acseSap = new ClientAcseSap(); + acseSap.tSap.tSelLocal = DEFAULT_TSEL_LOCAL; + acseSap.tSap.tSelRemote = DEFAULT_TSEL_REMOTE; + acseSap.tSap.setMaxTPDUSizeParam(DEFAUTL_TPDU_SIZE_PARAMETER); + } + + /** + * Use this constructor to create a client SAP that uses the given SocketFactory to connect to servers. + * You could pass an SSLSocketFactory to enable SSL. + * + * @param socketFactory + * the socket factory to construct the socket + */ + public ClientSap(SocketFactory socketFactory) { + acseSap = new ClientAcseSap(socketFactory); + acseSap.tSap.tSelLocal = DEFAULT_TSEL_LOCAL; + acseSap.tSap.tSelRemote = DEFAULT_TSEL_REMOTE; + acseSap.tSap.setMaxTPDUSizeParam(DEFAUTL_TPDU_SIZE_PARAMETER); + } + + /** + * Sets the maximum MMS PDU size in bytes that the client association will support. The client proposes this value + * to the server during association. If the server requires the use of a smaller maximum MMS PDU size, then the + * smaller size will be accepted by the client. The default size is 65000. + * + * @param size + * cannot be less than 64. The upper limit is 65000 so that segmentation at the lower transport layer is + * avoided. The Transport Layer's maximum PDU size is 65531. + */ + public void setMaxMmsPduSize(int size) { + if (size >= MINIMUM_MMS_PDU_SIZE && size <= MAXIMUM_MMS_PDU_SIZE) { + proposedMaxMmsPduSize = size; + } + else { + throw new IllegalArgumentException("maximum size is out of bound"); + } + } + + /** + * Gets the maximum MMS PDU size. + * + * @return the maximum MMS PDU size. + */ + public int getMaxMmsPduSize() { + return proposedMaxMmsPduSize; + } + + /** + * Sets the SevicesSupportedCalling parameter. The given parameter is sent to the server but has no affect on the + * functionality of this client. + * + * @param services + * the ServicesSupportedCalling parameter + */ + public void setServicesSupportedCalling(byte[] services) { + if (services.length != 11) { + throw new IllegalArgumentException("The services parameter needs to be of lenth 11"); + } + servicesSupportedCalling = services; + } + + /** + * Gets the ServicesSupportedCalling parameter. + * + * @return the ServicesSupportedCalling parameter. + */ + public byte[] getServicesSupportedCalling() { + return servicesSupportedCalling; + } + + /** + * Sets the remote/called Session-Selector (S-SEL). The default remote S-SEL is byte[] { 0, 1 }. + * + * @param sSelRemote + * the remote/called S-SEL. + */ + public void setSSelRemote(byte[] sSelRemote) { + acseSap.sSelRemote = sSelRemote; + } + + /** + * Sets the local/calling Session-Selector (S-SEL). The default local S-SEL is byte[] { 0, 1 }. + * + * @param sSelLocal + * the local/calling S-SEL. + */ + public void setSSelLocal(byte[] sSelLocal) { + acseSap.sSelLocal = sSelLocal; + } + + /** + * Sets the remote/called Presentation-Selector (P-SEL). The default remote P-SEL is byte[] { 0, 0, 0, 1 }. + * + * @param pSelRemote + * the remote/called P-SEL. + */ + public void setPSelRemote(byte[] pSelRemote) { + acseSap.pSelRemote = pSelRemote; + } + + /** + * Sets the local/calling Presentation-Selector (P-SEL). The default local P-SEL is byte[] { 0, 0, 0, 1 }. + * + * @param pSelLocal + * the local/calling P-SEL. + */ + public void setPSelLocal(byte[] pSelLocal) { + acseSap.pSelLocal = pSelLocal; + } + + /** + * Sets the remote/called Transport-Selector (T-SEL). It is optionally transmitted in the OSI Transport Layer + * connection request (CR). The default remote T-SEL is byte[] { 0, 1 }. + * + * @param tSelRemote + * the remote/called T-SEL. If null the T-SEL will be omitted. No maximum size is defined by the + * standard. + */ + public void setTSelRemote(byte[] tSelRemote) { + acseSap.tSap.tSelRemote = tSelRemote; + } + + /** + * Sets the local/calling Transport-Selector (T-SEL). It is optionally transmitted in the OSI Transport Layer + * connection request (CR). The default local T-SEL byte[] { 0, 0 }. + * + * @param tSelLocal + * the local/calling T-SEL. If null the T-SEL will be omitted. No maximum size is defined by the + * standard. + */ + public void setTSelLocal(byte[] tSelLocal) { + acseSap.tSap.tSelLocal = tSelLocal; + } + + /** + * Set the maxTPDUSize. The default maxTPduSize is 65531 (see RFC 1006). + * + * @param maxTPduSizeParam + * The maximum length is equal to 2^(maxTPduSizeParam) octets. Note that the actual TSDU size that can be + * transfered is equal to TPduSize-3. Default is 65531 octets (see RFC 1006), 7 <= maxTPduSizeParam + * <= 16, needs to be set before listening or connecting + */ + public void setMaxTPduSizeParameter(int maxTPduSizeParam) { + acseSap.tSap.setMaxTPDUSizeParam(maxTPduSizeParam); + } + + /** + * Sets the remote/called Application Process Title. The default value is int[] { 1, 1, 999, 1, 1 } + * + * @param title + * the remote/called AP title. + */ + public void setApTitleCalled(int[] title) { + acseSap.setApTitleCalled(title); + } + + /** + * Sets the local/calling Application Process Title. The default value is int[] { 1, 1, 999, 1 } + * + * @param title + * the local/calling AP title. + */ + public void setApTitleCalling(int[] title) { + acseSap.setApTitleCalling(title); + } + + /** + * Sets the remote/called Application Entity Qualifier. The default value is 12. + * + * @param qualifier + * the remote/called AE Qualifier + */ + public void setAeQualifierCalled(int qualifier) { + acseSap.setAeQualifierCalled(qualifier); + } + + /** + * Sets the local/calling Application Entity Qualifier. The default value is 12. + * + * @param qualifier + * the local/calling AE Qualifier + */ + public void setAeQualifierCalling(int qualifier) { + acseSap.setAeQualifierCalling(qualifier); + } + + /** + * Sets the default response timeout of the ClientAssociation that is created using this ClientSap. + * + * @param timeout + * the response timeout in milliseconds. The default is 20000. + */ + public void setResponseTimeout(int timeout) { + responseTimeout = timeout; + } + + /** + * Sets the message fragment timeout. This is the timeout that the socket timeout is set to after the first byte of + * a message has been received. A request function (e.g. setDataValues()) will throw an IOException if the socket + * throws this timeout because the association/connection cannot recover from this kind of error. + * + * @param timeout + * the timeout in milliseconds. The default is 10000. + */ + public void setMessageFragmentTimeout(int timeout) { + messageFragmentTimeout = timeout; + } + + /** + * Connects to the IEC 61850 MMS server at the given address and port and returns the resulting association object. + * + * @param address + * the address to connect to. + * @param port + * the port to connect to. Usually the MMS port is 102. + * @param authenticationParameter + * an optional authentication parameters that is transmitted. It will be omitted if equal to null. + * @param reportListener + * the listener to be notified of incoming reports + * @return the association object + * @throws IOException + * if any kind of error occurs trying build up the association + */ + public ClientAssociation associate(InetAddress address, int port, String authenticationParameter, + ClientEventListener reportListener) throws IOException { + + return associate(address, port, authenticationParameter, null, -1, reportListener); + } + + /** + * Connects to the IEC 61850 MMS server at the given address and port and returns the resulting association object. + * + * @param address + * the address to connect to + * @param port + * the port to connect to. Usually the MMS port is 102. + * @param authenticationParameter + * an optional authentication parameters that is transmitted. It will be omitted if equal to null. + * @param localAddr + * the local address to use + * @param localPort + * the local port to use + * @param reportListener + * the listener to be notified of incoming reports + * @return the association object. + * @throws IOException + * if any kind of error occurs trying build up the association + */ + public ClientAssociation associate(InetAddress address, int port, String authenticationParameter, + InetAddress localAddr, int localPort, ClientEventListener reportListener) throws IOException { + + if (port < 0 || port > 65535) { + throw new IllegalArgumentException("invalid port"); + } + + if (address == null) { + throw new IllegalArgumentException("address may not be null"); + } + + if (acseSap.sSelRemote == null) { + throw new IllegalArgumentException("sSelRemote may not be null"); + } + + if (acseSap.sSelRemote.length != 2) { + throw new IllegalArgumentException("sSelRemote lenght must be two"); + } + + if (acseSap.sSelLocal == null) { + throw new IllegalArgumentException("sSelLocal may not be null"); + } + + if (acseSap.sSelLocal.length != 2) { + throw new IllegalArgumentException("sSelLocal lenght must be two"); + } + + ClientAssociation clientAssociation = new ClientAssociation(address, port, localAddr, localPort, + authenticationParameter, acseSap, proposedMaxMmsPduSize, proposedMaxServOutstandingCalling, + proposedMaxServOutstandingCalled, proposedDataStructureNestingLevel, servicesSupportedCalling, + responseTimeout, messageFragmentTimeout, reportListener); + + return clientAssociation; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/ConstructedDataAttribute.java b/src/main/java/org/openmuc/openiec61850/ConstructedDataAttribute.java new file mode 100644 index 0000000..acd1d65 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ConstructedDataAttribute.java @@ -0,0 +1,88 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; + +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.Data.Structure; + +public final class ConstructedDataAttribute extends FcModelNode { + + public ConstructedDataAttribute(ObjectReference objectReference, Fc fc, List children) { + this.objectReference = objectReference; + this.fc = fc; + this.children = new LinkedHashMap<>((int) ((children.size() / 0.75) + 1)); + for (ModelNode child : children) { + this.children.put(child.getName(), child); + child.setParent(this); + } + } + + @Override + public ConstructedDataAttribute copy() { + List subDataAttributesCopy = new ArrayList<>(); + for (ModelNode subDA : children.values()) { + subDataAttributesCopy.add((FcModelNode) subDA.copy()); + } + return new ConstructedDataAttribute(getReference(), fc, subDataAttributesCopy); + } + + @Override + Data getMmsDataObj() { + Structure structure = new Structure(); + List seq = structure.getData(); + + for (ModelNode modelNode : getChildren()) { + Data child = modelNode.getMmsDataObj(); + if (child == null) { + throw new IllegalArgumentException( + "Unable to convert Child: " + modelNode.objectReference + " to MMS Data Object."); + } + seq.add(child); + } + if (seq.size() == 0) { + throw new IllegalArgumentException("Converting ModelNode: " + objectReference + + " to MMS Data Object resulted in Sequence of size zero."); + } + + Data data = new Data(); + data.setStructure(structure); + + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getStructure() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: structure"); + } + if (data.getStructure().getData().size() != children.size()) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, + "expected type: structure with " + children.size() + " elements"); + } + + Iterator iterator = data.getStructure().getData().iterator(); + for (ModelNode child : children.values()) { + child.setValueFromMmsDataObj(iterator.next()); + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/DataDefinitionResParser.java b/src/main/java/org/openmuc/openiec61850/DataDefinitionResParser.java new file mode 100644 index 0000000..a6bd8f1 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/DataDefinitionResParser.java @@ -0,0 +1,274 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; + +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedServiceResponse; +import org.openmuc.openiec61850.internal.mms.asn1.GetVariableAccessAttributesResponse; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription.Structure.Components; +import org.openmuc.openiec61850.internal.mms.asn1.TypeSpecification; + +final class DataDefinitionResParser { + + static LogicalNode parseGetDataDefinitionResponse(ConfirmedServiceResponse confirmedServiceResponse, + ObjectReference lnRef) throws ServiceError { + + if (confirmedServiceResponse.getGetVariableAccessAttributes() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "decodeGetDataDefinitionResponse: Error decoding GetDataDefinitionResponsePdu"); + } + + GetVariableAccessAttributesResponse varAccAttrs = confirmedServiceResponse.getGetVariableAccessAttributes(); + TypeDescription typeSpec = varAccAttrs.getTypeDescription(); + if (typeSpec.getStructure() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "decodeGetDataDefinitionResponse: Error decoding GetDataDefinitionResponsePdu"); + } + + Components structure = typeSpec.getStructure().getComponents(); + + List fcDataObjects = new LinkedList<>(); + + Fc fc; + for (TypeDescription.Structure.Components.SEQUENCE fcComponent : structure.getSEQUENCE()) { + if (fcComponent.getComponentName() == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "Error decoding GetDataDefinitionResponsePdu"); + } + + if (fcComponent.getComponentType().getTypeDescription().getStructure() == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "Error decoding GetDataDefinitionResponsePdu"); + } + + String fcString = fcComponent.getComponentName().toString(); + if (fcString.equals("LG") || fcString.equals("GO") || fcString.equals("GS") || fcString.equals("MS") + || fcString.equals("US")) { + continue; + } + + fc = Fc.fromString(fcComponent.getComponentName().toString()); + Components subStructure = fcComponent.getComponentType() + .getTypeDescription() + .getStructure() + .getComponents(); + + fcDataObjects.addAll(getFcDataObjectsFromSubStructure(lnRef, fc, subStructure)); + + } + + LogicalNode ln = new LogicalNode(lnRef, fcDataObjects); + + return ln; + + } + + private static List getFcDataObjectsFromSubStructure(ObjectReference lnRef, Fc fc, + Components components) throws ServiceError { + + List structComponents = components.getSEQUENCE(); + List dataObjects = new ArrayList<>(structComponents.size()); + + for (TypeDescription.Structure.Components.SEQUENCE doComp : structComponents) { + if (doComp.getComponentName() == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "Error decoding GetDataDefinitionResponsePdu"); + } + if (doComp.getComponentType().getTypeDescription() == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "Error decoding GetDataDefinitionResponsePdu"); + } + + ObjectReference doRef = new ObjectReference(lnRef + "." + doComp.getComponentName().toString()); + List children = getDoSubModelNodesFromSubStructure(doRef, fc, + doComp.getComponentType().getTypeDescription().getStructure().getComponents()); + if (fc == Fc.RP) { + dataObjects.add(new Urcb(doRef, children)); + } + else if (fc == Fc.BR) { + dataObjects.add(new Brcb(doRef, children)); + } + else { + dataObjects.add(new FcDataObject(doRef, fc, children)); + } + + } + + return dataObjects; + + } + + private static List getDoSubModelNodesFromSubStructure(ObjectReference parentRef, Fc fc, + Components structure) throws ServiceError { + + Collection structComponents = structure.getSEQUENCE(); + List dataObjects = new ArrayList<>(structComponents.size()); + + for (TypeDescription.Structure.Components.SEQUENCE component : structComponents) { + if (component.getComponentName() == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "Error decoding GetDataDefinitionResponsePdu"); + } + + String childName = component.getComponentName().toString(); + dataObjects.add(getModelNodesFromTypeSpecification(new ObjectReference(parentRef + "." + childName), fc, + component.getComponentType())); + + } + return dataObjects; + } + + private static FcModelNode getModelNodesFromTypeSpecification(ObjectReference ref, Fc fc, + TypeSpecification mmsTypeSpec) throws ServiceError { + + if (mmsTypeSpec.getTypeDescription().getArray() != null) { + + int numArrayElements = mmsTypeSpec.getTypeDescription().getArray().getNumberOfElements().intValue(); + List arrayChildren = new ArrayList<>(numArrayElements); + for (int i = 0; i < numArrayElements; i++) { + arrayChildren.add( + getModelNodesFromTypeSpecification(new ObjectReference(ref + "(" + Integer.toString(i) + ")"), + fc, mmsTypeSpec.getTypeDescription().getArray().getElementType())); + } + + return new Array(ref, fc, arrayChildren); + + } + + if (mmsTypeSpec.getTypeDescription().getStructure() != null) { + List children = getDoSubModelNodesFromSubStructure(ref, fc, + mmsTypeSpec.getTypeDescription().getStructure().getComponents()); + return (new ConstructedDataAttribute(ref, fc, children)); + } + + // it is a single element + BasicDataAttribute bt = convertMmsBasicTypeSpec(ref, fc, mmsTypeSpec.getTypeDescription()); + if (bt == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "decodeGetDataDefinitionResponse: Unknown data type received " + ref); + } + return (bt); + + } + + private static BasicDataAttribute convertMmsBasicTypeSpec(ObjectReference ref, Fc fc, TypeDescription mmsTypeSpec) + throws ServiceError { + + if (mmsTypeSpec.getBool() != null) { + return new BdaBoolean(ref, fc, null, false, false); + } + if (mmsTypeSpec.getBitString() != null) { + int bitStringMaxLength = Math.abs(mmsTypeSpec.getBitString().intValue()); + + if (bitStringMaxLength == 13) { + return new BdaQuality(ref, fc, null, false); + } + else if (bitStringMaxLength == 10) { + return new BdaOptFlds(ref, fc); + } + else if (bitStringMaxLength == 6) { + return new BdaTriggerConditions(ref, fc); + } + else if (bitStringMaxLength == 2) { + if (fc == Fc.CO) { + // if name == ctlVal + if (ref.getName().charAt(1) == 't') { + return new BdaTapCommand(ref, fc, null, false, false); + } + // name == Check + else { + return new BdaCheck(ref); + } + } + else { + return new BdaDoubleBitPos(ref, fc, null, false, false); + } + } + return null; + } + else if (mmsTypeSpec.getInteger() != null) { + switch (mmsTypeSpec.getInteger().intValue()) { + case 8: + return new BdaInt8(ref, fc, null, false, false); + case 16: + return new BdaInt16(ref, fc, null, false, false); + case 32: + return new BdaInt32(ref, fc, null, false, false); + case 64: + return new BdaInt64(ref, fc, null, false, false); + } + } + else if (mmsTypeSpec.getUnsigned() != null) { + switch (mmsTypeSpec.getUnsigned().intValue()) { + case 8: + return new BdaInt8U(ref, fc, null, false, false); + case 16: + return new BdaInt16U(ref, fc, null, false, false); + case 32: + return new BdaInt32U(ref, fc, null, false, false); + } + } + else if (mmsTypeSpec.getFloatingPoint() != null) { + int floatSize = mmsTypeSpec.getFloatingPoint().getFormatWidth().intValue(); + if (floatSize == 32) { + return new BdaFloat32(ref, fc, null, false, false); + } + else if (floatSize == 64) { + return new BdaFloat64(ref, fc, null, false, false); + } + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "FLOAT of size: " + floatSize + " is not supported."); + } + else if (mmsTypeSpec.getOctetString() != null) { + int stringSize = mmsTypeSpec.getOctetString().intValue(); + if (stringSize > 255 || stringSize < -255) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "OCTET_STRING of size: " + stringSize + " is not supported."); + } + return new BdaOctetString(ref, fc, null, Math.abs(stringSize), false, false); + + } + else if (mmsTypeSpec.getVisibleString() != null) { + int stringSize = mmsTypeSpec.getVisibleString().intValue(); + if (stringSize > 255 || stringSize < -255) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "VISIBLE_STRING of size: " + stringSize + " is not supported."); + } + return new BdaVisibleString(ref, fc, null, Math.abs(stringSize), false, false); + } + else if (mmsTypeSpec.getMMSString() != null) { + int stringSize = mmsTypeSpec.getMMSString().intValue(); + if (stringSize > 255 || stringSize < -255) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "UNICODE_STRING of size: " + stringSize + " is not supported."); + } + return new BdaUnicodeString(ref, fc, null, Math.abs(stringSize), false, false); + } + else if (mmsTypeSpec.getUtcTime() != null) { + return new BdaTimestamp(ref, fc, null, false, false); + } + else if (mmsTypeSpec.getBinaryTime() != null) { + return new BdaEntryTime(ref, fc, null, false, false); + } + return null; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/DataSet.java b/src/main/java/org/openmuc/openiec61850/DataSet.java new file mode 100644 index 0000000..d1e8c61 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/DataSet.java @@ -0,0 +1,148 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.openmuc.openiec61850.internal.mms.asn1.Identifier; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectName; + +public final class DataSet implements Iterable { + + private final String dataSetReference; + private final List members; + private final Map> membersMap = new EnumMap<>(Fc.class); + private final boolean deletable; + private ObjectName mmsObjectName = null; + + public DataSet(String dataSetReference, List members) { + this(dataSetReference, members, true); + } + + public DataSet(String dataSetReference, List members, boolean deletable) { + if (!dataSetReference.startsWith("@") && dataSetReference.indexOf('/') == -1) { + throw new IllegalArgumentException("DataSet reference " + dataSetReference + + " is invalid. Must either start with @ or contain a slash."); + } + this.members = new LinkedList<>(); + this.dataSetReference = dataSetReference; + this.deletable = deletable; + + for (Fc myfc : Fc.values()) { + membersMap.put(myfc, new LinkedHashMap()); + } + + for (FcModelNode member : members) { + this.members.add(member); + membersMap.get(member.getFc()).put(member.getReference().toString(), member); + } + } + + public String getReferenceStr() { + return dataSetReference; + } + + public DataSet copy() { + List membersCopy = new ArrayList<>(members.size()); + for (FcModelNode node : members) { + membersCopy.add((FcModelNode) node.copy()); + } + return new DataSet(dataSetReference, membersCopy, deletable); + } + + public FcModelNode getMember(ObjectReference memberReference, Fc fc) { + if (fc != null) { + return membersMap.get(fc).get(memberReference.toString()); + } + for (FcModelNode member : members) { + if (member.getReference().toString().equals(memberReference.toString())) { + return member; + } + } + return null; + } + + public FcModelNode getMember(int index) { + return members.get(index); + } + + public List getMembers() { + return members; + } + + /** + * Those DataSets defined in the SCL file are not deletable. All other DataSets are deletable. Note that no + * Reports/Logs may be using the DataSet otherwise it cannot be deleted (but this function will still return true). + * + * @return true if deletable + */ + public boolean isDeletable() { + return deletable; + } + + @Override + public Iterator iterator() { + return members.iterator(); + } + + public List getBasicDataAttributes() { + List subBasicDataAttributes = new LinkedList<>(); + for (ModelNode member : members) { + subBasicDataAttributes.addAll(member.getBasicDataAttributes()); + } + return subBasicDataAttributes; + } + + ObjectName getMmsObjectName() { + + if (mmsObjectName != null) { + return mmsObjectName; + } + + if (dataSetReference.charAt(0) == '@') { + mmsObjectName = new ObjectName(); + mmsObjectName.setAaSpecific(new Identifier(dataSetReference.getBytes())); + return mmsObjectName; + } + + int slash = dataSetReference.indexOf('/'); + String domainID = dataSetReference.substring(0, slash); + String itemID = dataSetReference.substring(slash + 1, dataSetReference.length()).replace('.', '$'); + + ObjectName.DomainSpecific domainSpecificObjectName = new ObjectName.DomainSpecific(); + domainSpecificObjectName.setDomainID(new Identifier(domainID.getBytes())); + domainSpecificObjectName.setItemID(new Identifier(itemID.getBytes())); + + mmsObjectName = new ObjectName(); + mmsObjectName.setDomainSpecific(domainSpecificObjectName); + + return mmsObjectName; + + } + + @Override + public String toString() { + return dataSetReference; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/Fc.java b/src/main/java/org/openmuc/openiec61850/Fc.java new file mode 100644 index 0000000..c8fad68 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/Fc.java @@ -0,0 +1,71 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public enum Fc { + + // The following FCs are not part of this enum because they are not really + // FCs and only defined in part 8-1: + // RP (report), LG (log), BR (buffered report), GO, GS, MS, US + + // FCs according to IEC 61850-7-2: + /** Status information */ + ST, + /** Measurands - analogue values */ + MX, + /** Setpoint */ + SP, + /** Substitution */ + SV, + /** Configuration */ + CF, + /** Description */ + DC, + /** Setting group */ + SG, + /** Setting group editable */ + SE, + /** Service response / Service tracking */ + SR, + /** Operate received */ + OR, + /** Blocking */ + BL, + /** Extended definition */ + EX, + /** Control, deprecated but kept here for backward compatibility */ + CO, + /** Unbuffered Reporting */ + RP, + /** Buffered Reporting */ + BR; + + /* + * * @param fc + * + * @return + */ + + public static Fc fromString(String fc) { + try { + return Fc.valueOf(fc); + } catch (Exception e) { + return null; + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/FcDataObject.java b/src/main/java/org/openmuc/openiec61850/FcDataObject.java new file mode 100644 index 0000000..b6503df --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/FcDataObject.java @@ -0,0 +1,97 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; + +import org.openmuc.openiec61850.internal.mms.asn1.Data; + +/** + * This class represents a functionally constraint DataObject. That means it has unique reference and + * FunctionalConstraint. A DataObject as defined in part 7-3 is made up of 1..n FcDataObjects where n is the number of + * different FunctionalConstraints that the children of the DataObject have. An FcDataObject can have children of types + * FcDataObject, Array, ConstructedDataAttribute or BasicDataAttribute. + * + * @author Stefan Feuerhahn + * + */ +public class FcDataObject extends FcModelNode { + + public FcDataObject(ObjectReference objectReference, Fc fc, List children) { + + this.children = new LinkedHashMap<>((int) ((children.size() / 0.75) + 1)); + this.objectReference = objectReference; + for (ModelNode child : children) { + this.children.put(child.getReference().getName(), child); + child.setParent(this); + } + this.fc = fc; + } + + @Override + public FcDataObject copy() { + List childCopies = new ArrayList<>(children.size()); + for (ModelNode childNode : children.values()) { + childCopies.add((FcModelNode) childNode.copy()); + } + return new FcDataObject(objectReference, fc, childCopies); + } + + @Override + Data getMmsDataObj() { + Data.Structure dataStructure = new Data.Structure(); + List seq = dataStructure.getData(); + + for (ModelNode modelNode : getChildren()) { + Data child = modelNode.getMmsDataObj(); + if (child == null) { + throw new IllegalArgumentException( + "Unable to convert Child: " + modelNode.objectReference + " to MMS Data Object."); + } + seq.add(child); + } + if (seq.size() == 0) { + throw new IllegalArgumentException("Converting ModelNode: " + objectReference + + " to MMS Data Object resulted in Sequence of size zero."); + } + + Data data = new Data(); + data.setStructure(dataStructure); + + return data; + } + + @Override + void setValueFromMmsDataObj(Data data) throws ServiceError { + if (data.getStructure() == null) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: structure"); + } + if (data.getStructure().getData().size() != children.size()) { + throw new ServiceError(ServiceError.TYPE_CONFLICT, + "expected type: structure with " + children.size() + " elements"); + } + + Iterator iterator = data.getStructure().getData().iterator(); + for (ModelNode child : children.values()) { + child.setValueFromMmsDataObj(iterator.next()); + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/FcModelNode.java b/src/main/java/org/openmuc/openiec61850/FcModelNode.java new file mode 100644 index 0000000..b7b81c6 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/FcModelNode.java @@ -0,0 +1,250 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; + +import org.openmuc.openiec61850.internal.mms.asn1.AlternateAccess; +import org.openmuc.openiec61850.internal.mms.asn1.AlternateAccessSelection; +import org.openmuc.openiec61850.internal.mms.asn1.AlternateAccessSelection.SelectAccess; +import org.openmuc.openiec61850.internal.mms.asn1.AlternateAccessSelection.SelectAccess.Component; +import org.openmuc.openiec61850.internal.mms.asn1.BasicIdentifier; +import org.openmuc.openiec61850.internal.mms.asn1.Identifier; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectName; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned32; +import org.openmuc.openiec61850.internal.mms.asn1.VariableDefs; +import org.openmuc.openiec61850.internal.mms.asn1.VariableSpecification; + +public abstract class FcModelNode extends ModelNode { + + private VariableDefs.SEQUENCE variableDef = null; + Fc fc; + private ServerAssociation selected = null; + private TimerTask task = null; + + public Fc getFc() { + return fc; + } + + boolean select(ServerAssociation association, Timer timer) { + if (selected != null) { + if (selected != association) { + return false; + } + } + else { + selected = association; + association.selects.add(this); + } + + ModelNode sboTimeoutNode = association.serverModel.findModelNode(objectReference, Fc.CF).getChild("sboTimeout"); + + if (sboTimeoutNode == null) { + return true; + } + + long sboTimeout = ((BdaInt32U) sboTimeoutNode).getValue(); + + if (sboTimeout == 0) { + return true; + } + + class SelectResetTask extends TimerTask { + ServerAssociation association; + + SelectResetTask(ServerAssociation association) { + this.association = association; + } + + @Override + public void run() { + synchronized (association.serverModel) { + if (task == this) { + task = null; + deselectAndRemove(association); + } + } + } + } + + if (task != null) { + task.cancel(); + } + + task = new SelectResetTask(association); + timer.schedule(task, sboTimeout); + + return true; + + } + + void deselectAndRemove(ServerAssociation association) { + selected = null; + if (task != null) { + task.cancel(); + task = null; + } + association.selects.remove(this); + } + + void deselect() { + selected = null; + if (task != null) { + task.cancel(); + task = null; + } + } + + boolean isSelected() { + if (selected == null) { + return false; + } + return true; + } + + boolean isSelectedBy(ServerAssociation association) { + if (selected == association) { + return true; + } + return false; + } + + VariableDefs.SEQUENCE getMmsVariableDef() { + + if (variableDef != null) { + return variableDef; + } + + AlternateAccess alternateAccess = null; + + StringBuilder preArrayIndexItemId = new StringBuilder(objectReference.get(1)); + preArrayIndexItemId.append("$"); + preArrayIndexItemId.append(fc); + + int arrayIndexPosition = objectReference.getArrayIndexPosition(); + if (arrayIndexPosition != -1) { + + for (int i = 2; i < arrayIndexPosition; i++) { + preArrayIndexItemId.append("$"); + preArrayIndexItemId.append(objectReference.get(i)); + } + + alternateAccess = new AlternateAccess(); + List subSeqOfAlternateAccess = alternateAccess.getCHOICE(); + Unsigned32 indexBerInteger = new Unsigned32(Integer.parseInt(objectReference.get(arrayIndexPosition))); + + if (arrayIndexPosition < (objectReference.size() - 1)) { + // this reference points to a sub-node of an array element + + StringBuilder postArrayIndexItemId = new StringBuilder(objectReference.get(arrayIndexPosition + 1)); + + for (int i = (arrayIndexPosition + 2); i < objectReference.size(); i++) { + postArrayIndexItemId.append("$"); + postArrayIndexItemId.append(objectReference.get(i)); + } + + BasicIdentifier subIndexReference = new BasicIdentifier(postArrayIndexItemId.toString().getBytes()); + + AlternateAccessSelection.SelectAccess subIndexReferenceSelectAccess = new AlternateAccessSelection.SelectAccess(); + Component component = new Component(); + component.setBasic(subIndexReference); + subIndexReferenceSelectAccess.setComponent(component); + + AlternateAccessSelection subIndexReferenceAlternateAccessSelection = new AlternateAccessSelection(); + subIndexReferenceAlternateAccessSelection.setSelectAccess(subIndexReferenceSelectAccess); + + AlternateAccess.CHOICE subIndexReferenceAlternateAccessSubChoice = new AlternateAccess.CHOICE(); + subIndexReferenceAlternateAccessSubChoice.setUnnamed(subIndexReferenceAlternateAccessSelection); + + AlternateAccess subIndexReferenceAlternateAccess = new AlternateAccess(); + + List subIndexReferenceAlternateAccessSubSeqOf = subIndexReferenceAlternateAccess + .getCHOICE(); + subIndexReferenceAlternateAccessSubSeqOf.add(subIndexReferenceAlternateAccessSubChoice); + + // set array index: + + AlternateAccessSelection.SelectAlternateAccess.AccessSelection indexAccessSelectionChoice = new AlternateAccessSelection.SelectAlternateAccess.AccessSelection(); + indexAccessSelectionChoice.setIndex(indexBerInteger); + + AlternateAccessSelection.SelectAlternateAccess indexAndLowerReferenceSelectAlternateAccess = new AlternateAccessSelection.SelectAlternateAccess(); + indexAndLowerReferenceSelectAlternateAccess.setAccessSelection(indexAccessSelectionChoice); + indexAndLowerReferenceSelectAlternateAccess.setAlternateAccess(subIndexReferenceAlternateAccess); + + AlternateAccessSelection indexAndLowerReferenceAlternateAccessSelection = new AlternateAccessSelection(); + indexAndLowerReferenceAlternateAccessSelection + .setSelectAlternateAccess(indexAndLowerReferenceSelectAlternateAccess); + + AlternateAccess.CHOICE indexAndLowerReferenceAlternateAccessChoice = new AlternateAccess.CHOICE(); + indexAndLowerReferenceAlternateAccessChoice.setUnnamed(indexAndLowerReferenceAlternateAccessSelection); + + subSeqOfAlternateAccess.add(indexAndLowerReferenceAlternateAccessChoice); + + } + else { + SelectAccess selectAccess = new SelectAccess(); + selectAccess.setIndex(indexBerInteger); + + AlternateAccessSelection alternateAccessSelection = new AlternateAccessSelection(); + alternateAccessSelection.setSelectAccess(selectAccess); + + AlternateAccess.CHOICE alternateAccessChoice = new AlternateAccess.CHOICE(); + alternateAccessChoice.setUnnamed(alternateAccessSelection); + + subSeqOfAlternateAccess.add(alternateAccessChoice); + } + + } + else { + + for (int i = 2; i < objectReference.size(); i++) { + preArrayIndexItemId.append("$"); + preArrayIndexItemId.append(objectReference.get(i)); + } + } + + ObjectName.DomainSpecific domainSpecificObjectName = new ObjectName.DomainSpecific(); + domainSpecificObjectName.setDomainID(new Identifier(objectReference.get(0).getBytes())); + domainSpecificObjectName.setItemID(new Identifier(preArrayIndexItemId.toString().getBytes())); + + ObjectName objectName = new ObjectName(); + objectName.setDomainSpecific(domainSpecificObjectName); + + VariableSpecification varSpec = new VariableSpecification(); + varSpec.setName(objectName); + + variableDef = new VariableDefs.SEQUENCE(); + variableDef.setAlternateAccess(alternateAccess); + variableDef.setVariableSpecification(varSpec); + + return variableDef; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getReference().toString()).append(" [").append(fc).append("]"); + for (ModelNode childNode : children.values()) { + sb.append("\n"); + sb.append(childNode.toString()); + } + return sb.toString(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/HexConverter.java b/src/main/java/org/openmuc/openiec61850/HexConverter.java new file mode 100644 index 0000000..408692b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/HexConverter.java @@ -0,0 +1,155 @@ +package org.openmuc.openiec61850; + +public class HexConverter { + + public static String toHexString(byte b) { + StringBuilder builder = new StringBuilder(); + appendHexString(b, builder); + return builder.toString(); + } + + public static String toHexString(byte[] bytes) { + return toHexString(bytes, 0, bytes.length); + } + + public static String toHexString(byte[] bytes, int offset, int length) { + StringBuilder builder = new StringBuilder(); + + int l = 1; + for (int i = offset; i < (offset + length); i++) { + if ((l != 1) && ((l - 1) % 8 == 0)) { + builder.append(' '); + } + if ((l != 1) && ((l - 1) % 16 == 0)) { + builder.append('\n'); + } + l++; + appendHexString(bytes[i], builder); + if (i != offset + length - 1) { + builder.append(' '); + } + } + + return builder.toString(); + } + + /** + * Returns the integer value as hex string filled with leading zeros. If you do not want leading zeros use + * Integer.toHexString(int i) instead. + * + * @param i + * the integer value to be converted + * @return the hex string + */ + public static String toShortHexString(int i) { + byte[] bytes = new byte[] { (byte) (i >> 24), (byte) (i >> 16), (byte) (i >> 8), (byte) (i) }; + return toShortHexString(bytes); + } + + /** + * Returns the long value as hex string filled with leading zeros. If you do not want leading zeros use + * Long.toHexString(long i) instead. + * + * @param l + * the long value to be converted + * @return the hex string + */ + public static String toShortHexString(long l) { + byte[] bytes = new byte[] { (byte) (l >> 56), (byte) (l >> 48), (byte) (l >> 40), (byte) (l >> 32), + (byte) (l >> 24), (byte) (l >> 16), (byte) (l >> 8), (byte) (l) }; + return toShortHexString(bytes); + } + + /** + * Returns the byte as a hex string. If b is less than 16 the hex string returned contains a leading zero. + * + * @param b + * the byte to be converted + * @return the byte as a hex string. + */ + public static String toShortHexString(byte b) { + return toShortHexString(new byte[] { b }); + } + + private final static char[] hexArray = "0123456789ABCDEF".toCharArray(); + + public static String toShortHexString(byte[] bytes) { + return toShortHexString(bytes, 0, bytes.length); + } + + public static String toShortHexString(byte[] bytes, int offset, int length) { + char[] hexChars = new char[length * 2]; + for (int j = offset; j < (offset + length); j++) { + int v = bytes[j] & 0xff; + hexChars[j * 2] = hexArray[v >>> 4]; + hexChars[j * 2 + 1] = hexArray[v & 0x0f]; + } + return new String(hexChars); + } + + public static byte[] fromShortHexString(String shortHexString) throws NumberFormatException { + + validate(shortHexString); + + int length = shortHexString.length(); + + byte[] data = new byte[length / 2]; + for (int i = 0; i < length; i += 2) { + int firstCharacter = Character.digit(shortHexString.charAt(i), 16); + int secondCharacter = Character.digit(shortHexString.charAt(i + 1), 16); + + if (firstCharacter == -1 || secondCharacter == -1) { + throw new NumberFormatException("string is not a legal hex string."); + } + + data[i / 2] = (byte) ((firstCharacter << 4) + secondCharacter); + } + return data; + } + + public static void appendShortHexString(byte b, StringBuilder builder) { + builder.append(toShortHexString(b)); + } + + public static void appendShortHexString(StringBuilder builder, byte[] bytes, int offset, int length) { + builder.append(toShortHexString(bytes, offset, length)); + } + + public static void appendHexString(byte b, StringBuilder builder) { + builder.append("0x"); + appendShortHexString(b, builder); + } + + public static void appendHexString(StringBuilder builder, byte[] byteArray, int offset, int length) { + int l = 1; + for (int i = offset; i < (offset + length); i++) { + if ((l != 1) && ((l - 1) % 8 == 0)) { + builder.append(' '); + } + if ((l != 1) && ((l - 1) % 16 == 0)) { + builder.append('\n'); + } + l++; + appendHexString(byteArray[i], builder); + if (i != offset + length - 1) { + builder.append(' '); + } + } + } + + private static void validate(String s) { + if (s == null) { + throw new IllegalArgumentException("string s may not be null"); + } + + if ((s.length() == 0) || ((s.length() % 2) != 0)) { + throw new NumberFormatException("string is not a legal hex string."); + } + } + + /** + * Don't let anyone instantiate this class. + */ + private HexConverter() { + } +} diff --git a/src/main/java/org/openmuc/openiec61850/LogicalDevice.java b/src/main/java/org/openmuc/openiec61850/LogicalDevice.java new file mode 100644 index 0000000..c2fcfec --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/LogicalDevice.java @@ -0,0 +1,43 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; + +public final class LogicalDevice extends ModelNode { + + public LogicalDevice(ObjectReference objectReference, List logicalNodes) { + children = new LinkedHashMap<>((int) ((logicalNodes.size() / 0.75) + 1)); + this.objectReference = objectReference; + for (LogicalNode logicalNode : logicalNodes) { + children.put(logicalNode.getReference().getName(), logicalNode); + logicalNode.setParent(this); + } + } + + @Override + public LogicalDevice copy() { + List childCopies = new ArrayList<>(children.size()); + for (ModelNode childNode : children.values()) { + childCopies.add((LogicalNode) childNode.copy()); + } + return new LogicalDevice(objectReference, childCopies); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/LogicalNode.java b/src/main/java/org/openmuc/openiec61850/LogicalNode.java new file mode 100644 index 0000000..9b819bf --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/LogicalNode.java @@ -0,0 +1,133 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +public final class LogicalNode extends ModelNode { + + private final Map> fcDataObjects = new EnumMap<>(Fc.class); + + private final Map urcbs = new HashMap<>(); + private final Map brcbs = new HashMap<>(); + + public LogicalNode(ObjectReference objectReference, List fcDataObjects) { + children = new LinkedHashMap<>(); + for (Fc fc : Fc.values()) { + this.fcDataObjects.put(fc, new LinkedHashMap()); + } + + this.objectReference = objectReference; + + for (FcDataObject fcDataObject : fcDataObjects) { + children.put(fcDataObject.getReference().getName() + fcDataObject.fc.toString(), fcDataObject); + this.fcDataObjects.get(fcDataObject.getFc()).put(fcDataObject.getReference().getName(), fcDataObject); + fcDataObject.setParent(this); + if (fcDataObject.getFc() == Fc.RP) { + addUrcb((Urcb) fcDataObject, false); + } + else if (fcDataObject.getFc() == Fc.BR) { + addBrcb((Brcb) fcDataObject); + } + } + } + + @Override + public LogicalNode copy() { + + List dataObjectsCopy = new ArrayList<>(); + for (ModelNode obj : children.values()) { + dataObjectsCopy.add((FcDataObject) obj.copy()); + } + + LogicalNode copy = new LogicalNode(objectReference, dataObjectsCopy); + return copy; + } + + public List getChildren(Fc fc) { + Map requestedDataObjectsMap = fcDataObjects.get(fc); + if (requestedDataObjectsMap == null) { + return null; + } + + Collection fcChildren = requestedDataObjectsMap.values(); + if (fcChildren.size() == 0) { + return null; + } + else { + return new ArrayList<>(fcChildren); + } + } + + void addUrcb(Urcb urcb, boolean addDataSet) { + urcbs.put(urcb.getReference().getName(), urcb); + if (addDataSet) { + String dataSetRef = urcb.getDatSet().getStringValue(); + if (dataSetRef != null) { + urcb.dataSet = ((ServerModel) getParent().getParent()).getDataSet(dataSetRef.replace('$', '.')); + } + } + } + + public Collection getUrcbs() { + return urcbs.values(); + } + + public Urcb getUrcb(String urcbName) { + return urcbs.get(urcbName); + } + + void addBrcb(Brcb brcb) { + brcbs.put(brcb.getReference().getName(), brcb); + } + + public Brcb getBrcb(String brcbName) { + return brcbs.get(brcbName); + } + + public Collection getBrcbs() { + return brcbs.values(); + } + + @Override + public ModelNode getChild(String childName, Fc fc) { + if (fc != null) { + return fcDataObjects.get(fc).get(childName); + } + return null; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getReference().toString()); + for (Map fcChildNodes : fcDataObjects.values()) { + for (ModelNode childNode : fcChildNodes.values()) { + sb.append("\n"); + sb.append(childNode.toString()); + } + } + return sb.toString(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/ModelNode.java b/src/main/java/org/openmuc/openiec61850/ModelNode.java new file mode 100644 index 0000000..1e9b405 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ModelNode.java @@ -0,0 +1,182 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.Identifier; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription.Structure; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription.Structure.Components; +import org.openmuc.openiec61850.internal.mms.asn1.TypeSpecification; + +public abstract class ModelNode implements Iterable { + + protected ObjectReference objectReference; + protected Map children; + ModelNode parent; + + /** + * Returns a copy of model node with all of its children. Creates new BasicDataAttribute values but reuses + * ObjectReferences, FunctionalConstraints. + * + * @return a copy of model node with all of its children. + */ + public abstract ModelNode copy(); + + /** + * Returns the child node with the given name. Will always return null if called on a logical node because a logical + * node need the functional constraint to uniquely identify a child. For logical nodes use + * getChild(String name, Fc fc) instead. + * + * @param name + * the name of the requested child node + * @return the child node with the given name. + */ + public ModelNode getChild(String name) { + return getChild(name, null); + } + + /** + * Returns the child node with the given name and functional constraint. The fc is ignored if this function is + * called on any model node other than logical node. + * + * @param name + * the name of the requested child node + * @param fc + * the functional constraint of the requested child node + * @return the child node with the given name and functional constrain + */ + public ModelNode getChild(String name, Fc fc) { + return children.get(name); + } + + @SuppressWarnings("unchecked") + public Collection getChildren() { + if (children == null) { + return null; + } + return (Collection) ((Collection) children.values()); + } + + protected Iterator> getIterators() { + List> iterators = new ArrayList<>(); + if (children != null) { + iterators.add(children.values().iterator()); + } + return iterators.iterator(); + } + + /** + * Returns the reference of the model node. + * + * @return the reference of the model node. + */ + public ObjectReference getReference() { + return objectReference; + } + + /** + * Returns the name of the model node. + * + * @return the name of the model node. + */ + public String getName() { + return objectReference.getName(); + } + + @Override + public Iterator iterator() { + return children.values().iterator(); + } + + /** + * Returns a list of all leaf nodes (basic data attributes) contained in the subtree of this model node. + * + * @return a list of all leaf nodes (basic data attributes) contained in the subtree of this model node. + */ + public List getBasicDataAttributes() { + List subBasicDataAttributes = new LinkedList<>(); + for (ModelNode child : children.values()) { + subBasicDataAttributes.addAll(child.getBasicDataAttributes()); + } + return subBasicDataAttributes; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getReference().toString()); + for (ModelNode childNode : children.values()) { + sb.append("\n"); + sb.append(childNode.toString()); + } + return sb.toString(); + } + + void setParent(ModelNode parent) { + this.parent = parent; + } + + /** + * Returns the parent node of this node. + * + * @return the parent node of this node. + */ + public ModelNode getParent() { + return parent; + } + + Data getMmsDataObj() { + return null; + } + + void setValueFromMmsDataObj(Data data) throws ServiceError { + } + + TypeDescription getMmsTypeSpec() { + + Components componentsSequenceType = new Components(); + + List structComponents = componentsSequenceType.getSEQUENCE(); + for (ModelNode child : children.values()) { + TypeSpecification typeSpecification = new TypeSpecification(); + typeSpecification.setTypeDescription(child.getMmsTypeSpec()); + + TypeDescription.Structure.Components.SEQUENCE component = new TypeDescription.Structure.Components.SEQUENCE(); + component.setComponentName(new Identifier(child.getName().getBytes())); + component.setComponentType(typeSpecification); + + structComponents.add(component); + } + + Structure structure = new Structure(); + structure.setComponents(componentsSequenceType); + + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setStructure(structure); + + return typeDescription; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/ObjectReference.java b/src/main/java/org/openmuc/openiec61850/ObjectReference.java new file mode 100644 index 0000000..fa8fb2d --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ObjectReference.java @@ -0,0 +1,174 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +/** + * ObjectReference syntax: LDName/LNName.DOName[.Name[. ...]] + * + */ +public final class ObjectReference implements Iterable { + + private final String objectReference; + private List nodeNames = null; + + // if the ObjectReference contains an array index this variable will save + // its position in the nodeNames List + private int arrayIndexPosition = -1; + + public ObjectReference(String objectReference) { + if (objectReference == null || objectReference.isEmpty()) { + throw new IllegalArgumentException(); + } + this.objectReference = objectReference; + } + + /** + * @return Returns name part of the reference. + */ + public String getName() { + if (nodeNames == null) { + parseForNameList(); + } + return nodeNames.get(nodeNames.size() - 1); + } + + @Override + public String toString() { + return objectReference; + } + + public boolean isLogicalDeviceRef() { + if (nodeNames == null) { + parseForNameList(); + } + return (nodeNames.size() == 1); + } + + public boolean isLogicalNodeRef() { + if (nodeNames == null) { + parseForNameList(); + } + return (nodeNames.size() == 2); + } + + public boolean isDataRef() { + if (nodeNames == null) { + parseForNameList(); + } + return (nodeNames.size() > 2); + } + + int getArrayIndexPosition() { + if (nodeNames == null) { + parseForNameList(); + } + return arrayIndexPosition; + } + + @Override + public Iterator iterator() { + if (nodeNames == null) { + parseForNameList(); + } + return nodeNames.iterator(); + } + + public String get(int i) { + if (nodeNames == null) { + parseForNameList(); + } + return nodeNames.get(i); + } + + public int size() { + if (nodeNames == null) { + parseForNameList(); + } + return nodeNames.size(); + } + + private void parseForNameList() { + + nodeNames = new LinkedList<>(); + + int lastDelim = -1; + int nextDelim = objectReference.indexOf('/'); + if (nextDelim == -1) { + nodeNames.add(objectReference.substring(lastDelim + 1, objectReference.length())); + return; + } + + nodeNames.add(objectReference.substring(lastDelim + 1, nextDelim)); + + int dotIndex = -1; + int openingbracketIndex = -1; + int closingbracketIndex = -1; + while (true) { + lastDelim = nextDelim; + if (dotIndex == -1) { + dotIndex = objectReference.indexOf('.', lastDelim + 1); + if (dotIndex == -1) { + dotIndex = objectReference.length(); + } + } + if (openingbracketIndex == -1) { + openingbracketIndex = objectReference.indexOf('(', lastDelim + 1); + if (openingbracketIndex == -1) { + openingbracketIndex = objectReference.length(); + } + } + if (closingbracketIndex == -1) { + closingbracketIndex = objectReference.indexOf(')', lastDelim + 1); + if (closingbracketIndex == -1) { + closingbracketIndex = objectReference.length(); + } + } + + if (dotIndex == openingbracketIndex && dotIndex == closingbracketIndex) { + nodeNames.add(objectReference.substring(lastDelim + 1, objectReference.length())); + return; + } + + if (dotIndex < openingbracketIndex && dotIndex < closingbracketIndex) { + nextDelim = dotIndex; + dotIndex = -1; + } + else if (openingbracketIndex < dotIndex && openingbracketIndex < closingbracketIndex) { + nextDelim = openingbracketIndex; + openingbracketIndex = -1; + arrayIndexPosition = nodeNames.size() + 1; + } + else if (closingbracketIndex < dotIndex && closingbracketIndex < openingbracketIndex) { + if (closingbracketIndex == (objectReference.length() - 1)) { + nodeNames.add(objectReference.substring(lastDelim + 1, closingbracketIndex)); + return; + } + nextDelim = closingbracketIndex + 1; + closingbracketIndex = -1; + dotIndex = -1; + nodeNames.add(objectReference.substring(lastDelim + 1, nextDelim - 1)); + continue; + + } + nodeNames.add(objectReference.substring(lastDelim + 1, nextDelim)); + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/Rcb.java b/src/main/java/org/openmuc/openiec61850/Rcb.java new file mode 100644 index 0000000..2032aab --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/Rcb.java @@ -0,0 +1,115 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.List; + +public abstract class Rcb extends FcDataObject { + + DataSet dataSet; + + public Rcb(ObjectReference objectReference, Fc fc, List children) { + super(objectReference, fc, children); + } + + /** + * Gets the RptID (Report ID). The RptID will be included in every report sent by the server. If it is equal to + * NULL, then the RptID sent will be equal to the reference of the RCB. + * + * @return the report ID + */ + public BdaVisibleString getRptId() { + return (BdaVisibleString) children.get("RptID"); + } + + /** + * Gets the boolean value which states whether reporting is enabled. + * + * @return BdaBoolean that contains true as value if reporting is enabled. + */ + public BdaBoolean getRptEna() { + return (BdaBoolean) children.get("RptEna"); + } + + /** + * Gets the object reference of the DataSet that is to be monitored for reporting events. + * + * @return the object reference of the DataSet + */ + public BdaVisibleString getDatSet() { + return (BdaVisibleString) children.get("DatSet"); + } + + /** + * Configuration revision The attribute ConfRev shall represent a count of the number of times that the + * configuration of the DATA-SET referenced by DatSet has been changed. Changes that shall be counted are: + *
    + *
  • any deletion of a member of the DATA-SET;
  • + *
  • the reordering of members of the DATA-SET; and
  • + *
  • Successful SetBRCBValues of the DatSet attribute where the DatSet attribute value changes.
  • + *
+ * The counter shall be incremented when the configuration changes. At configuration time, the configuration tool + * will be responsible for incrementing/maintaining the ConfRev value. When configuration changes occur due to + * SetBRCBValues, the IED shall be responsible for incrementing the value of ConfRev. + * + * @return the configuration revision + */ + public BdaInt32U getConfRev() { + return (BdaInt32U) children.get("ConfRev"); + } + + /** + * Gets the optional fields parameter which specifies which optional fields should be included in the reports sent + * by this RCB. + * + * @return the optional fields parameter + */ + public BdaOptFlds getOptFlds() { + return (BdaOptFlds) children.get("OptFlds"); + } + + /** + * Gets the buffer time - The attribute BufTm (see Figure 27) shall specify the time interval in milliseconds for + * the buffering of internal notifications caused by data-change (dchg), quality-change (qchg), data update (dupd) + * by the BRCB for inclusion into a single report. + * + * @return the buffer time + */ + public BdaInt32U getBufTm() { + return (BdaInt32U) children.get("BufTm"); + } + + /** + * Gets the sequence number - The attribute SqNum shall specify the sequence number for each BRCB that has report + * enable set to TRUE. This number is to be incremented by the BRCB for each report generated and sent. The + * increment shall occur once the BRCB has formatted the report and requested for transmission. + * + * @return the sequence number + */ + public BdaInt8U getSqNum() { + return (BdaInt8U) children.get("SqNum"); + } + + public BdaTriggerConditions getTrgOps() { + return (BdaTriggerConditions) children.get("TrgOps"); + } + + public BdaInt32U getIntgPd() { + return (BdaInt32U) children.get("IntgPd"); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/Report.java b/src/main/java/org/openmuc/openiec61850/Report.java new file mode 100644 index 0000000..62af411 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/Report.java @@ -0,0 +1,151 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.List; + +public class Report { + + private final String rptId; + private final BdaOptFlds optFlds; + private final Integer sqNum; + private final Integer subSqNum; + private final boolean moreSegmentsFollow; + private final String dataSetRef; + private final boolean bufOvfl; + private final Long confRev; + private final BdaEntryTime timeOfEntry; + private final BdaOctetString entryId; + private final byte[] inclusionBitString; + private final List reasonCodes; + private final DataSet dataSet; + + public Report(String rptId, BdaOptFlds optFlds, Integer sqNum, Integer subSqNum, boolean moreSegmentsFollow, + String dataSetRef, boolean bufOvfl, Long confRev, BdaEntryTime timeOfEntry, BdaOctetString entryId, + byte[] inclusionBitString, List reasonCodes, DataSet dataSet) { + this.rptId = rptId; + this.optFlds = optFlds; + this.sqNum = sqNum; + this.subSqNum = subSqNum; + this.moreSegmentsFollow = moreSegmentsFollow; + this.dataSetRef = dataSetRef; + this.bufOvfl = bufOvfl; + this.confRev = confRev; + this.timeOfEntry = timeOfEntry; + this.entryId = entryId; + this.inclusionBitString = inclusionBitString; + this.reasonCodes = reasonCodes; + this.dataSet = dataSet; + } + + public String getRptId() { + return rptId; + } + + public BdaOptFlds getOptFlds() { + return optFlds; + } + + /** + * Sequence numberThe parameter MoreSegmentsFollow indicates that more report segments with the same sequence number + * follow, counted up for every {@code Report} instance generated + * + * @return the sequence number + */ + public Integer getSqNum() { + return sqNum; + } + + /** + * For the case of long reports that do not fit into one message, a single report shall be divided into subreports. + * Each segment – of one report – shall be numbered with the same sequence number and a unique SubSqNum. + * + * @return the subsequence number + */ + public Integer getSubSqNum() { + return subSqNum; + } + + /** + * The parameter MoreSegmentsFollow indicates that more report segments with the same sequence number follow + * + * @return true if more segments follow + */ + public boolean isMoreSegmentsFollow() { + return moreSegmentsFollow; + } + + public String getDataSetRef() { + return dataSetRef; + } + + /** + * The parameter BufOvfl shall indicate to the client that entries within the buffer may have been lost. The + * detection of possible loss of information occurs when a client requests a resynchronization to a non-existent + * entry or to the first entry in the queue. + * + * @return true if buffer overflow is true + */ + public boolean isBufOvfl() { + return bufOvfl; + } + + public Long getConfRev() { + return confRev; + } + + /** + * The parameter TimeOfEntry shall specify the time when the EntryID was created + * + * @return the time of entry + */ + public BdaEntryTime getTimeOfEntry() { + return timeOfEntry; + } + + public BdaOctetString getEntryId() { + return entryId; + } + + /** + * Indicator of data set members included in the report + * + * @return the inclusion bit string as a byte array + */ + public byte[] getInclusionBitString() { + return inclusionBitString; + } + + /** + * Gets the reasons for inclusion + * + * @return the reasons for inclusion + */ + public List getReasonCodes() { + return reasonCodes; + } + + /** + * Gets the data set associated with this report. + * + * @return the data set associated with this report. + */ + public DataSet getDataSet() { + return dataSet; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/ReportEntryData.java b/src/main/java/org/openmuc/openiec61850/ReportEntryData.java new file mode 100644 index 0000000..5d42b8f --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ReportEntryData.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public class ReportEntryData { + + public static enum ReasonCode { + DCHG, + QCHG, + DUPD, + INTEGRITY, + GI, + APPTRIGGER + }; + + /** + * Not specified in IEC61850 but useful for data persistence + */ + private long id; + /** + * Reference to to {@link DataSet}-member + */ + private String dataRef; + /** + * Attribute value to be reported + */ + private ModelNode value; + /** + * Trigger that caused the data to be put into the report + */ + // private TriggerConditions reasonCode; + private ReasonCode reasonCode; + /** + * Backreference to report + */ + private Report report; + + public String getDataRef() { + return dataRef; + } + + public void setDataRef(String dataRef) { + this.dataRef = dataRef; + } + + public ModelNode getValue() { + return value; + } + + public void setValue(ModelNode value) { + this.value = value; + } + + public ReasonCode getReasonCode() { + return reasonCode; + } + + public void setReasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public Report getReport() { + return report; + } + + public void setReport(Report report) { + this.report = report; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/SclParseException.java b/src/main/java/org/openmuc/openiec61850/SclParseException.java new file mode 100644 index 0000000..e7f7cdf --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/SclParseException.java @@ -0,0 +1,31 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public final class SclParseException extends Exception { + + private static final long serialVersionUID = 8499804369026418082L; + + public SclParseException(String string) { + super(string); + } + + public SclParseException(Exception e) { + super(e); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/SclParser.java b/src/main/java/org/openmuc/openiec61850/SclParser.java new file mode 100644 index 0000000..8430c28 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/SclParser.java @@ -0,0 +1,1060 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilderFactory; + +import org.openmuc.openiec61850.internal.scl.AbstractDataAttribute; +import org.openmuc.openiec61850.internal.scl.Bda; +import org.openmuc.openiec61850.internal.scl.Da; +import org.openmuc.openiec61850.internal.scl.DaType; +import org.openmuc.openiec61850.internal.scl.Do; +import org.openmuc.openiec61850.internal.scl.DoType; +import org.openmuc.openiec61850.internal.scl.EnumType; +import org.openmuc.openiec61850.internal.scl.EnumVal; +import org.openmuc.openiec61850.internal.scl.LnSubDef; +import org.openmuc.openiec61850.internal.scl.LnType; +import org.openmuc.openiec61850.internal.scl.Sdo; +import org.openmuc.openiec61850.internal.scl.TypeDefinitions; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +final class SclParser { + + private TypeDefinitions typeDefinitions; + private final Map dataSetsMap = new HashMap<>(); + + private Document doc; + private String iedName; + private List serverSaps = null; + private boolean useResvTmsAttributes = false; + + private final List dataSetDefs = new ArrayList<>(); + + public List getServerSaps() { + return serverSaps; + } + + public void parse(String icdFile) throws SclParseException { + try { + parse(new FileInputStream(icdFile)); + } catch (FileNotFoundException e) { + throw new SclParseException(e); + } + } + + public void parse(InputStream icdFileStream) throws SclParseException { + + typeDefinitions = new TypeDefinitions(); + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setIgnoringComments(true); + + try { + doc = factory.newDocumentBuilder().parse(icdFileStream); + } catch (Exception e) { + throw new SclParseException(e); + } + + Node rootNode = doc.getDocumentElement(); + + if (!"SCL".equals(rootNode.getNodeName())) { + throw new SclParseException("Root node in SCL file is not of type \"SCL\""); + } + + readTypeDefinitions(); + + NodeList iedList = doc.getElementsByTagName("IED"); + if (iedList.getLength() == 0) { + throw new SclParseException("No IED section found!"); + } + + Node nameAttribute = iedList.item(0).getAttributes().getNamedItem("name"); + + iedName = nameAttribute.getNodeValue(); + if ((iedName == null) || (iedName.length() == 0)) { + throw new SclParseException("IED must have a name!"); + } + + NodeList iedElements = iedList.item(0).getChildNodes(); + + serverSaps = new ArrayList<>(iedElements.getLength()); + for (int i = 0; i < iedElements.getLength(); i++) { + Node element = iedElements.item(i); + String nodeName = element.getNodeName(); + if ("AccessPoint".equals(nodeName)) { + serverSaps.add(createAccessPoint(element)); + } + else if ("Services".equals(nodeName)) { + NodeList servicesElements = element.getChildNodes(); + for (int j = 0; j < servicesElements.getLength(); j++) { + if ("ReportSettings".equals(servicesElements.item(j).getNodeName())) { + Node resvTmsAttribute = servicesElements.item(j).getAttributes().getNamedItem("resvTms"); + if (resvTmsAttribute != null) { + useResvTmsAttributes = resvTmsAttribute.getNodeValue().equalsIgnoreCase("true"); + } + } + } + } + } + } + + private void readTypeDefinitions() throws SclParseException { + + NodeList dttSections = doc.getElementsByTagName("DataTypeTemplates"); + + if (dttSections.getLength() != 1) { + throw new SclParseException("Only one DataTypeSection allowed"); + } + + Node dtt = dttSections.item(0); + + NodeList dataTypes = dtt.getChildNodes(); + + for (int i = 0; i < dataTypes.getLength(); i++) { + Node element = dataTypes.item(i); + + String nodeName = element.getNodeName(); + + if (nodeName.equals("LNodeType")) { + typeDefinitions.putLNodeType(new LnType(element)); + } + else if (nodeName.equals("DOType")) { + typeDefinitions.putDOType(new DoType(element)); + } + else if (nodeName.equals("DAType")) { + typeDefinitions.putDAType(new DaType(element)); + } + else if (nodeName.equals("EnumType")) { + typeDefinitions.putEnumType(new EnumType(element)); + } + } + } + + private ServerSap createAccessPoint(Node iedServer) throws SclParseException { + ServerSap serverSap = null; + + NodeList elements = iedServer.getChildNodes(); + + for (int i = 0; i < elements.getLength(); i++) { + Node element = elements.item(i); + + if (element.getNodeName().equals("Server")) { + + ServerModel server = createServerModel(element); + + Node namedItem = iedServer.getAttributes().getNamedItem("name"); + if (namedItem == null) { + throw new SclParseException("AccessPoint has no name attribute!"); + } + String name = namedItem.getNodeValue(); + serverSap = new ServerSap(102, 0, null, server, name, null); + + break; + } + } + + if (serverSap == null) { + throw new SclParseException("AccessPoint has no server!"); + } + + return serverSap; + } + + private ServerModel createServerModel(Node serverXMLNode) throws SclParseException { + + NodeList elements = serverXMLNode.getChildNodes(); + List logicalDevices = new ArrayList<>(elements.getLength()); + + for (int i = 0; i < elements.getLength(); i++) { + Node element = elements.item(i); + + if (element.getNodeName().equals("LDevice")) { + logicalDevices.add(createNewLDevice(element)); + } + } + + ServerModel serverModel = new ServerModel(logicalDevices, null); + + for (LnSubDef dataSetDef : dataSetDefs) { + DataSet dataSet = createDataSet(serverModel, dataSetDef.logicalNode, dataSetDef.defXmlNode); + dataSetsMap.put(dataSet.getReferenceStr(), dataSet); + } + + serverModel.addDataSets(dataSetsMap.values()); + + return serverModel; + + } + + private LogicalDevice createNewLDevice(Node ldXmlNode) throws SclParseException { + + String inst = null; + String ldName = null; + + NamedNodeMap attributes = ldXmlNode.getAttributes(); + + for (int i = 0; i < attributes.getLength(); i++) { + Node node = attributes.item(i); + String nodeName = node.getNodeName(); + + if (nodeName.equals("inst")) { + inst = node.getNodeValue(); + } + else if (nodeName.equals("ldName")) { + ldName = node.getNodeValue(); + } + } + + if (inst == null) { + throw new SclParseException("Required attribute \"inst\" in logical device not found!"); + } + + NodeList elements = ldXmlNode.getChildNodes(); + List logicalNodes = new ArrayList<>(); + + String ref; + if ((ldName != null) && (ldName.length() != 0)) { + ref = ldName; + } + else { + ref = iedName + inst; + } + + for (int i = 0; i < elements.getLength(); i++) { + Node element = elements.item(i); + + if (element.getNodeName().equals("LN") || element.getNodeName().equals("LN0")) { + logicalNodes.add(createNewLogicalNode(element, ref)); + } + } + + LogicalDevice lDevice = new LogicalDevice(new ObjectReference(ref), logicalNodes); + + return lDevice; + } + + private LogicalNode createNewLogicalNode(Node lnXmlNode, String parentRef) throws SclParseException { + + // attributes not needed: desc + + String inst = null; + String lnClass = null; + String lnType = null; + String prefix = ""; + + NamedNodeMap attributes = lnXmlNode.getAttributes(); + + for (int i = 0; i < attributes.getLength(); i++) { + Node node = attributes.item(i); + String nodeName = node.getNodeName(); + + if (nodeName.equals("inst")) { + inst = node.getNodeValue(); + } + else if (nodeName.equals("lnType")) { + lnType = node.getNodeValue(); + } + else if (nodeName.equals("lnClass")) { + lnClass = node.getNodeValue(); + } + else if (nodeName.equals("prefix")) { + prefix = node.getNodeValue(); + } + } + + if (inst == null) { + throw new SclParseException("Required attribute \"inst\" not found!"); + } + if (lnType == null) { + throw new SclParseException("Required attribute \"lnType\" not found!"); + } + if (lnClass == null) { + throw new SclParseException("Required attribute \"lnClass\" not found!"); + } + + String ref = parentRef + '/' + prefix + lnClass + inst; + + LnType lnTypeDef = typeDefinitions.getLNodeType(lnType); + + List dataObjects = new ArrayList<>(); + + if (lnTypeDef == null) { + throw new SclParseException("LNType " + lnType + " not defined!"); + } + for (Do dobject : lnTypeDef.dos) { + + // look for DOI node with the name of the DO + Node doiNodeFound = null; + for (int i = 0; i < lnXmlNode.getChildNodes().getLength(); i++) { + Node childNode = lnXmlNode.getChildNodes().item(i); + if ("DOI".equals(childNode.getNodeName())) { + + NamedNodeMap doiAttributes = childNode.getAttributes(); + Node nameAttribute = doiAttributes.getNamedItem("name"); + if (nameAttribute != null && nameAttribute.getNodeValue().equals(dobject.getName())) { + doiNodeFound = childNode; + } + } + } + + dataObjects.addAll(createFcDataObjects(dobject.getName(), ref, dobject.getType(), doiNodeFound)); + + } + + // look for ReportControl + for (int i = 0; i < lnXmlNode.getChildNodes().getLength(); i++) { + Node childNode = lnXmlNode.getChildNodes().item(i); + if ("ReportControl".equals(childNode.getNodeName())) { + dataObjects.addAll(createReportControlBlocks(childNode, ref)); + } + } + + LogicalNode lNode = new LogicalNode(new ObjectReference(ref), dataObjects); + + // look for DataSet definitions + for (int i = 0; i < lnXmlNode.getChildNodes().getLength(); i++) { + Node childNode = lnXmlNode.getChildNodes().item(i); + if ("DataSet".equals(childNode.getNodeName())) { + dataSetDefs.add(new LnSubDef(childNode, lNode)); + } + } + return lNode; + } + + private DataSet createDataSet(ServerModel serverModel, LogicalNode lNode, Node dsXmlNode) throws SclParseException { + + Node nameAttribute = dsXmlNode.getAttributes().getNamedItem("name"); + if (nameAttribute == null) { + throw new SclParseException("DataSet must have a name"); + } + + String name = nameAttribute.getNodeValue(); + + List dsMembers = new ArrayList<>(); + + for (int i = 0; i < dsXmlNode.getChildNodes().getLength(); i++) { + Node fcdaXmlNode = dsXmlNode.getChildNodes().item(i); + if ("FCDA".equals(fcdaXmlNode.getNodeName())) { + + // For the definition of FCDA see Table 22 part6 ed2 + + String ldInst = null; + String prefix = ""; + String lnClass = null; + String lnInst = ""; + String doName = ""; + String daName = ""; + Fc fc = null; + + NamedNodeMap attributes = fcdaXmlNode.getAttributes(); + + for (int j = 0; j < attributes.getLength(); j++) { + Node node = attributes.item(j); + String nodeName = node.getNodeName(); + + if (nodeName.equals("ldInst")) { + ldInst = node.getNodeValue(); + } + else if (nodeName.equals("lnInst")) { + lnInst = node.getNodeValue(); + } + else if (nodeName.equals("lnClass")) { + lnClass = node.getNodeValue(); + } + else if (nodeName.equals("prefix")) { + prefix = node.getNodeValue(); + } + else if (nodeName.equals("doName")) { + doName = node.getNodeValue(); + } + else if (nodeName.equals("daName")) { + if (!node.getNodeValue().isEmpty()) { + daName = "." + node.getNodeValue(); + } + } + else if (nodeName.equals("fc")) { + fc = Fc.fromString(node.getNodeValue()); + if (fc == null) { + throw new SclParseException("FCDA contains invalid FC: " + node.getNodeValue()); + } + } + + } + + if (ldInst == null) { + throw new SclParseException( + "Required attribute \"ldInst\" not found in FCDA: " + nameAttribute + "!"); + } + + if (lnClass == null) { + throw new SclParseException("Required attribute \"lnClass\" not found in FCDA!"); + } + if (fc == null) { + throw new SclParseException("Required attribute \"fc\" not found in FCDA!"); + } + if (!doName.isEmpty()) { + + String objectReference = iedName + ldInst + "/" + prefix + lnClass + lnInst + "." + doName + daName; + + ModelNode fcdaNode = serverModel.findModelNode(objectReference, fc); + + if (fcdaNode == null) { + throw new SclParseException("Specified FCDA: " + objectReference + " in DataSet: " + + nameAttribute + " not found in Model."); + } + dsMembers.add((FcModelNode) fcdaNode); + } + else { + String objectReference = iedName + ldInst + "/" + prefix + lnClass + lnInst; + ModelNode logicalNode = serverModel.findModelNode(objectReference, null); + if (logicalNode == null) { + throw new SclParseException("Specified FCDA: " + objectReference + " in DataSet: " + + nameAttribute + " not found in Model."); + } + List fcDataObjects = ((LogicalNode) logicalNode).getChildren(fc); + for (FcDataObject dataObj : fcDataObjects) { + dsMembers.add(dataObj); + } + + } + + } + + } + + DataSet dataSet = new DataSet(lNode.getReference().toString() + '.' + name, dsMembers, false); + return dataSet; + } + + private List createReportControlBlocks(Node xmlNode, String parentRef) throws SclParseException { + + Fc fc = Fc.RP; + NamedNodeMap rcbNodeAttributes = xmlNode.getAttributes(); + Node attribute = rcbNodeAttributes.getNamedItem("buffered"); + if (attribute != null && "true".equalsIgnoreCase(attribute.getNodeValue())) { + fc = Fc.BR; + } + + Node nameAttribute = rcbNodeAttributes.getNamedItem("name"); + if (nameAttribute == null) { + throw new SclParseException("Report Control Block has no name attribute."); + } + + int maxInstances = 1; + for (int i = 0; i < xmlNode.getChildNodes().getLength(); i++) { + Node childNode = xmlNode.getChildNodes().item(i); + + if ("RptEnabled".equals(childNode.getNodeName())) { + Node rptEnabledMaxAttr = childNode.getAttributes().getNamedItem("max"); + if (rptEnabledMaxAttr != null) { + maxInstances = Integer.parseInt(rptEnabledMaxAttr.getNodeValue()); + if (maxInstances < 1 || maxInstances > 99) { + throw new SclParseException( + "Report Control Block max instances should be between 1 and 99 but is: " + + maxInstances); + } + } + } + } + + List rcbInstances = new ArrayList<>(maxInstances); + + for (int z = 1; z <= maxInstances; z++) { + + ObjectReference reportObjRef; + + if (maxInstances == 1) { + + reportObjRef = new ObjectReference(parentRef + "." + nameAttribute.getNodeValue()); + } + else { + reportObjRef = new ObjectReference( + parentRef + "." + nameAttribute.getNodeValue() + String.format("%02d", z)); + } + + BdaTriggerConditions trigOps = new BdaTriggerConditions(new ObjectReference(reportObjRef + ".TrgOps"), fc); + BdaOptFlds optFields = new BdaOptFlds(new ObjectReference(reportObjRef + ".OptFlds"), fc); + for (int i = 0; i < xmlNode.getChildNodes().getLength(); i++) { + Node childNode = xmlNode.getChildNodes().item(i); + if (childNode.getNodeName().equals("TrgOps")) { + + NamedNodeMap attributes = childNode.getAttributes(); + + if (attributes != null) { + for (int j = 0; j < attributes.getLength(); j++) { + Node node = attributes.item(j); + String nodeName = node.getNodeName(); + + if ("dchg".equals(nodeName)) { + trigOps.setDataChange(node.getNodeValue().equalsIgnoreCase("true")); + } + else if ("qchg".equals(nodeName)) { + trigOps.setQualityChange(node.getNodeValue().equalsIgnoreCase("true")); + + } + else if ("dupd".equals(nodeName)) { + trigOps.setDataUpdate(node.getNodeValue().equalsIgnoreCase("true")); + + } + else if ("period".equals(nodeName)) { + trigOps.setIntegrity(node.getNodeValue().equalsIgnoreCase("true")); + + } + else if ("gi".equals(nodeName)) { + trigOps.setGeneralInterrogation(node.getNodeValue().equalsIgnoreCase("true")); + } + } + } + } + else if ("OptFields".equals(childNode.getNodeName())) { + + NamedNodeMap attributes = childNode.getAttributes(); + + if (attributes != null) { + for (int j = 0; j < attributes.getLength(); j++) { + + Node node = attributes.item(j); + String nodeName = node.getNodeName(); + + if ("seqNum".equals(nodeName)) { + optFields.setSequenceNumber(node.getNodeValue().equalsIgnoreCase("true")); + } + else if ("timeStamp".equals(nodeName)) { + optFields.setReportTimestamp(node.getNodeValue().equalsIgnoreCase("true")); + + } + else if ("reasonCode".equals(nodeName)) { + optFields.setReasonForInclusion(node.getNodeValue().equalsIgnoreCase("true")); + + } + else if ("dataSet".equals(nodeName)) { + optFields.setDataSetName(node.getNodeValue().equalsIgnoreCase("true")); + + } + // not supported for now + // else if (nodeName.equals("dataRef")) { + // optFields.setDataReference(node.getNodeValue().equals("true")); + // + // } + else if (nodeName.equals("bufOvfl")) { + optFields.setBufferOverflow(node.getNodeValue().equalsIgnoreCase("true")); + + } + else if (nodeName.equals("entryID")) { + optFields.setEntryId(node.getNodeValue().equalsIgnoreCase("true")); + } + // not supported for now: + // else if (nodeName.equals("configRef")) { + // optFields.setConfigRevision(node.getNodeValue().equals("true")); + // } + } + } + } + else if ("RptEnabled".equals(childNode.getNodeName())) { + Node rptEnabledMaxAttr = childNode.getAttributes().getNamedItem("max"); + if (rptEnabledMaxAttr != null) { + maxInstances = Integer.parseInt(rptEnabledMaxAttr.getNodeValue()); + if (maxInstances < 1 || maxInstances > 99) { + throw new SclParseException( + "Report Control Block max instances should be between 1 and 99 but is: " + + maxInstances); + } + } + } + } + + if (fc == Fc.RP) { + optFields.setEntryId(false); + optFields.setBufferOverflow(false); + } + + List children = new ArrayList<>(); + + BdaVisibleString rptId = new BdaVisibleString(new ObjectReference(reportObjRef.toString() + ".RptID"), fc, + "", 129, false, false); + attribute = rcbNodeAttributes.getNamedItem("rptID"); + if (attribute != null) { + rptId.setValue(attribute.getNodeValue().getBytes()); + } + else { + rptId.setValue(reportObjRef.toString()); + } + + children.add(rptId); + + children.add( + new BdaBoolean(new ObjectReference(reportObjRef.toString() + ".RptEna"), fc, "", false, false)); + + if (fc == Fc.RP) { + children.add( + new BdaBoolean(new ObjectReference(reportObjRef.toString() + ".Resv"), fc, "", false, false)); + } + + BdaVisibleString datSet = new BdaVisibleString(new ObjectReference(reportObjRef.toString() + ".DatSet"), fc, + "", 129, false, false); + + attribute = xmlNode.getAttributes().getNamedItem("datSet"); + if (attribute != null) { + String nodeValue = attribute.getNodeValue(); + String dataSetName = parentRef + "$" + nodeValue; + datSet.setValue(dataSetName.getBytes()); + } + children.add(datSet); + + BdaInt32U confRef = new BdaInt32U(new ObjectReference(reportObjRef.toString() + ".ConfRev"), fc, "", false, + false); + attribute = xmlNode.getAttributes().getNamedItem("confRev"); + if (attribute == null) { + throw new SclParseException("Report Control Block does not contain mandatory attribute confRev"); + } + confRef.setValue(Long.parseLong(attribute.getNodeValue())); + children.add(confRef); + + children.add(optFields); + + BdaInt32U bufTm = new BdaInt32U(new ObjectReference(reportObjRef.toString() + ".BufTm"), fc, "", false, + false); + attribute = xmlNode.getAttributes().getNamedItem("bufTime"); + if (attribute != null) { + bufTm.setValue(Long.parseLong(attribute.getNodeValue())); + } + children.add(bufTm); + + children.add(new BdaInt8U(new ObjectReference(reportObjRef.toString() + ".SqNum"), fc, "", false, false)); + + children.add(trigOps); + + BdaInt32U intgPd = new BdaInt32U(new ObjectReference(reportObjRef.toString() + ".IntgPd"), fc, "", false, + false); + attribute = xmlNode.getAttributes().getNamedItem("intgPd"); + if (attribute != null) { + intgPd.setValue(Long.parseLong(attribute.getNodeValue())); + } + children.add(intgPd); + + children.add(new BdaBoolean(new ObjectReference(reportObjRef.toString() + ".GI"), fc, "", false, false)); + + Rcb rcb = null; + + if (fc == Fc.BR) { + + children.add(new BdaBoolean(new ObjectReference(reportObjRef.toString() + ".PurgeBuf"), fc, "", false, + false)); + + children.add(new BdaOctetString(new ObjectReference(reportObjRef.toString() + ".EntryID"), fc, "", 8, + false, false)); + + children.add(new BdaEntryTime(new ObjectReference(reportObjRef.toString() + ".TimeOfEntry"), fc, "", + false, false)); + + if (useResvTmsAttributes) { + children.add(new BdaInt16(new ObjectReference(reportObjRef.toString() + ".ResvTms"), fc, "", false, + false)); + } + + rcb = new Brcb(reportObjRef, children); + + } + else { + + rcb = new Urcb(reportObjRef, children); + + } + + // ignoring owner because it cannot be specified in SCL file + + rcbInstances.add(rcb); + + } + + return rcbInstances; + + } + + private List createFcDataObjects(String name, String parentRef, String doTypeID, Node doiNode) + throws SclParseException { + + DoType doType = typeDefinitions.getDOType(doTypeID); + + if (doType == null) { + throw new SclParseException("DO type " + doTypeID + " not defined!"); + } + + String ref = parentRef + '.' + name; + + List childNodes = new ArrayList<>(); + + for (Da dattr : doType.das) { + + // look for DAI node with the name of the DA + Node iNodeFound = findINode(doiNode, dattr.getName()); + + if (dattr.getCount() >= 1) { + childNodes.add(createArrayOfDataAttributes(ref + '.' + dattr.getName(), dattr, iNodeFound)); + } + else { + childNodes.add(createDataAttribute(ref + '.' + dattr.getName(), dattr.getFc(), dattr, iNodeFound, false, + false, false)); + } + + } + + for (Sdo sdo : doType.sdos) { + + // parsing Arrays of SubDataObjects is ignored for now because no SCL file was found to test against. The + // only DO that contains an Array of SDOs is Harmonic Value (HMV). The Kalkitech SCL Manager handles the + // array of SDOs in HMV as an array of DAs. + + Node iNodeFound = findINode(doiNode, sdo.getName()); + + childNodes.addAll(createFcDataObjects(sdo.getName(), ref, sdo.getType(), iNodeFound)); + + } + + Map> subFCDataMap = new LinkedHashMap<>(); + + for (Fc fc : Fc.values()) { + subFCDataMap.put(fc, new LinkedList()); + } + + for (ModelNode childNode : childNodes) { + subFCDataMap.get(((FcModelNode) childNode).getFc()).add((FcModelNode) childNode); + } + + List fcDataObjects = new LinkedList<>(); + ObjectReference objectReference = new ObjectReference(ref); + + for (Fc fc : Fc.values()) { + if (subFCDataMap.get(fc).size() > 0) { + fcDataObjects.add(new FcDataObject(objectReference, fc, subFCDataMap.get(fc))); + } + } + + return fcDataObjects; + } + + private Node findINode(Node iNode, String dattrName) { + + if (iNode == null) { + return null; + } + + for (int i = 0; i < iNode.getChildNodes().getLength(); i++) { + Node childNode = iNode.getChildNodes().item(i); + if (childNode.getAttributes() != null) { + Node nameAttribute = childNode.getAttributes().getNamedItem("name"); + if (nameAttribute != null && nameAttribute.getNodeValue().equals(dattrName)) { + return childNode; + } + } + } + return null; + } + + private Array createArrayOfDataAttributes(String ref, Da dataAttribute, Node iXmlNode) throws SclParseException { + + Fc fc = dataAttribute.getFc(); + int size = dataAttribute.getCount(); + + List arrayItems = new ArrayList<>(); + for (int i = 0; i < size; i++) { + // TODO go down the iXmlNode using the ix attribute? + arrayItems.add(createDataAttribute(ref + '(' + i + ')', fc, dataAttribute, iXmlNode, dataAttribute.isDchg(), + dataAttribute.isDupd(), dataAttribute.isQchg())); + } + + return new Array(new ObjectReference(ref), fc, arrayItems); + } + + /** + * returns a ConstructedDataAttribute or BasicDataAttribute + */ + private FcModelNode createDataAttribute(String ref, Fc fc, AbstractDataAttribute dattr, Node iXmlNode, boolean dchg, + boolean dupd, boolean qchg) throws SclParseException { + + if (dattr instanceof Da) { + Da dataAttribute = (Da) dattr; + dchg = dataAttribute.isDchg(); + dupd = dataAttribute.isDupd(); + qchg = dataAttribute.isQchg(); + } + + String bType = dattr.getbType(); + + if (bType.equals("Struct")) { + DaType datype = typeDefinitions.getDaType(dattr.getType()); + + if (datype == null) { + throw new SclParseException("DAType " + dattr.getbType() + " not declared!"); + } + + List subDataAttributes = new ArrayList<>(); + for (Bda bda : datype.bdas) { + + Node iNodeFound = findINode(iXmlNode, bda.getName()); + + subDataAttributes + .add(createDataAttribute(ref + '.' + bda.getName(), fc, bda, iNodeFound, dchg, dupd, qchg)); + } + return new ConstructedDataAttribute(new ObjectReference(ref), fc, subDataAttributes); + } + + String val = null; + String sAddr = null; + if (iXmlNode != null) { + NamedNodeMap attributeMap = iXmlNode.getAttributes(); + Node sAddrAttribute = attributeMap.getNamedItem("sAddr"); + if (sAddrAttribute != null) { + sAddr = sAddrAttribute.getNodeValue(); + } + + NodeList elements = iXmlNode.getChildNodes(); + for (int i = 0; i < elements.getLength(); i++) { + Node node = elements.item(i); + if (node.getNodeName().equals("Val")) { + val = node.getTextContent(); + } + } + if (val == null) { + // insert value from DA element + val = dattr.value; + } + } + + if (bType.equals("BOOLEAN")) { + BdaBoolean bda = new BdaBoolean(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + if (val.equalsIgnoreCase("true") || val.equals("1")) { + bda.setValue(new Boolean(true)); + } + else if (val.equalsIgnoreCase("false") || val.equals("0")) { + bda.setValue(new Boolean(false)); + } + else { + throw new SclParseException("invalid boolean configured value: " + val); + } + } + return bda; + } + else if (bType.equals("INT8")) { + BdaInt8 bda = new BdaInt8(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setValue(Byte.parseByte(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid INT8 configured value: " + val); + } + } + return bda; + } + else if (bType.equals("INT16")) { + BdaInt16 bda = new BdaInt16(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setValue(Short.parseShort(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid INT16 configured value: " + val); + } + } + return bda; + } + else if (bType.equals("INT32")) { + BdaInt32 bda = new BdaInt32(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setValue(Integer.parseInt(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid INT32 configured value: " + val); + } + } + return bda; + } + else if (bType.equals("INT64")) { + BdaInt64 bda = new BdaInt64(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setValue(Long.parseLong(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid INT64 configured value: " + val); + } + } + return bda; + } + else if (bType.equals("INT8U")) { + BdaInt8U bda = new BdaInt8U(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setValue(Short.parseShort(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid INT8U configured value: " + val); + } + } + return bda; + } + else if (bType.equals("INT16U")) { + BdaInt16U bda = new BdaInt16U(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setValue(Integer.parseInt(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid INT16U configured value: " + val); + } + } + return bda; + } + else if (bType.equals("INT32U")) { + BdaInt32U bda = new BdaInt32U(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setValue(Long.parseLong(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid INT32U configured value: " + val); + } + } + return bda; + } + else if (bType.equals("FLOAT32")) { + BdaFloat32 bda = new BdaFloat32(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setFloat(Float.parseFloat(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid FLOAT32 configured value: " + val); + } + } + return bda; + } + else if (bType.equals("FLOAT64")) { + BdaFloat64 bda = new BdaFloat64(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + try { + bda.setDouble(Double.parseDouble(val)); + } catch (NumberFormatException e) { + throw new SclParseException("invalid FLOAT64 configured value: " + val); + } + } + return bda; + } + else if (bType.startsWith("VisString")) { + BdaVisibleString bda = new BdaVisibleString(new ObjectReference(ref), fc, sAddr, + Integer.parseInt(dattr.getbType().substring(9)), dchg, dupd); + if (val != null) { + bda.setValue(val.getBytes()); + } + return bda; + } + else if (bType.startsWith("Unicode")) { + BdaUnicodeString bda = new BdaUnicodeString(new ObjectReference(ref), fc, sAddr, + Integer.parseInt(dattr.getbType().substring(7)), dchg, dupd); + if (val != null) { + bda.setValue(val.getBytes()); + } + return bda; + } + else if (bType.startsWith("Octet")) { + BdaOctetString bda = new BdaOctetString(new ObjectReference(ref), fc, sAddr, + Integer.parseInt(dattr.getbType().substring(5)), dchg, dupd); + if (val != null) { + // TODO + throw new SclParseException("parsing configured value for octet string is not supported yet."); + } + return bda; + } + else if (bType.equals("Quality")) { + return new BdaQuality(new ObjectReference(ref), fc, sAddr, qchg); + } + else if (bType.equals("Check")) { + return new BdaCheck(new ObjectReference(ref)); + } + else if (bType.equals("Dbpos")) { + return new BdaDoubleBitPos(new ObjectReference(ref), fc, sAddr, dchg, dupd); + } + else if (bType.equals("Tcmd")) { + return new BdaTapCommand(new ObjectReference(ref), fc, sAddr, dchg, dupd); + } + else if (bType.equals("Timestamp")) { + BdaTimestamp bda = new BdaTimestamp(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + // TODO + throw new SclParseException("parsing configured value for TIMESTAMP is not supported yet."); + } + return bda; + } + else if (bType.equals("Enum")) { + String type = dattr.getType(); + if (type == null) { + throw new SclParseException("The exact type of the enumeration is not set."); + } + EnumType enumType = typeDefinitions.getEnumType(type); + + if (enumType == null) { + throw new SclParseException("Definition of enum type: " + type + " not found."); + } + + if (enumType.max > 127 || enumType.min < -128) { + BdaInt16 bda = new BdaInt16(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + for (EnumVal enumVal : enumType.getValues()) { + if (val.equals(enumVal.getId())) { + bda.setValue(new Short((short) enumVal.getOrd())); + return bda; + } + } + throw new SclParseException("unknown enum value: " + val); + } + return bda; + } + else { + BdaInt8 bda = new BdaInt8(new ObjectReference(ref), fc, sAddr, dchg, dupd); + if (val != null) { + for (EnumVal enumVal : enumType.getValues()) { + if (val.equals(enumVal.getId())) { + bda.setValue(new Byte((byte) enumVal.getOrd())); + return bda; + } + } + throw new SclParseException("unknown enum value: " + val); + } + return bda; + } + } + else if (bType.equals("ObjRef")) { + BdaVisibleString bda = new BdaVisibleString(new ObjectReference(ref), fc, sAddr, 129, dchg, dupd); + if (val != null) { + bda.setValue(val.getBytes()); + } + return bda; + } + else { + throw new SclParseException("Invalid bType: " + bType); + } + + } +} diff --git a/src/main/java/org/openmuc/openiec61850/ServerAssociation.java b/src/main/java/org/openmuc/openiec61850/ServerAssociation.java new file mode 100644 index 0000000..b587e2c --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ServerAssociation.java @@ -0,0 +1,1637 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.io.EOFException; +import java.io.IOException; +import java.net.SocketTimeoutException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeoutException; + +import org.openmuc.jasn1.ber.BerByteArrayOutputStream; +import org.openmuc.jasn1.ber.types.BerBoolean; +import org.openmuc.jasn1.ber.types.BerInteger; +import org.openmuc.jasn1.ber.types.BerNull; +import org.openmuc.jasn1.ber.types.string.BerVisibleString; +import org.openmuc.josistack.AcseAssociation; +import org.openmuc.josistack.ByteBufferInputStream; +import org.openmuc.josistack.DecodingException; +import org.openmuc.openiec61850.internal.mms.asn1.AccessResult; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedErrorPDU; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedRequestPDU; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedResponsePDU; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedServiceRequest; +import org.openmuc.openiec61850.internal.mms.asn1.ConfirmedServiceResponse; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.DataAccessError; +import org.openmuc.openiec61850.internal.mms.asn1.DefineNamedVariableListRequest; +import org.openmuc.openiec61850.internal.mms.asn1.DefineNamedVariableListResponse; +import org.openmuc.openiec61850.internal.mms.asn1.DeleteNamedVariableListRequest; +import org.openmuc.openiec61850.internal.mms.asn1.DeleteNamedVariableListResponse; +import org.openmuc.openiec61850.internal.mms.asn1.GetNameListRequest; +import org.openmuc.openiec61850.internal.mms.asn1.GetNameListResponse; +import org.openmuc.openiec61850.internal.mms.asn1.GetNameListResponse.ListOfIdentifier; +import org.openmuc.openiec61850.internal.mms.asn1.GetNamedVariableListAttributesResponse; +import org.openmuc.openiec61850.internal.mms.asn1.GetVariableAccessAttributesRequest; +import org.openmuc.openiec61850.internal.mms.asn1.GetVariableAccessAttributesResponse; +import org.openmuc.openiec61850.internal.mms.asn1.Identifier; +import org.openmuc.openiec61850.internal.mms.asn1.InitiateRequestPDU; +import org.openmuc.openiec61850.internal.mms.asn1.InitiateResponsePDU; +import org.openmuc.openiec61850.internal.mms.asn1.Integer16; +import org.openmuc.openiec61850.internal.mms.asn1.Integer32; +import org.openmuc.openiec61850.internal.mms.asn1.Integer8; +import org.openmuc.openiec61850.internal.mms.asn1.MMSpdu; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectName; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectName.DomainSpecific; +import org.openmuc.openiec61850.internal.mms.asn1.ParameterSupportOptions; +import org.openmuc.openiec61850.internal.mms.asn1.ReadRequest; +import org.openmuc.openiec61850.internal.mms.asn1.ReadResponse; +import org.openmuc.openiec61850.internal.mms.asn1.ReadResponse.ListOfAccessResult; +import org.openmuc.openiec61850.internal.mms.asn1.ServiceError.ErrorClass; +import org.openmuc.openiec61850.internal.mms.asn1.ServiceSupportOptions; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription.Structure; +import org.openmuc.openiec61850.internal.mms.asn1.TypeDescription.Structure.Components; +import org.openmuc.openiec61850.internal.mms.asn1.TypeSpecification; +import org.openmuc.openiec61850.internal.mms.asn1.Unsigned32; +import org.openmuc.openiec61850.internal.mms.asn1.VariableAccessSpecification; +import org.openmuc.openiec61850.internal.mms.asn1.VariableDefs; +import org.openmuc.openiec61850.internal.mms.asn1.WriteRequest; +import org.openmuc.openiec61850.internal.mms.asn1.WriteResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +final class ServerAssociation { + + private static final Logger logger = LoggerFactory.getLogger(ServerAssociation.class); + + private static final WriteResponse.CHOICE writeSuccess = new WriteResponse.CHOICE(); + static { + writeSuccess.setSuccess(new BerNull()); + } + + private AcseAssociation acseAssociation = null; + + private int negotiatedMaxPduSize; + private ByteBuffer pduBuffer; + private final ServerSap serverSap; + final ServerModel serverModel; + + private final BerByteArrayOutputStream berOStream = new BerByteArrayOutputStream(500, true); + private boolean insertRef; + private String continueAfter; + + ScheduledExecutorService executor = null; + + HashMap nonPersistentDataSets = new HashMap<>(); + + List selects = new ArrayList<>(); + List rsvdURCBs = new ArrayList<>(); + + private static String[] mmsFcs = { "MX", "ST", "CO", "CF", "DC", "SP", "SG", "RP", "LG", "BR", "GO", "GS", "SV", + "SE", "EX", "SR", "OR", "BL" }; + + public ServerAssociation(ServerSap serverSap) { + this.serverSap = serverSap; + serverModel = serverSap.serverModel; + executor = Executors.newScheduledThreadPool(2); + } + + public void handleNewAssociation(AcseAssociation acseAssociation, ByteBuffer associationRequest) { + + this.acseAssociation = acseAssociation; + + try { + associate(acseAssociation, associationRequest); + } catch (IOException e) { + logger.warn("Error during association build up", e); + return; + } + + handleConnection(); + + } + + private void associate(AcseAssociation acseAssociation, ByteBuffer associationRequest) throws IOException { + + MMSpdu mmsPdu = new MMSpdu(); + + mmsPdu.decode(new ByteBufferInputStream(associationRequest), null); + + MMSpdu initiateResponseMmsPdu = constructAssociationResponsePdu(mmsPdu.getInitiateRequestPDU()); + + initiateResponseMmsPdu.encode(berOStream); + + acseAssociation.accept(berOStream.getByteBuffer()); + + } + + private MMSpdu constructAssociationResponsePdu(InitiateRequestPDU associationRequestMMSpdu) { + + negotiatedMaxPduSize = serverSap.getMaxMmsPduSize(); + + if (associationRequestMMSpdu.getLocalDetailCalling() != null) { + int proposedMaxMmsPduSize = associationRequestMMSpdu.getLocalDetailCalling().intValue(); + if (negotiatedMaxPduSize > proposedMaxMmsPduSize + && proposedMaxMmsPduSize >= ServerSap.MINIMUM_MMS_PDU_SIZE) { + negotiatedMaxPduSize = proposedMaxMmsPduSize; + } + } + + int negotiatedMaxServOutstandingCalling = serverSap.getProposedMaxServOutstandingCalling(); + int proposedMaxServOutstandingCalling = associationRequestMMSpdu.getProposedMaxServOutstandingCalling() + .intValue(); + + if (negotiatedMaxServOutstandingCalling > proposedMaxServOutstandingCalling + && proposedMaxServOutstandingCalling > 0) { + negotiatedMaxServOutstandingCalling = proposedMaxServOutstandingCalling; + } + + int negotiatedMaxServOutstandingCalled = serverSap.getProposedMaxServOutstandingCalled(); + int proposedMaxServOutstandingCalled = associationRequestMMSpdu.getProposedMaxServOutstandingCalled() + .intValue(); + + if (negotiatedMaxServOutstandingCalled > proposedMaxServOutstandingCalled + && proposedMaxServOutstandingCalled > 0) { + negotiatedMaxServOutstandingCalled = proposedMaxServOutstandingCalled; + } + + int negotiatedDataStructureNestingLevel = serverSap.getProposedDataStructureNestingLevel(); + + if (associationRequestMMSpdu.getProposedDataStructureNestingLevel() != null) { + int proposedDataStructureNestingLevel = associationRequestMMSpdu.getProposedDataStructureNestingLevel() + .intValue(); + if (negotiatedDataStructureNestingLevel > proposedDataStructureNestingLevel) { + negotiatedDataStructureNestingLevel = proposedDataStructureNestingLevel; + } + } + + pduBuffer = ByteBuffer.allocate(negotiatedMaxPduSize + 500); + + byte[] negotiatedParameterCbbBitString = serverSap.cbbBitString; + + byte[] servicesSupportedCalledBitString = serverSap.servicesSupportedCalled; + + InitiateResponsePDU.InitResponseDetail initRespDetail = new InitiateResponsePDU.InitResponseDetail(); + initRespDetail.setNegotiatedVersionNumber(new Integer16(1)); + initRespDetail.setNegotiatedParameterCBB(new ParameterSupportOptions(negotiatedParameterCbbBitString, + negotiatedParameterCbbBitString.length * 8 - 5)); + initRespDetail.setServicesSupportedCalled(new ServiceSupportOptions(servicesSupportedCalledBitString, + servicesSupportedCalledBitString.length * 8 - 3)); + + InitiateResponsePDU initRespPdu = new InitiateResponsePDU(); + initRespPdu.setLocalDetailCalled(new Integer32(negotiatedMaxPduSize)); + initRespPdu.setNegotiatedMaxServOutstandingCalling(new Integer16(negotiatedMaxServOutstandingCalling)); + initRespPdu.setNegotiatedMaxServOutstandingCalled(new Integer16(negotiatedMaxServOutstandingCalled)); + initRespPdu.setNegotiatedDataStructureNestingLevel(new Integer8(negotiatedDataStructureNestingLevel)); + initRespPdu.setInitResponseDetail(initRespDetail); + + MMSpdu initiateResponseMMSpdu = new MMSpdu(); + initiateResponseMMSpdu.setInitiateResponsePDU(initRespPdu); + + return initiateResponseMMSpdu; + } + + private void handleConnection() { + + while (true) { + + MMSpdu mmsRequestPdu = listenForMmsRequest(acseAssociation); + if (mmsRequestPdu == null) { + return; + } + + ConfirmedRequestPDU confirmedRequestPdu = mmsRequestPdu.getConfirmedRequestPDU(); + // Do not have to check whether confirmedRequestPdu is null because that was already done by + // listenForMmsRequest() + + if (confirmedRequestPdu.getInvokeID() == null) { + // cannot respond with ServiceError because no InvokeID was received + logger.warn("Got unexpected MMS PDU or no invokeID"); + continue; + } + int invokeId = confirmedRequestPdu.getInvokeID().intValue(); + + try { + if (confirmedRequestPdu.getService() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "Got an invalid MMS packet: confirmedServiceRequest empty"); + } + + ConfirmedServiceRequest confirmedServiceRequest = confirmedRequestPdu.getService(); + + ConfirmedServiceResponse confirmedServiceResponse = new ConfirmedServiceResponse(); + + if (confirmedServiceRequest.getGetNameList() != null) { + + GetNameListRequest getNameListRequest = confirmedServiceRequest.getGetNameList(); + GetNameListResponse response = null; + + if (getNameListRequest.getObjectClass().getBasicObjectClass() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "Got an invalid MMS packet: ObjectClass was not selected in GetNameList request"); + } + + long basicObjectClass = getNameListRequest.getObjectClass().getBasicObjectClass().longValue(); + if (basicObjectClass == 9) { + logger.debug("Got a GetServerDirectory (MMS GetNameList[DOMAIN]) request"); + response = handleGetServerDirectoryRequest(getNameListRequest); + } + else if (basicObjectClass == 0) { + logger.debug("Got a Get{LD|LN}Directory (MMS GetNameList[NAMED_VARIABLE]) request"); + response = handleGetDirectoryRequest(getNameListRequest); + } + else if (basicObjectClass == 2) { + logger.debug( + "Got a GetLogicalNodeDirectory[DataSet] (MMS GetNameList[NAMED_VARIABLE_LIST]) request"); + response = handleGetDataSetNamesRequest(getNameListRequest); + } + else { + throw new ServiceError(ServiceError.FAILED_DUE_TO_SERVER_CONSTRAINT, + "Unable to handle Get directory request for basic object class: " + basicObjectClass); + } + // else if (basicObjectClass == 8) { + // logger.debug("Got a GetLogicalNodeDirectory[Log] (MMS GetNameList[JOURNAL]) request"); + // response = + // handleGetNameListJournalRequest(getNameListRequest); + // } + + confirmedServiceResponse.setGetNameList(response); + + } + else if (confirmedServiceRequest.getGetVariableAccessAttributes() != null) { + logger.debug("Got a GetDataDirectory/GetDataDefinition (MMS GetVariableAccessAttributes) request"); + GetVariableAccessAttributesResponse response = handleGetVariableAccessAttributesRequest( + + confirmedServiceRequest.getGetVariableAccessAttributes()); + + confirmedServiceResponse.setGetVariableAccessAttributes(response); + + } + else if (confirmedServiceRequest.getRead() != null) { + // GetDataValues, GetDataSetValues, GetBRCBValues and GetURCBValues map to this + ReadResponse response = handleGetDataValuesRequest(confirmedServiceRequest.getRead()); + + confirmedServiceResponse.setRead(response); + } + else if (confirmedServiceRequest.getWrite() != null) { + logger.debug("Got a Write request"); + + WriteResponse response = handleSetDataValuesRequest(confirmedServiceRequest.getWrite()); + + confirmedServiceResponse.setWrite(response); + + } + // for Data Sets + else if (confirmedServiceRequest.getDefineNamedVariableList() != null) { + logger.debug("Got a CreateDataSet request"); + + DefineNamedVariableListResponse response = handleCreateDataSetRequest( + confirmedServiceRequest.getDefineNamedVariableList()); + + confirmedServiceResponse.setDefineNamedVariableList(response); + } + + else if (confirmedServiceRequest.getGetNamedVariableListAttributes() != null) { + logger.debug("Got a GetDataSetDirectory request"); + GetNamedVariableListAttributesResponse response = handleGetDataSetDirectoryRequest( + confirmedServiceRequest.getGetNamedVariableListAttributes()); + + confirmedServiceResponse.setGetNamedVariableListAttributes(response); + + } + + else if (confirmedServiceRequest.getDeleteNamedVariableList() != null) { + logger.debug("Got a DeleteDataSet request"); + DeleteNamedVariableListResponse response = handleDeleteDataSetRequest( + confirmedServiceRequest.getDeleteNamedVariableList()); + + confirmedServiceResponse.setDeleteNamedVariableList(response); + } + + else { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "invalid MMS packet: unknown request type."); + } + + ConfirmedResponsePDU confirmedResponsePdu = new ConfirmedResponsePDU(); + confirmedResponsePdu.setInvokeID(confirmedRequestPdu.getInvokeID()); + confirmedResponsePdu.setService(confirmedServiceResponse); + + MMSpdu mmsResponsePdu = new MMSpdu(); + mmsResponsePdu.setConfirmedResponsePDU(confirmedResponsePdu); + + if (!sendAnMmsPdu(mmsResponsePdu)) { + return; + } + } catch (ServiceError e) { + logger.warn(e.getMessage()); + if (!sendAnMmsPdu(createServiceErrorResponse(e, invokeId))) { + return; + } + } + } + } + + void cleanUpConnection() { + synchronized (serverModel) { + for (FcModelNode selectedCdo : selects) { + selectedCdo.deselect(); + } + for (Urcb rsvdUrcb : rsvdURCBs) { + synchronized (rsvdUrcb) { + if (rsvdUrcb.enabled) { + rsvdUrcb.disable(); + } + rsvdUrcb.reserved = null; + rsvdUrcb.getResv().setValue(false); + } + } + } + } + + boolean sendAnMmsPdu(MMSpdu mmsResponsePdu) { + + synchronized (berOStream) { + berOStream.reset(); + try { + mmsResponsePdu.encode(berOStream); + } catch (IOException e1) { + logger.error("IOException while encoding MMS PDU. Closing association.", e1); + return false; + } + try { + acseAssociation.send(berOStream.getByteBuffer()); + } catch (IOException e) { + logger.warn("IOException while sending MMS PDU. Closing association.", e); + return false; + } + } + return true; + } + + private MMSpdu listenForMmsRequest(AcseAssociation acseAssociation) { + + while (true) { + MMSpdu mmsRequestPdu = null; + pduBuffer.clear(); + try { + acseAssociation.receive(pduBuffer); + } catch (EOFException e) { + logger.debug("Connection was closed by client."); + return null; + } catch (SocketTimeoutException e) { + logger.warn("Message fragment timeout occured while receiving request. Closing association.", e); + return null; + } catch (IOException e) { + logger.warn("IOException at lower layers while listening for incoming request. Closing association.", + e); + return null; + } catch (DecodingException e) { + logger.error("Error decoding request at OSI layers.", e); + continue; + } catch (TimeoutException e) { + logger.error( + "Illegal state: message timeout while receiving request though this timeout should 0 and never be thrown", + e); + return null; + } + mmsRequestPdu = new MMSpdu(); + + try { + mmsRequestPdu.decode(new ByteBufferInputStream(pduBuffer), null); + } catch (IOException e) { + logger.warn("IOException decoding received MMS request PDU.", e); + continue; + } + + if (mmsRequestPdu.getConfirmedRequestPDU() == null) { + if (mmsRequestPdu.getConcludeRequestPDU() != null) { + logger.debug("Got Conclude request, will close connection"); + return null; + } + else { + logger.warn("Got unexpected MMS PDU, will ignore it"); + continue; + } + } + + return mmsRequestPdu; + } + } + + private MMSpdu createServiceErrorResponse(ServiceError e, int invokeId) { + + ErrorClass errClass = new ErrorClass(); + + switch (e.getErrorCode()) { + + case ServiceError.NO_ERROR: + + break; + case ServiceError.INSTANCE_NOT_AVAILABLE: + errClass.setAccess(new BerInteger(e.getErrorCode())); + break; + case ServiceError.INSTANCE_IN_USE: + errClass.setDefinition(new BerInteger(e.getErrorCode())); + break; + case ServiceError.ACCESS_VIOLATION: + errClass.setAccess(new BerInteger(e.getErrorCode())); + break; + case ServiceError.ACCESS_NOT_ALLOWED_IN_CURRENT_STATE: + errClass.setOthers(new BerInteger(e.getErrorCode())); + break; + case ServiceError.INSTANCE_LOCKED_BY_OTHER_CLIENT: + errClass.setFile(new BerInteger(2)); + break; + case ServiceError.TYPE_CONFLICT: + errClass.setFile(new BerInteger(4)); + break; + default: + errClass.setOthers(new BerInteger(e.getErrorCode())); + } + org.openmuc.openiec61850.internal.mms.asn1.ServiceError asn1ServiceError = null; + + asn1ServiceError = new org.openmuc.openiec61850.internal.mms.asn1.ServiceError(); + asn1ServiceError.setErrorClass(errClass); + asn1ServiceError.setAdditionalDescription(new BerVisibleString(e.getMessage())); + + ConfirmedErrorPDU confirmedErrorPDU = new ConfirmedErrorPDU(); + confirmedErrorPDU.setInvokeID(new Unsigned32(invokeId)); + confirmedErrorPDU.setServiceError(asn1ServiceError); + + MMSpdu mmsPdu = new MMSpdu(); + mmsPdu.setConfirmedErrorPDU(confirmedErrorPDU); + + return mmsPdu; + } + + private GetNameListResponse handleGetServerDirectoryRequest(GetNameListRequest getNameListRequest) + throws ServiceError { + + ListOfIdentifier listOfIdentifier = new ListOfIdentifier(); + List identifiers = listOfIdentifier.getIdentifier(); + + for (ModelNode ld : serverModel) { + identifiers.add(new Identifier(ld.getName().getBytes())); + } + + GetNameListResponse getNameListResponse = new GetNameListResponse(); + getNameListResponse.setListOfIdentifier(listOfIdentifier); + getNameListResponse.setMoreFollows(new BerBoolean(false)); + + return getNameListResponse; + } + + private GetNameListResponse handleGetDirectoryRequest(GetNameListRequest getNameListRequest) throws ServiceError { + + // the ObjectScope can be vmdSpecific,domainSpecific, or aaSpecific. vmdSpecific and aaSpecific are not part of + // 61850-8-1 but are used by some IEC 61850 clients anyways. This stack will return an empty list on vmdSpecific + // and aaSpecific requests. + if (getNameListRequest.getObjectScope().getAaSpecific() != null + || getNameListRequest.getObjectScope().getVmdSpecific() != null) { + ListOfIdentifier listOfIden = new ListOfIdentifier(); + listOfIden.getIdentifier(); + GetNameListResponse getNameListResponse = new GetNameListResponse(); + getNameListResponse.setListOfIdentifier(listOfIden); + getNameListResponse.setMoreFollows(new BerBoolean(false)); + return getNameListResponse; + } + + String mmsDomainId = getNameListRequest.getObjectScope().getDomainSpecific().toString(); + + ModelNode logicalDeviceMn = serverModel.getChild(mmsDomainId); + + if (logicalDeviceMn == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "Got an invalid MMS request: given Domain name in GetNameList request is not a Logical Device name"); + } + + LogicalDevice logicalDevice = (LogicalDevice) logicalDeviceMn; + + insertRef = true; + + if (getNameListRequest.getContinueAfter() != null) { + continueAfter = getNameListRequest.getContinueAfter().toString(); + insertRef = false; + } + + List mmsReferences = new LinkedList<>(); + + for (ModelNode logicalNodeMn : logicalDevice) { + LogicalNode logicalNode = (LogicalNode) logicalNodeMn; + mmsReferences.add(logicalNode.getName()); + + for (String mmsFC : mmsFcs) { + Fc fc = Fc.fromString(mmsFC); + if (fc != null) { + + List fcDataObjects = logicalNode.getChildren(fc); + if (fcDataObjects != null) { + mmsReferences.add(logicalNode.getName() + "$" + mmsFC); + for (FcDataObject dataObject : fcDataObjects) { + insertMmsRef(dataObject, mmsReferences, logicalNode.getName() + "$" + mmsFC); + } + } + + } + } + } + + ListOfIdentifier listOfIden = new ListOfIdentifier(); + List identifiers = listOfIden.getIdentifier(); + + int identifierSize = 0; + boolean moreFollows = false; + for (String mmsReference : mmsReferences) { + if (insertRef == true) { + if (identifierSize > negotiatedMaxPduSize - 200) { + moreFollows = true; + logger.debug(" ->maxMMSPduSize of " + negotiatedMaxPduSize + " Bytes reached"); + break; + } + + Identifier identifier = null; + + identifier = new Identifier(mmsReference.getBytes()); + + identifiers.add(identifier); + identifierSize += mmsReference.length() + 2; + } + else { + if (mmsReference.equals(continueAfter)) { + insertRef = true; + } + } + } + + GetNameListResponse getNameListResponse = new GetNameListResponse(); + getNameListResponse.setListOfIdentifier(listOfIden); + getNameListResponse.setMoreFollows(new BerBoolean(moreFollows)); + + return getNameListResponse; + } + + private static void insertMmsRef(ModelNode node, List mmsRefs, String parentRef) { + String ref = parentRef + '$' + node.getName(); + mmsRefs.add(ref); + if (!(node instanceof Array)) { + for (ModelNode childNode : node) { + insertMmsRef(childNode, mmsRefs, ref); + } + } + } + + /** + * GetVariableAccessAttributes (GetDataDefinition/GetDataDirectory) can be called with different kinds of + * references. Examples: 1. DGEN1 2. DGEN1$CF 3. DGEN1$CF$GnBlk + * + */ + private GetVariableAccessAttributesResponse handleGetVariableAccessAttributesRequest( + GetVariableAccessAttributesRequest getVariableAccessAttributesRequest) throws ServiceError { + if (getVariableAccessAttributesRequest.getName() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "Got an invalid MMS packet: name is not selected in GetVariableAccessAttributesRequest"); + } + + DomainSpecific domainSpecific = getVariableAccessAttributesRequest.getName().getDomainSpecific(); + + if (domainSpecific == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "Got an invalid MMS packet: Domain specific is not selected in GetVariableAccessAttributesRequest"); + } + + ModelNode modelNode = serverModel.getChild(domainSpecific.getDomainID().toString()); + + if (modelNode == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + + String itemIdString = domainSpecific.getItemID().toString(); + + int index1 = itemIdString.indexOf('$'); + + LogicalNode logicalNode = null; + + if (index1 != -1) { + logicalNode = (LogicalNode) modelNode.getChild(itemIdString.substring(0, index1)); + if (logicalNode == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + int index2 = itemIdString.indexOf('$', index1 + 2); + if (index2 != -1) { + Fc fc = Fc.fromString(itemIdString.substring(index1 + 1, index2)); + if (fc == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + index1 = itemIdString.indexOf('$', index2 + 2); + ModelNode subNode; + if (index1 == -1) { + subNode = logicalNode.getChild(itemIdString.substring(index2 + 1), fc); + if (subNode == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + } + else { + subNode = logicalNode.getChild(itemIdString.substring(index2 + 1, index1), fc); + if (subNode == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + index2 = itemIdString.indexOf('$', index1 + 2); + while (index2 != -1) { + subNode = subNode.getChild(itemIdString.substring(index1 + 1, index2)); + if (subNode == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName() + .getDomainSpecific() + .getDomainID() + + " and ItemID " + getVariableAccessAttributesRequest.getName() + .getDomainSpecific() + .getItemID() + + " was found."); + } + index1 = index2; + index2 = itemIdString.indexOf('$', index1 + 2); + } + subNode = subNode.getChild(itemIdString.substring(index1 + 1)); + if (subNode == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + } + + GetVariableAccessAttributesResponse getVariableAccessAttributesResponse = new GetVariableAccessAttributesResponse(); + getVariableAccessAttributesResponse.setMmsDeletable(new BerBoolean(false)); + getVariableAccessAttributesResponse.setTypeDescription(subNode.getMmsTypeSpec()); + + return getVariableAccessAttributesResponse; + } + else { + Fc fc = Fc.fromString(itemIdString.substring(index1 + 1)); + + if (fc == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + + List fcDataObjects = logicalNode.getChildren(fc); + + if (fcDataObjects == null || fcDataObjects.size() == 0) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + + Components comp = new Components(); + List doStructComponents = comp.getSEQUENCE(); + for (ModelNode child : fcDataObjects) { + TypeSpecification typeSpecification = new TypeSpecification(); + typeSpecification.setTypeDescription(child.getMmsTypeSpec()); + + TypeDescription.Structure.Components.SEQUENCE structComponent = new TypeDescription.Structure.Components.SEQUENCE(); + structComponent.setComponentName(new Identifier(child.getName().getBytes())); + structComponent.setComponentType(typeSpecification); + doStructComponents.add(structComponent); + } + + Structure struct = new Structure(); + struct.setComponents(comp); + + TypeDescription typeDescription = new TypeDescription(); + typeDescription.setStructure(struct); + + GetVariableAccessAttributesResponse getVariableAccessAttributesResponse = new GetVariableAccessAttributesResponse(); + getVariableAccessAttributesResponse.setMmsDeletable(new BerBoolean(false)); + getVariableAccessAttributesResponse.setTypeDescription(typeDescription); + + return getVariableAccessAttributesResponse; + } + } + + logicalNode = (LogicalNode) modelNode.getChild(itemIdString); + if (logicalNode == null) { + throw new ServiceError(ServiceError.INSTANCE_NOT_AVAILABLE, + "GetVariableAccessAttributes (GetDataDefinition): no object with domainId " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getDomainID() + + " and ItemID " + + getVariableAccessAttributesRequest.getName().getDomainSpecific().getItemID() + + " was found."); + } + + Components components = new Components(); + List structComponents = components.getSEQUENCE(); + + for (String mmsFc : mmsFcs) { + Fc fc = Fc.fromString(mmsFc); + if (fc != null) { + + Collection fcDataObjects = logicalNode.getChildren(fc); + if (fcDataObjects == null) { + continue; + } + + Components comp = new Components(); + List doStructComponents = comp.getSEQUENCE(); + + for (ModelNode child : fcDataObjects) { + TypeSpecification typeSpecification = new TypeSpecification(); + typeSpecification.setTypeDescription(child.getMmsTypeSpec()); + + TypeDescription.Structure.Components.SEQUENCE doStructComponent = new TypeDescription.Structure.Components.SEQUENCE(); + doStructComponent.setComponentName(new Identifier(child.getName().getBytes())); + doStructComponent.setComponentType(typeSpecification); + + doStructComponents.add(doStructComponent); + } + + Structure struct = new Structure(); + struct.setComponents(comp); + + TypeDescription fcTypeSpec = new TypeDescription(); + fcTypeSpec.setStructure(struct); + + TypeSpecification typeSpecification = new TypeSpecification(); + typeSpecification.setTypeDescription(fcTypeSpec); + + TypeDescription.Structure.Components.SEQUENCE structCom = new TypeDescription.Structure.Components.SEQUENCE(); + structCom.setComponentName(new Identifier(mmsFc.getBytes())); + structCom.setComponentType(typeSpecification); + + structComponents.add(structCom); + + } + } + + Structure struct = new Structure(); + struct.setComponents(components); + + TypeDescription typeSpec = new TypeDescription(); + typeSpec.setStructure(struct); + + GetVariableAccessAttributesResponse getVariableAccessAttributesResponse = new GetVariableAccessAttributesResponse(); + getVariableAccessAttributesResponse.setMmsDeletable(new BerBoolean(false)); + getVariableAccessAttributesResponse.setTypeDescription(typeSpec); + + return getVariableAccessAttributesResponse; + + } + + private ReadResponse handleGetDataValuesRequest(ReadRequest mmsReadRequest) throws ServiceError { + + VariableAccessSpecification variableAccessSpecification = mmsReadRequest.getVariableAccessSpecification(); + + if (mmsReadRequest.getSpecificationWithResult() == null + || mmsReadRequest.getSpecificationWithResult().value == false) { + + if (variableAccessSpecification.getListOfVariable() == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "handleGetDataValuesRequest: Got an invalid MMS packet"); + } + + List listOfVariable = variableAccessSpecification.getListOfVariable().getSEQUENCE(); + + if (listOfVariable.size() < 1) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, + "handleGetDataValuesRequest: less than one variableAccessSpecification is not allowed"); + } + + ListOfAccessResult listOfAccessResult = new ListOfAccessResult(); + List accessResults = listOfAccessResult.getAccessResult(); + + synchronized (serverModel) { + for (VariableDefs.SEQUENCE variableDef : listOfVariable) { + + FcModelNode modelNode = serverModel.getNodeFromVariableDef(variableDef); + + if (modelNode == null) { + logger.debug("Got a GetDataValues request for a non existent model node."); + // 10 indicates error "object-non-existent" + AccessResult accessResult = new AccessResult(); + accessResult.setFailure(new DataAccessError(10L)); + accessResults.add(accessResult); + } + else { + if (logger.isDebugEnabled()) { + logger.debug("Got a GetDataValues request for node: " + modelNode); + if (!(modelNode instanceof BasicDataAttribute)) { + for (BasicDataAttribute bda : modelNode.getBasicDataAttributes()) { + logger.debug("sub BDA is:" + bda); + } + } + } + accessResults.add(getReadResult(modelNode)); + } + } + } + + ReadResponse readResponse = new ReadResponse(); + readResponse.setListOfAccessResult(listOfAccessResult); + return readResponse; + } + else { + logger.debug("Got a GetDataSetValues request."); + + String dataSetReference = convertToDataSetReference(variableAccessSpecification.getVariableListName()); + + if (dataSetReference == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, + "handleGetDataSetValuesRequest: DataSet name incorrect"); + } + + ListOfAccessResult listOfAccessResult = new ListOfAccessResult(); + List accessResults = listOfAccessResult.getAccessResult(); + + if (dataSetReference.startsWith("@")) { + DataSet dataSet = nonPersistentDataSets.get(dataSetReference); + if (dataSet == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, + "handleGetDataSetValuesRequest: a DataSet with the given reference does not exist"); + } + + for (FcModelNode dsMember : dataSet) { + accessResults.add(getReadResult(dsMember)); + } + } + else { + synchronized (serverModel) { + DataSet dataSet = serverModel.getDataSet(dataSetReference); + + if (dataSet == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, + "handleGetDataSetValuesRequest: a DataSet with the given reference does not exist"); + } + + for (FcModelNode dsMember : dataSet) { + accessResults.add(getReadResult(dsMember)); + } + } + } + ReadResponse readResponse = new ReadResponse(); + readResponse.setListOfAccessResult(listOfAccessResult); + return readResponse; + + } + + } + + private AccessResult getReadResult(FcModelNode modelNode) { + + AccessResult accessResult = new AccessResult(); + + if (modelNode.getFc() == Fc.CO && modelNode.getName().equals("SBO")) { + // if (modelNode.getName().equals("SBO")) { + FcModelNode cdcParent = (FcModelNode) modelNode.getParent(); + ModelNode ctlModelNode = serverModel.findModelNode(cdcParent.getReference(), Fc.CF).getChild("ctlModel"); + if (ctlModelNode == null || !(ctlModelNode instanceof BdaInt8) + || ((BdaInt8) ctlModelNode).getValue() != 2) { + logger.warn("Selecting controle DO fails because ctlModel is not set to \"sbo-with-normal-security\""); + // 3 indicates error "object_access_denied" + accessResult.setFailure(new DataAccessError(3L)); + return accessResult; + } + if (!cdcParent.select(this, serverSap.timer)) { + Data data = new Data(); + data.setVisibleString(new BerVisibleString("")); + accessResult.setSuccess(data); + return accessResult; + } + Data data = new Data(); + data.setVisibleString(new BerVisibleString("success")); + accessResult.setSuccess(data); + return accessResult; + + // } + // else { + // logger.warn("A client tried to read a control variable other than SBO. This is not allowed."); + // // 3 indicates error "object_access_denied" + // return new AccessResult(new BerInteger(3L), null); + // } + + } + + Data data = modelNode.getMmsDataObj(); + + if (data == null) { + // 11 indicates error "object_value_invalid" + accessResult.setFailure(new DataAccessError(11L)); + return accessResult; + } + + accessResult.setSuccess(data); + return accessResult; + } + + private WriteResponse handleSetDataValuesRequest(WriteRequest mmsWriteRequest) throws ServiceError { + + VariableAccessSpecification variableAccessSpecification = mmsWriteRequest.getVariableAccessSpecification(); + + List listOfData = mmsWriteRequest.getListOfData().getData(); + + WriteResponse writeResponse = new WriteResponse(); + List mmsResponseValues = writeResponse.getCHOICE(); + + if (variableAccessSpecification.getListOfVariable() != null) { + logger.debug("Got a SetDataValues request."); + + List listOfVariable = variableAccessSpecification.getListOfVariable().getSEQUENCE(); + + if (listOfVariable.size() < 1 || listOfData.size() < 1 || listOfVariable.size() != listOfData.size()) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, + "handleSetDataValuesRequest: less than one variableAccessSpecification or data element is not allowed, or listOfData ne listOfVar"); + } + + Iterator mmsDataIterator = listOfData.iterator(); + + List totalBdasToBeWritten = new ArrayList<>(); + int[] numBdas = new int[listOfData.size()]; + + int i = -1; + synchronized (serverModel) { + for (VariableDefs.SEQUENCE variableDef : listOfVariable) { + i++; + Data mmsData = mmsDataIterator.next(); + + FcModelNode modelNode = serverModel.getNodeFromVariableDef(variableDef); + + if (modelNode == null) { + // 10 indicates error "object-non-existent" + WriteResponse.CHOICE writeResponseChoice = new WriteResponse.CHOICE(); + writeResponseChoice.setFailure(new DataAccessError(10L)); + mmsResponseValues.add(writeResponseChoice); + } + else { + + getFirstWriteResults(mmsResponseValues, totalBdasToBeWritten, numBdas, i, modelNode, mmsData); + } + } + + writeAndFillMissingWriteResults(mmsResponseValues, totalBdasToBeWritten, numBdas); + } + + } + else if (variableAccessSpecification.getVariableListName() != null) { + logger.debug("Got a SetDataSetValues request."); + + String dataSetRef = convertToDataSetReference(variableAccessSpecification.getVariableListName()); + + // TODO handle non-persisten DataSets too + + DataSet dataSet = serverModel.getDataSet(dataSetRef); + + Iterator mmsDataIterator = listOfData.iterator(); + + List totalBdasToBeWritten = new ArrayList<>(); + int[] numBdas = new int[listOfData.size()]; + + int i = -1; + synchronized (serverModel) { + for (FcModelNode dataSetMember : dataSet) { + i++; + Data mmsData = mmsDataIterator.next(); + + getFirstWriteResults(mmsResponseValues, totalBdasToBeWritten, numBdas, i, dataSetMember, mmsData); + } + + writeAndFillMissingWriteResults(mmsResponseValues, totalBdasToBeWritten, numBdas); + } + + } + else { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "handleSetDataValuesRequest: invalid MMS request"); + } + + return writeResponse; + } + + private void writeAndFillMissingWriteResults(List mmsResponseValues, + List totalBdasToBeWritten, int[] numBdas) { + int i; + if (totalBdasToBeWritten.size() != 0) { + List serviceErrors = serverSap.serverEventListener.write(totalBdasToBeWritten); + ListIterator mmsResponseIterator = mmsResponseValues.listIterator(); + if (serviceErrors == null || serviceErrors.size() != totalBdasToBeWritten.size()) { + while (mmsResponseIterator.hasNext()) { + if (mmsResponseIterator.next() == null) { + mmsResponseIterator.set(writeSuccess); + } + } + for (BasicDataAttribute bda : totalBdasToBeWritten) { + bda.mirror.setValueFrom(bda); + } + } + else { + i = -1; + Iterator serviceErrorIterator = serviceErrors.iterator(); + Iterator bdaToBeWrittenIterator = totalBdasToBeWritten.iterator(); + while (mmsResponseIterator.hasNext()) { + i++; + if (mmsResponseIterator.next() == null) { + for (int j = 0; j < numBdas[i]; j++) { + ServiceError serviceError = serviceErrorIterator.next(); + BasicDataAttribute bda = bdaToBeWrittenIterator.next(); + if (serviceError != null) { + WriteResponse.CHOICE writeResponseChoice = new WriteResponse.CHOICE(); + writeResponseChoice + .setFailure(new DataAccessError(serviceErrorToMmsError(serviceError))); + mmsResponseIterator.set(writeResponseChoice); + } + else { + bda.mirror.setValueFrom(bda); + } + } + } + } + } + + } + } + + private void getFirstWriteResults(List mmsResponseValues, + List totalBdasToBeWritten, int[] numBdas, int i, FcModelNode fcModelNode, + Data mmsData) { + WriteResponse.CHOICE writeResult = getWriteResult(fcModelNode, mmsData); + if (writeResult == null) { + FcModelNode fcModelNodeCopy = (FcModelNode) fcModelNode.copy(); + try { + fcModelNodeCopy.setValueFromMmsDataObj(mmsData); + } catch (ServiceError e) { + logger.warn("SetDataValues failed because of data missmatch.", e); + WriteResponse.CHOICE writeResponseChoice = new WriteResponse.CHOICE(); + writeResponseChoice.setFailure(new DataAccessError(serviceErrorToMmsError(e))); + mmsResponseValues.add(writeResponseChoice); + return; + } + + if (fcModelNodeCopy.fc == Fc.CO) { + // TODO timeactivate operate + fcModelNodeCopy = (BasicDataAttribute) fcModelNodeCopy.getChild("ctlVal"); + // TODO write origin and ctlNum if they exist + } + else { + + } + + List bdas = fcModelNodeCopy.getBasicDataAttributes(); + totalBdasToBeWritten.addAll(bdas); + numBdas[i] = bdas.size(); + mmsResponseValues.add(null); + + } + else { + mmsResponseValues.add(writeResult); + } + } + + private WriteResponse.CHOICE getWriteResult(FcModelNode modelNode, Data mmsData) { + + WriteResponse.CHOICE writeResponse = new WriteResponse.CHOICE(); + + Fc fc = modelNode.getFc(); + if (fc == Fc.ST || fc == Fc.MX || fc == Fc.OR || fc == Fc.EX) { + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + + if (fc == Fc.CO) { + String nodeName = modelNode.getName(); + + if (nodeName.equals("Oper")) { + FcModelNode cdcParent = (FcModelNode) modelNode.getParent(); + ModelNode ctlModelNode = serverModel.findModelNode(cdcParent.getReference(), Fc.CF) + .getChild("ctlModel"); + if (ctlModelNode == null || !(ctlModelNode instanceof BdaInt8)) { + logger.warn("Operatring controle DO failed because ctlModel is not set."); + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + + int ctlModel = ((BdaInt8) ctlModelNode).getValue(); + + /* Direct control with normal security (direct-operate) */ + if (ctlModel == 1) { + return null; + } + /* SBO control with normal security (operate-once or operate-many) */ + else if (ctlModel == 2) { + if (cdcParent.isSelectedBy(this)) { + return null; + } + else { + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + + } + else { + logger.warn("SetDataValues failed because of unsupported ctlModel: " + ctlModel); + // 9 indicates error "object_access_unsupported" + writeResponse.setFailure(new DataAccessError(9L)); + return writeResponse; + + } + } + else { + logger.warn("SetDataValues failed because of the operation is not allowed yet: " + modelNode.getName()); + // 9 indicates error "object_access_unsupported" + writeResponse.setFailure(new DataAccessError(9L)); + return writeResponse; + } + } + else if (fc == Fc.RP) { + + if (modelNode instanceof Rcb) { + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + + FcModelNode fcModelNodeCopy = (FcModelNode) modelNode.copy(); + + try { + fcModelNodeCopy.setValueFromMmsDataObj(mmsData); + } catch (ServiceError e) { + WriteResponse.CHOICE writeResponseChoice = new WriteResponse.CHOICE(); + writeResponseChoice.setFailure(new DataAccessError(serviceErrorToMmsError(e))); + return writeResponseChoice; + } + + Urcb urcb = (Urcb) modelNode.getParent(); + + String nodeName = modelNode.getName(); + + synchronized (urcb) { + if (nodeName.equals("RptEna")) { + BdaBoolean rptEnaNode = (BdaBoolean) fcModelNodeCopy; + if (rptEnaNode.getValue()) { + if (urcb.dataSet == null) { + logger.info("client tried to enable RCB even though there is no configured data set"); + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + if (urcb.reserved == null) { + urcb.reserved = this; + urcb.enable(); + rsvdURCBs.add(urcb); + ((BdaBoolean) modelNode).setValue(true); + return writeSuccess; + } + else if (urcb.reserved == this) { + urcb.enable(); + ((BdaBoolean) modelNode).setValue(true); + return writeSuccess; + } + else { + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + + } + else { + // disable reporting + if (urcb.reserved == this) { + urcb.disable(); + ((BdaBoolean) modelNode).setValue(false); + return writeSuccess; + } + else { + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + } + } + else if (nodeName.equals("Resv")) { + BdaBoolean rptResvNode = (BdaBoolean) fcModelNodeCopy; + if (rptResvNode.getValue()) { + + if (urcb.reserved == null) { + urcb.reserved = this; + urcb.getResv().setValue(true); + rsvdURCBs.add(urcb); + return writeSuccess; + } + else if (urcb.reserved == this) { + return writeSuccess; + } + else { + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + } + else { + if (urcb.reserved == this) { + urcb.reserved = null; + urcb.getResv().setValue(false); + rsvdURCBs.remove(urcb); + return writeSuccess; + } + else { + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + } + + } + else if (nodeName.equals("DatSet")) { + if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) { + String dataSetRef = ((BdaVisibleString) fcModelNodeCopy).getStringValue(); + if (dataSetRef.isEmpty()) { + urcb.dataSet = null; + ((BasicDataAttribute) modelNode).setValueFrom((BasicDataAttribute) fcModelNodeCopy); + return writeSuccess; + + } + else { + DataSet dataSet = serverModel.getDataSet(dataSetRef); + if (dataSet != null) { + urcb.dataSet = dataSet; + ((BasicDataAttribute) modelNode).setValueFrom((BasicDataAttribute) fcModelNodeCopy); + return writeSuccess; + } + else { + logger.info("Client tried to set dataSetReference of URCB to non existant data set."); + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + } + } + else { + logger.info( + "Client tried to write RCB parameter even though URCB is reserved by other client or already enabled."); + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + } + else if (nodeName.equals("OptFlds")) { + if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) { + if (!((BdaOptFlds) modelNode).isBufferOverflow() && !((BdaOptFlds) modelNode).isConfigRevision() + && !((BdaOptFlds) modelNode).isDataReference() + && !((BdaOptFlds) modelNode).isEntryId()) { + ((BasicDataAttribute) modelNode).setValueFrom((BasicDataAttribute) fcModelNodeCopy); + return writeSuccess; + } + else { + logger.info("Client tried to write OptFlds with usupported field set to true."); + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + } + else { + logger.info( + "Client tried to write RCB parameter even though URCB is reserved by other client or already enabled."); + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + + } + else if (nodeName.equals("GI")) { + + if ((urcb.reserved == this) && urcb.enabled + && ((BdaTriggerConditions) urcb.getChild("TrgOps")).isGeneralInterrogation()) { + urcb.generalInterrogation(); + return writeSuccess; + } + else { + logger.info( + "Client tried to initiate a general interrogation even though URCB is not enabled by this client or general interrogation is not enabled in the trigger options."); + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + + } + else if (nodeName.equals("RptID") || nodeName.equals("BufTm") || nodeName.equals("TrgOps") + || nodeName.equals("IntgPd")) { + if ((urcb.reserved == null || urcb.reserved == this) && !urcb.enabled) { + ((BasicDataAttribute) modelNode).setValueFrom((BasicDataAttribute) fcModelNodeCopy); + return writeSuccess; + } + else { + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + + } + else { + // nodes sqnum, ConfRev, and owner may not be read + // 3 indicates error "object_access_denied" + writeResponse.setFailure(new DataAccessError(3L)); + return writeResponse; + } + } + + } + else { + + return null; + } + + } + + // private WriteResponse.SubChoice operate(FcModelNode modelNode, Data mmsData) { + // FcModelNode fcModelNodeCopy = (FcModelNode) modelNode.copy(); + // try { + // fcModelNodeCopy.setValueFromMmsDataObj(mmsData); + // } catch (ServiceError e) { + // logger.warn("SetDataValues failed because of data missmatch.", e); + // return new WriteResponse.SubChoice(new BerInteger(serviceErrorToMmsError(e)), null); + // } + // + // // TODO timeactivate operate + // + // BasicDataAttribute ctlValBda = (BasicDataAttribute) fcModelNodeCopy.getChild("ctlVal"); + // List bdas = new ArrayList(1); + // bdas.add(ctlValBda); + // List serviceErrors; + // try { + // serviceErrors = serverSap.serverEventListener.write(bdas); + // } catch (ServiceError e) { + // return new WriteResponse.SubChoice(new BerInteger(serviceErrorToMmsError(e)), null); + // } + // if (serviceErrors != null && serviceErrors.size() == bdas.size() && serviceErrors.get(1) != null) { + // return new WriteResponse.SubChoice(new BerInteger(serviceErrorToMmsError(serviceErrors.get(1))), null); + // } + // + // ctlValBda.mirror.setValueFrom(ctlValBda); + // // TODO write origin and ctlNum if they exist + // + // return writeSuccess; + // } + + private int serviceErrorToMmsError(ServiceError e) { + + switch (e.getErrorCode()) { + case ServiceError.FAILED_DUE_TO_SERVER_CONSTRAINT: + return 1; + case ServiceError.INSTANCE_LOCKED_BY_OTHER_CLIENT: + return 2; + case ServiceError.ACCESS_VIOLATION: + return 3; + case ServiceError.TYPE_CONFLICT: + return 7; + case ServiceError.INSTANCE_NOT_AVAILABLE: + return 10; + case ServiceError.PARAMETER_VALUE_INCONSISTENT: + return 11; + default: + return 9; + } + } + + private GetNameListResponse handleGetDataSetNamesRequest(GetNameListRequest getNameListRequest) + throws ServiceError { + + BerVisibleString domainSpecific = getNameListRequest.getObjectScope().getDomainSpecific(); + + List dsList = null; + if (domainSpecific == null) { + dsList = new ArrayList<>(nonPersistentDataSets.size()); + for (String dataSet : nonPersistentDataSets.keySet()) { + dsList.add(dataSet); + } + } + else { + dsList = serverModel.getDataSetNames(domainSpecific.toString()); + } + + insertRef = true; + if (getNameListRequest.getContinueAfter() != null) { + continueAfter = getNameListRequest.getContinueAfter().toString(); + insertRef = false; + } + + ListOfIdentifier listOf = new ListOfIdentifier(); + List identifiers = listOf.getIdentifier(); + + int identifierSize = 0; + boolean moreFollows = false; + + if (dsList != null) { + for (String dsRef : dsList) { + if (insertRef == true) { + if (identifierSize > negotiatedMaxPduSize - 200) { + moreFollows = true; + logger.info("maxMMSPduSize reached"); + break; + } + identifiers.add(new Identifier(dsRef.getBytes())); + identifierSize += dsRef.length() + 2; + } + else { + if (dsRef.equals(continueAfter)) { + insertRef = true; + } + } + } + } + + GetNameListResponse getNameListResponse = new GetNameListResponse(); + getNameListResponse.setListOfIdentifier(listOf); + getNameListResponse.setMoreFollows(new BerBoolean(moreFollows)); + + return getNameListResponse; + } + + private GetNamedVariableListAttributesResponse handleGetDataSetDirectoryRequest(ObjectName mmsGetNamedVarListAttReq) + throws ServiceError { + + String dataSetReference = convertToDataSetReference(mmsGetNamedVarListAttReq); + + DataSet dataSet; + + if (dataSetReference.startsWith("@")) { + dataSet = nonPersistentDataSets.get(dataSetReference); + } + else { + dataSet = serverModel.getDataSet(dataSetReference); + } + + if (dataSet == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "DataSet with that reference is does not exist."); + } + + VariableDefs variableDefs = new VariableDefs(); + + List listOfVariable = variableDefs.getSEQUENCE(); + + for (FcModelNode member : dataSet) { + listOfVariable.add(member.getMmsVariableDef()); + } + + GetNamedVariableListAttributesResponse getNamedVariableListAttributesResponse = new GetNamedVariableListAttributesResponse(); + getNamedVariableListAttributesResponse.setListOfVariable(variableDefs); + getNamedVariableListAttributesResponse.setMmsDeletable(new BerBoolean(dataSet.isDeletable())); + + return getNamedVariableListAttributesResponse; + } + + private static String convertToDataSetReference(ObjectName mmsObjectName) { + if (mmsObjectName.getDomainSpecific() != null) { + return mmsObjectName.getDomainSpecific().getDomainID().toString() + "/" + + mmsObjectName.getDomainSpecific().getItemID().toString().replace('$', '.'); + } + else if (mmsObjectName.getAaSpecific() != null) { + // format is "@DataSetName" + return mmsObjectName.getAaSpecific().toString(); + } + return null; + } + + private DefineNamedVariableListResponse handleCreateDataSetRequest( + DefineNamedVariableListRequest mmsDefineNamedVariableListRequest) throws ServiceError { + String dataSetReference = convertToDataSetReference(mmsDefineNamedVariableListRequest.getVariableListName()); + if (dataSetReference == null) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INCONSISTENT, + "handleCreateDataSetRequest: invalid MMS request (No DataSet Name Specified)"); + } + + List nameList = mmsDefineNamedVariableListRequest.getListOfVariable().getSEQUENCE(); + + List dataSetMembers = new ArrayList<>(nameList.size()); + + for (VariableDefs.SEQUENCE variableDef : nameList) { + dataSetMembers.add(serverModel.getNodeFromVariableDef(variableDef)); + } + + DataSet dataSet = new DataSet(dataSetReference, dataSetMembers, true); + + if (dataSetReference.startsWith("@")) { + if (nonPersistentDataSets.containsKey(dataSetReference)) { + throw new ServiceError(ServiceError.PARAMETER_VALUE_INAPPROPRIATE, + "data set with that name exists already"); + } + nonPersistentDataSets.put(dataSetReference, dataSet); + } + else { + serverModel.addDataSet(dataSet); + } + + return new DefineNamedVariableListResponse(); + } + + private DeleteNamedVariableListResponse handleDeleteDataSetRequest( + DeleteNamedVariableListRequest mmsDelNamVarListReq) throws ServiceError { + String dataSetReference = convertToDataSetReference( + mmsDelNamVarListReq.getListOfVariableListName().getObjectName().get(0)); + + DeleteNamedVariableListResponse deleteNamedVariableListResponse = new DeleteNamedVariableListResponse(); + + if (dataSetReference.startsWith("@")) { + if (nonPersistentDataSets.remove(dataSetReference) == null) { + deleteNamedVariableListResponse.setNumberMatched(new Unsigned32(0)); + deleteNamedVariableListResponse.setNumberDeleted(new Unsigned32(0)); + return deleteNamedVariableListResponse; + } + else { + deleteNamedVariableListResponse.setNumberMatched(new Unsigned32(1)); + deleteNamedVariableListResponse.setNumberDeleted(new Unsigned32(1)); + return deleteNamedVariableListResponse; + } + } + else { + synchronized (serverModel) { + if (serverModel.removeDataSet(dataSetReference) == null) { + if (serverModel.getDataSet(dataSetReference) == null) { + // DataSet with the name does not exist. + deleteNamedVariableListResponse.setNumberMatched(new Unsigned32(0)); + deleteNamedVariableListResponse.setNumberDeleted(new Unsigned32(0)); + return deleteNamedVariableListResponse; + } + else { + // DataSet exists but is not deletable + deleteNamedVariableListResponse.setNumberMatched(new Unsigned32(1)); + deleteNamedVariableListResponse.setNumberDeleted(new Unsigned32(0)); + return deleteNamedVariableListResponse; + } + } + else { + deleteNamedVariableListResponse.setNumberMatched(new Unsigned32(1)); + deleteNamedVariableListResponse.setNumberDeleted(new Unsigned32(1)); + return deleteNamedVariableListResponse; + } + } + } + } + + void close() { + cleanUpConnection(); + if (acseAssociation != null) { + acseAssociation.disconnect(); + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/ServerEventListener.java b/src/main/java/org/openmuc/openiec61850/ServerEventListener.java new file mode 100644 index 0000000..d8ee9a1 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ServerEventListener.java @@ -0,0 +1,38 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.List; + +public interface ServerEventListener { + + /** + * The write callback function is called if one of more basic data attributes are written using either the + * setDataValue, setDataSetValues or control services. If the complete write process was successful write returns + * either an empty list or null. If an error occurs writing one or more attributes then a list shall be returned + * that is of equal size as the list of basic data attributes. The returned list's element shall be null if writing + * the corresponding BDA was successful and a service error otherwise. + * + * @param bdas + * the list of basic data attributes that are to be set. + * @return a list of service errors indicating errors writing the corresponding basic data attributes. + */ + public List write(List bdas); + + void serverStoppedListening(ServerSap serverSAP); + +} diff --git a/src/main/java/org/openmuc/openiec61850/ServerModel.java b/src/main/java/org/openmuc/openiec61850/ServerModel.java new file mode 100644 index 0000000..0c26bd9 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ServerModel.java @@ -0,0 +1,399 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.openmuc.openiec61850.internal.mms.asn1.AlternateAccessSelection; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectName; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectName.DomainSpecific; +import org.openmuc.openiec61850.internal.mms.asn1.VariableDefs; + +public final class ServerModel extends ModelNode { + + private final Map dataSets = new LinkedHashMap<>(); + + private final Map urcbs = new HashMap<>(); + private final Map brcbs = new HashMap<>(); + + public ServerModel(List logicalDevices, Collection dataSets) { + children = new LinkedHashMap<>(); + objectReference = null; + for (LogicalDevice logicalDevice : logicalDevices) { + children.put(logicalDevice.getReference().getName(), logicalDevice); + logicalDevice.setParent(this); + } + + if (dataSets != null) { + addDataSets(dataSets); + } + + for (LogicalDevice ld : logicalDevices) { + for (ModelNode ln : ld.getChildren()) { + for (Urcb urcb : ((LogicalNode) ln).getUrcbs()) { + urcbs.put(urcb.getReference().toString(), urcb); + urcb.dataSet = getDataSet(urcb.getDatSet().getStringValue().replace('$', '.')); + } + for (Brcb brcb : ((LogicalNode) ln).getBrcbs()) { + brcbs.put(brcb.getReference().toString(), brcb); + brcb.dataSet = getDataSet(brcb.getDatSet().getStringValue().replace('$', '.')); + } + } + } + + } + + @Override + public ServerModel copy() { + List childCopies = new ArrayList<>(children.size()); + for (ModelNode childNode : children.values()) { + childCopies.add((LogicalDevice) childNode.copy()); + } + + List dataSetCopies = new ArrayList<>(dataSets.size()); + for (DataSet dataSet : dataSets.values()) { + dataSetCopies.add(dataSet); + } + + return new ServerModel(childCopies, dataSetCopies); + } + + /** + * Get the data set with the given reference. Return null if none is found. + * + * @param reference + * the reference of the requested data set. + * @return the data set with the given reference. + */ + public DataSet getDataSet(String reference) { + return dataSets.get(reference); + } + + void addDataSet(DataSet dataSet) { + dataSets.put(dataSet.getReferenceStr(), dataSet); + for (ModelNode ld : children.values()) { + for (ModelNode ln : ld.getChildren()) { + for (Urcb urcb : ((LogicalNode) ln).getUrcbs()) { + urcb.dataSet = getDataSet(urcb.getDatSet().getStringValue().replace('$', '.')); + } + for (Brcb brcb : ((LogicalNode) ln).getBrcbs()) { + brcb.dataSet = getDataSet(brcb.getDatSet().getStringValue().replace('$', '.')); + } + } + } + } + + void addDataSets(Collection dataSets) { + for (DataSet dataSet : dataSets) { + addDataSet(dataSet); + } + for (ModelNode ld : children.values()) { + for (ModelNode ln : ld.getChildren()) { + for (Urcb urcb : ((LogicalNode) ln).getUrcbs()) { + urcb.dataSet = getDataSet(urcb.getDatSet().getStringValue().replace('$', '.')); + } + for (Brcb brcb : ((LogicalNode) ln).getBrcbs()) { + brcb.dataSet = getDataSet(brcb.getDatSet().getStringValue().replace('$', '.')); + } + } + } + } + + List getDataSetNames(String ldName) { + // TODO make thread save + List dataSetNames = new LinkedList<>(); + for (String dataSetRef : dataSets.keySet()) { + if (dataSetRef.startsWith(ldName)) { + dataSetNames.add(dataSetRef.substring(dataSetRef.indexOf('/') + 1).replace('.', '$')); + } + } + return dataSetNames; + } + + /** + * Get a collection of all data sets that exist in this model. + * + * @return a collection of all data sets + */ + public Collection getDataSets() { + return dataSets.values(); + } + + /** + * + * @param dataSetReference + * @return returns the DataSet that was removed, null if no DataSet with the given reference was found or the data + * set is not deletable. + */ + DataSet removeDataSet(String dataSetReference) { + DataSet dataSet = dataSets.get(dataSetReference); + if (dataSet == null || !dataSet.isDeletable()) { + return null; + } + DataSet removedDataSet = dataSets.remove(dataSetReference); + for (ModelNode ld : children.values()) { + for (ModelNode ln : ld.getChildren()) { + for (Urcb urcb : ((LogicalNode) ln).getUrcbs()) { + urcb.dataSet = getDataSet(urcb.getDatSet().getStringValue().replace('$', '.')); + } + for (Brcb brcb : ((LogicalNode) ln).getBrcbs()) { + brcb.dataSet = getDataSet(brcb.getDatSet().getStringValue().replace('$', '.')); + } + } + } + return removedDataSet; + } + + void addUrcb(Urcb urcb) { + urcbs.put(urcb.getReference().getName(), urcb); + } + + /** + * Get the unbuffered report control block (URCB) with the given reference. + * + * @param reference + * the reference of the requested URCB. + * @return the reference to the requested URCB or null if none with the given reference is found. + */ + public Urcb getUrcb(String reference) { + return urcbs.get(reference); + } + + /** + * Get a collection of all unbuffered report control blocks (URCB) that exist in this model. + * + * @return a collection of all unbuffered report control blocks (URCB) + */ + public Collection getUrcbs() { + return urcbs.values(); + } + + /** + * Get the buffered report control block (BRCB) with the given reference. + * + * @param reference + * the reference of the requested BRCB. + * @return the reference to the requested BRCB or null if none with the given reference is found. + */ + public Brcb getBrcb(String reference) { + return brcbs.get(reference); + } + + /** + * Get a collection of all buffered report control blocks (BRCB) that exist in this model. + * + * @return a collection of all buffered report control blocks (BRCB) + */ + public Collection getBrcbs() { + return brcbs.values(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + for (ModelNode logicalDevice : children.values()) { + sb.append(logicalDevice.toString()); + } + sb.append("\nURCBs:"); + for (Urcb urcb : getUrcbs()) { + sb.append("\n\n").append(urcb); + } + + sb.append("\n\nBRCBs:"); + for (Brcb brcb : getBrcbs()) { + sb.append("\n\n").append(brcb); + } + return sb.toString(); + } + + /** + * Searches and returns the model node with the given object reference and FC. If searching for Logical Devices and + * Logical Nodes the given fc parameter may be null. + * + * @param objectReference + * the object reference of the node that is being searched for. It has a syntax like "ldname/ln.do....". + * @param fc + * the functional constraint of the requested model node. May be null for Logical Device and Logical Node + * references. + * @return the model node if it was found or null otherwise + */ + public ModelNode findModelNode(ObjectReference objectReference, Fc fc) { + + ModelNode currentNode = this; + Iterator searchedNodeReferenceIterator = objectReference.iterator(); + + while (searchedNodeReferenceIterator.hasNext()) { + currentNode = currentNode.getChild(searchedNodeReferenceIterator.next(), fc); + if (currentNode == null) { + return null; + } + } + return currentNode; + } + + /** + * Searches and returns the model node with the given object reference and FC. If searching for Logical Devices and + * Logical Nodes the given fc parameter may be null. + * + * @param objectReference + * the object reference of the node that is being searched for. It has a syntax like "ldname/ln.do....". + * @param fc + * the functional constraint of the requested model node. May be null for Logical Device and Logical Node + * references. + * @return the model node if it was found or null otherwise + */ + public ModelNode findModelNode(String objectReference, Fc fc) { + return findModelNode(new ObjectReference(objectReference), fc); + } + + /** + * Returns the subModelNode that is referenced by the given VariableDef. Return null in case the referenced + * ModelNode is not found. + * + * @param variableDef + * @return the subModelNode that is referenced by the given VariableDef + * @throws ServiceError + */ + FcModelNode getNodeFromVariableDef(VariableDefs.SEQUENCE variableDef) throws ServiceError { + + ObjectName objectName = variableDef.getVariableSpecification().getName(); + + if (objectName == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "name in objectName is not selected"); + } + + DomainSpecific domainSpecific = objectName.getDomainSpecific(); + + if (domainSpecific == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "domain_specific in name is not selected"); + } + + ModelNode modelNode = getChild(domainSpecific.getDomainID().toString()); + + if (modelNode == null) { + return null; + } + + String mmsItemId = domainSpecific.getItemID().toString(); + int index1 = mmsItemId.indexOf('$'); + + if (index1 == -1) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "invalid mms item id: " + domainSpecific.getItemID()); + } + + LogicalNode ln = (LogicalNode) modelNode.getChild(mmsItemId.substring(0, index1)); + + if (ln == null) { + return null; + } + + int index2 = mmsItemId.indexOf('$', index1 + 1); + + if (index2 == -1) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, "invalid mms item id"); + } + + Fc fc = Fc.fromString(mmsItemId.substring(index1 + 1, index2)); + + if (fc == null) { + throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT, + "unknown functional constraint: " + mmsItemId.substring(index1 + 1, index2)); + } + + index1 = index2; + + index2 = mmsItemId.indexOf('$', index1 + 1); + + if (index2 == -1) { + if (fc == Fc.RP) { + return ln.getUrcb(mmsItemId.substring(index1 + 1)); + } + if (fc == Fc.BR) { + return ln.getBrcb(mmsItemId.substring(index1 + 1)); + } + return (FcModelNode) ln.getChild(mmsItemId.substring(index1 + 1), fc); + } + + if (fc == Fc.RP) { + modelNode = ln.getUrcb(mmsItemId.substring(index1 + 1, index2)); + } + else if (fc == Fc.BR) { + modelNode = ln.getBrcb(mmsItemId.substring(index1 + 1, index2)); + } + else { + modelNode = ln.getChild(mmsItemId.substring(index1 + 1, index2), fc); + } + + index1 = index2; + index2 = mmsItemId.indexOf('$', index1 + 1); + while (index2 != -1) { + modelNode = modelNode.getChild(mmsItemId.substring(index1 + 1, index2)); + index1 = index2; + index2 = mmsItemId.indexOf('$', index1 + 1); + } + + modelNode = modelNode.getChild(mmsItemId.substring(index1 + 1)); + + if (variableDef.getAlternateAccess() == null) { + // no array is in this node path + return (FcModelNode) modelNode; + } + + AlternateAccessSelection altAccIt = variableDef.getAlternateAccess().getCHOICE().get(0).getUnnamed(); + + if (altAccIt.getSelectAlternateAccess() != null) { + // path to node below an array element + modelNode = ((Array) modelNode) + .getChild(altAccIt.getSelectAlternateAccess().getAccessSelection().getIndex().intValue()); + + String mmsSubArrayItemId = altAccIt.getSelectAlternateAccess() + .getAlternateAccess() + .getCHOICE() + .get(0) + .getUnnamed() + .getSelectAccess() + .getComponent() + .getBasic() + .toString(); + + index1 = -1; + index2 = mmsSubArrayItemId.indexOf('$'); + while (index2 != -1) { + modelNode = modelNode.getChild(mmsSubArrayItemId.substring(index1 + 1, index2)); + index1 = index2; + index2 = mmsItemId.indexOf('$', index1 + 1); + } + + return (FcModelNode) modelNode.getChild(mmsSubArrayItemId.substring(index1 + 1)); + } + else { + // path to an array element + return (FcModelNode) ((Array) modelNode).getChild(altAccIt.getSelectAccess().getIndex().intValue()); + } + + } +} diff --git a/src/main/java/org/openmuc/openiec61850/ServerSap.java b/src/main/java/org/openmuc/openiec61850/ServerSap.java new file mode 100644 index 0000000..cc33027 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ServerSap.java @@ -0,0 +1,419 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.io.IOException; +import java.io.InputStream; +import java.net.InetAddress; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Timer; + +import javax.net.ServerSocketFactory; + +import org.openmuc.josistack.AcseAssociation; +import org.openmuc.josistack.ServerAcseSap; + +/** + * The ServerSap class represents the IEC 61850 service access point for server applications. It + * corresponds to the AccessPoint defined in the ICD/SCL file. A server application that is to listen for client + * connections should first get an instance of ServerSap using the static function + * ServerSap.getSapsFromSclFile(). Next all the necessary configuration parameters can be set. Finally the + * startListening function is called to listen for client associations. Changing properties of a ServerSap + * after starting to listen is not recommended and has unknown effects. + */ +public final class ServerSap { + + static final int MINIMUM_MMS_PDU_SIZE = 64; + private static final int MAXIMUM_MMS_PDU_SIZE = 65000; + + private int proposedMaxMmsPduSize = 65000; + private int proposedMaxServOutstandingCalling = 5; + private int proposedMaxServOutstandingCalled = 5; + private int proposedDataStructureNestingLevel = 10; + byte[] servicesSupportedCalled = new byte[] { (byte) 0xee, 0x1c, 0, 0, 0x04, 0x08, 0, 0, 0x79, (byte) 0xef, 0x18 }; + byte[] cbbBitString = { (byte) (0xfb), 0x00 }; + private int maxAssociations = 100; + + ServerEventListener serverEventListener; + private ServerAcseSap acseSap; + + private final String name; + private int port = 102; + private int backlog = 0; + private InetAddress bindAddr = null; + private ServerSocketFactory serverSocketFactory = null; + + Timer timer; + + List associations = new ArrayList<>(); + boolean listening = false; + + final ServerModel serverModel; + + public static List getSapsFromSclFile(String sclFilePath) throws SclParseException { + SclParser sclParserObject = new SclParser(); + sclParserObject.parse(sclFilePath); + return sclParserObject.getServerSaps(); + } + + public static List getSapsFromSclFile(InputStream sclFileStream) throws SclParseException { + SclParser sclParserObject = new SclParser(); + sclParserObject.parse(sclFileStream); + return sclParserObject.getServerSaps(); + } + + /** + * Creates a ServerSap. + * + * @param port + * local port to listen on for new connections + * @param backlog + * The maximum queue length for incoming connection indications (a request to connect) is set to the + * backlog parameter. If a connection indication arrives when the queue is full, the connection is + * refused. Set to 0 or less for the default value. + * @param bindAddr + * local IP address to bind to, pass null to bind to all + * @param serverSocketFactory + * the factory class to generate the ServerSocket. Could be used to create SSLServerSockets. null = + * default + * + */ + ServerSap(int port, int backlog, InetAddress bindAddr, ServerModel serverModel, String name, + ServerSocketFactory serverSocketFactory) { + this.port = port; + this.backlog = backlog; + this.bindAddr = bindAddr; + this.serverSocketFactory = serverSocketFactory; + this.name = name; + this.serverModel = serverModel; + } + + /** + * Sets local port to listen on for new connections. + * + * @param port + * local port to listen on for new connections + */ + public void setPort(int port) { + this.port = port; + } + + public int getPort() { + return port; + } + + /** + * Sets the maximum queue length for incoming connection indications (a request to connect) is set to the backlog + * parameter. If a connection indication arrives when the queue is full, the connection is refused. Set to 0 or less + * for the default value. + * + * @param backlog + * the maximum queue length for incoming connections. + */ + public void setBacklog(int backlog) { + this.backlog = backlog; + } + + public int getBacklog() { + return backlog; + } + + /** + * Sets the local IP address to bind to, pass null to bind to all + * + * @param bindAddr + * the local IP address to bind to + */ + public void setBindAddress(InetAddress bindAddr) { + this.bindAddr = bindAddr; + } + + public InetAddress getBindAddress() { + return bindAddr; + } + + /** + * Returns the name of the ServerSap / AccessPoint as specified in the SCL file. + * + * @return the name. + */ + public String getName() { + return name; + } + + /** + * Sets the factory class to generate the ServerSocket. The ServerSocketFactory could be used to create + * SSLServerSockets. Set to null to use ServerSocketFactory.getDefault(). + * + * @param serverSocketFactory + * the factory class to generate the ServerSocket. + */ + public void setServerSocketFactory(ServerSocketFactory serverSocketFactory) { + this.serverSocketFactory = serverSocketFactory; + } + + /** + * Sets the maximum MMS PDU size in bytes that the server will support. If the client requires the use of a smaller + * maximum MMS PDU size, then the smaller size will be accepted by the server. The default size is 65000. + * + * @param size + * cannot be less than 64. The upper limit is 65000 so that segmentation at the lower transport layer is + * avoided. The Transport Layer's maximum PDU size is 65531. + */ + public void setMaxMmsPduSize(int size) { + if (size >= MINIMUM_MMS_PDU_SIZE && size <= MAXIMUM_MMS_PDU_SIZE) { + proposedMaxMmsPduSize = size; + } + else { + throw new IllegalArgumentException("maximum size is out of bound"); + } + } + + /** + * Gets the maximum MMS PDU size. + * + * @return the maximum MMS PDU size. + */ + public int getMaxMmsPduSize() { + return proposedMaxMmsPduSize; + } + + /** + * Set the maximum number of associations that are allowed in parallel by the server. + * + * @param maxAssociations + * the number of associations allowed (default is 100) + */ + public void setMaxAssociations(int maxAssociations) { + this.maxAssociations = maxAssociations; + } + + /** + * Sets the message fragment timeout. This is the timeout that the socket timeout is set to after the first byte of + * a message has been received. If such a timeout is thrown, the association/socket is closed. + * + * @param timeout + * the message fragment timeout in milliseconds. The default is 60000. + */ + public void setMessageFragmentTimeout(int timeout) { + acseSap.serverTSap.setMessageFragmentTimeout(timeout); + } + + /** + * Sets the ProposedMaxServOutstandingCalling parameter. The given parameter has no affect on the functionality of + * this server. + * + * @param maxCalling + * the ProposedMaxServOutstandingCalling parameter. The default is 5. + */ + public void setProposedMaxServOutstandingCalling(int maxCalling) { + proposedMaxServOutstandingCalling = maxCalling; + } + + /** + * Gets the ProposedMaxServOutstandingCalling parameter. + * + * @return the ProposedMaxServOutstandingCalling parameter. + */ + public int getProposedMaxServOutstandingCalling() { + return proposedMaxServOutstandingCalling; + } + + /** + * Sets the ProposedMaxServOutstandingCalled parameter.The given parameter has no affect on the functionality of + * this server. + * + * @param maxCalled + * the ProposedMaxServOutstandingCalled parameter. The default is 5. + */ + public void setProposedMaxServOutstandingCalled(int maxCalled) { + proposedMaxServOutstandingCalled = maxCalled; + } + + /** + * Gets the ProposedMaxServOutstandingCalled parameter. + * + * @return the ProposedMaxServOutstandingCalled parameter. + */ + public int getProposedMaxServOutstandingCalled() { + return proposedMaxServOutstandingCalled; + } + + /** + * Sets the ProposedDataStructureNestingLevel parameter. The given parameter has no affect on the functionality of + * this server.runServer + * + * @param nestingLevel + * the ProposedDataStructureNestingLevel parameter. The default is 10. + */ + public void setProposedDataStructureNestingLevel(int nestingLevel) { + proposedDataStructureNestingLevel = nestingLevel; + } + + /** + * Gets the ProposedDataStructureNestingLevel parameter. + * + * @return the ProposedDataStructureNestingLevel parameter. + */ + public int getProposedDataStructureNestingLevel() { + return proposedDataStructureNestingLevel; + } + + /** + * Sets the SevicesSupportedCalled parameter. The given parameter has no affect on the functionality of this server. + * + * @param services + * the ServicesSupportedCalled parameter + */ + public void setServicesSupportedCalled(byte[] services) { + if (services.length != 11) { + throw new IllegalArgumentException("The services parameter needs to be of lenth 11"); + } + servicesSupportedCalled = services; + } + + /** + * Gets the ServicesSupportedCalled parameter. + * + * @return the ServicesSupportedCalled parameter. + */ + public byte[] getServicesSupportedCalled() { + return servicesSupportedCalled; + } + + /** + * Creates a server socket waiting on the configured port for incoming association requests. + * + * @param serverEventListener + * the listener that is notified of incoming writes and when the server stopped listening for new + * connections. + * @throws IOException + * if an error occurs binding to the port. + */ + public void startListening(ServerEventListener serverEventListener) throws IOException { + timer = new Timer(); + if (serverSocketFactory == null) { + serverSocketFactory = ServerSocketFactory.getDefault(); + } + acseSap = new ServerAcseSap(port, backlog, bindAddr, new AcseListener(this), serverSocketFactory); + acseSap.serverTSap.setMaxConnections(maxAssociations); + this.serverEventListener = serverEventListener; + listening = true; + acseSap.startListening(); + } + + /** + * Stops listening for new connections and closes all existing connections/associations. + */ + public void stop() { + acseSap.stopListening(); + synchronized (associations) { + listening = false; + for (ServerAssociation association : associations) { + association.close(); + } + associations.clear(); + } + timer.cancel(); + timer.purge(); + } + + void connectionIndication(AcseAssociation acseAssociation, ByteBuffer psdu) { + + ServerAssociation association; + synchronized (associations) { + if (listening) { + association = new ServerAssociation(this); + associations.add(association); + } + else { + acseAssociation.close(); + return; + } + } + + try { + association.handleNewAssociation(acseAssociation, psdu); + } catch (Exception e) { + // Association closed because of an unexpected exception. + } + + association.close(); + synchronized (associations) { + associations.remove(association); + } + } + + void serverStoppedListeningIndication(IOException e) { + if (serverEventListener != null) { + serverEventListener.serverStoppedListening(this); + } + } + + public ServerModel getModelCopy() { + return serverModel.copy(); + } + + public void setValues(List bdas) { + synchronized (serverModel) { + for (BasicDataAttribute bda : bdas) { + // if (bda.getFunctionalConstraint() != FunctionalConstraint.ST) { + // logger.debug("fc:" + bda.getFunctionalConstraint()); + // throw new IllegalArgumentException( + // "One can only set values of BDAs with Functional Constraint ST(status)"); + // } + + BasicDataAttribute bdaMirror = bda.mirror; + + if (bdaMirror.dchg && bdaMirror.chgRcbs.size() != 0 && !bda.equals(bdaMirror)) { + bdaMirror.setValueFrom(bda); + synchronized (bdaMirror.chgRcbs) { + for (Urcb urcb : bdaMirror.chgRcbs) { + if (bdaMirror.dupd && urcb.getTrgOps().isDataUpdate()) { + urcb.report(bdaMirror, true, false, true); + } + else { + urcb.report(bdaMirror, true, false, false); + } + } + } + } + else if (bdaMirror.dupd && bdaMirror.dupdRcbs.size() != 0) { + bdaMirror.setValueFrom(bda); + synchronized (bdaMirror.dupdRcbs) { + for (Urcb urcb : bdaMirror.dupdRcbs) { + urcb.report(bdaMirror, false, false, true); + } + } + } + else if (bdaMirror.qchg && bdaMirror.chgRcbs.size() != 0 && !bda.equals(bdaMirror)) { + bdaMirror.setValueFrom(bda); + synchronized (bdaMirror.chgRcbs) { + for (Urcb urcb : bdaMirror.chgRcbs) { + urcb.report(bdaMirror, false, true, false); + } + } + } + else { + bdaMirror.setValueFrom(bda); + } + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/ServiceError.java b/src/main/java/org/openmuc/openiec61850/ServiceError.java new file mode 100644 index 0000000..3238b0f --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ServiceError.java @@ -0,0 +1,129 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public final class ServiceError extends Exception { + + public static final int NO_ERROR = 0; + public static final int INSTANCE_NOT_AVAILABLE = 1; + public static final int INSTANCE_IN_USE = 2; + public static final int ACCESS_VIOLATION = 3; + public static final int ACCESS_NOT_ALLOWED_IN_CURRENT_STATE = 4; + public static final int PARAMETER_VALUE_INAPPROPRIATE = 5; + public static final int PARAMETER_VALUE_INCONSISTENT = 6; + public static final int CLASS_NOT_SUPPORTED = 7; + public static final int INSTANCE_LOCKED_BY_OTHER_CLIENT = 8; + public static final int CONTROL_MUST_BE_SELECTED = 9; + public static final int TYPE_CONFLICT = 10; + public static final int FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT = 11; + public static final int FAILED_DUE_TO_SERVER_CONSTRAINT = 12; + public static final int APPLICATION_UNREACHABLE = 13; + public static final int CONNECTION_LOST = 14; + public static final int MEMORY_UNAVAILABLE = 15; + public static final int PROCESSOR_RESOURCE_UNAVAILABLE = 16; + public static final int FATAL = 20; + // added to handle data access errors mentioned in iec61850-8-1 + // public static final int DATA_ACCESS_ERROR = 21; + // added to report timeouts + public static final int TIMEOUT = 22; + public static final int UNKNOWN = 23; + + private static final long serialVersionUID = 4290107163231828564L; + + private static String getErrorName(int code) { + switch (code) { + case NO_ERROR: + return "NO_ERROR"; + case INSTANCE_NOT_AVAILABLE: + return "INSTANCE_NOT_AVAILABLE"; + case INSTANCE_IN_USE: + return "INSTANCE_IN_USE"; + case ACCESS_VIOLATION: + return "ACCESS_VIOLATION"; + case ACCESS_NOT_ALLOWED_IN_CURRENT_STATE: + return "ACCESS_NOT_ALLOWED_IN_CURRENT_STATE"; + case PARAMETER_VALUE_INAPPROPRIATE: + return "PARAMETER_VALUE_INAPPROPRIATE"; + case PARAMETER_VALUE_INCONSISTENT: + return "PARAMETER_VALUE_INCONSISTENT"; + case CLASS_NOT_SUPPORTED: + return "CLASS_NOT_SUPPORTED"; + case INSTANCE_LOCKED_BY_OTHER_CLIENT: + return "INSTANCE_LOCKED_BY_OTHER_CLIENT"; + case CONTROL_MUST_BE_SELECTED: + return "CONTROL_MUST_BE_SELECTED"; + case TYPE_CONFLICT: + return "TYPE_CONFLICT"; + case FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT: + return "FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT"; + case FAILED_DUE_TO_SERVER_CONSTRAINT: + return "FAILED_DUE_TO_SERVER_CONSTRAINT"; + case APPLICATION_UNREACHABLE: + return "APPLICATION_UNREACHABLE"; + case CONNECTION_LOST: + return "CONNECTION_LOST"; + case MEMORY_UNAVAILABLE: + return "MEMORY_UNAVAILABLE"; + case PROCESSOR_RESOURCE_UNAVAILABLE: + return "PROCESSOR_RESOURCE_UNAVAILABLE"; + case FATAL: + return "FATAL"; + case TIMEOUT: + return "TIMEOUT_ERROR"; + case UNKNOWN: + return "UNKNOWN"; + default: + return "Unknown ServiceError code"; + } + } + + private final int errorCode; + + public ServiceError(int errorCode) { + super("Error code=" + errorCode); + this.errorCode = errorCode; + } + + public ServiceError(int errorCode, String s) { + super(s); + this.errorCode = errorCode; + } + + public ServiceError(int errorCode, Throwable cause) { + super(cause); + this.errorCode = errorCode; + } + + public ServiceError(int errorCode, String s, Throwable cause) { + super(s, cause); + this.errorCode = errorCode; + } + + public int getErrorCode() { + return errorCode; + } + + @Override + public String toString() { + String message = getLocalizedMessage(); + String result = getClass().getName() + ": " + getErrorName(errorCode) + "(" + errorCode + ")"; + if (message != null) { + result += ": " + message; + } + return result; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/ServiceSupport.java b/src/main/java/org/openmuc/openiec61850/ServiceSupport.java new file mode 100644 index 0000000..5120cce --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/ServiceSupport.java @@ -0,0 +1,31 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +public final class ServiceSupport { + + public boolean dynAssociation = false; + public boolean getDirectory = false; + public boolean getDataObjectDefinition = false; + public boolean getDataSetValue = false; + public boolean dataSetDirectory = false; + public boolean readWrite = false; + public boolean getCBValues = false; + public boolean goose = false; + public int gooseMax = 0; + +} diff --git a/src/main/java/org/openmuc/openiec61850/Urcb.java b/src/main/java/org/openmuc/openiec61850/Urcb.java new file mode 100644 index 0000000..6b20fd1 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/Urcb.java @@ -0,0 +1,397 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.openmuc.jasn1.ber.types.BerBitString; +import org.openmuc.openiec61850.internal.mms.asn1.AccessResult; +import org.openmuc.openiec61850.internal.mms.asn1.Data; +import org.openmuc.openiec61850.internal.mms.asn1.Identifier; +import org.openmuc.openiec61850.internal.mms.asn1.InformationReport; +import org.openmuc.openiec61850.internal.mms.asn1.MMSpdu; +import org.openmuc.openiec61850.internal.mms.asn1.ObjectName; +import org.openmuc.openiec61850.internal.mms.asn1.UnconfirmedPDU; +import org.openmuc.openiec61850.internal.mms.asn1.UnconfirmedService; +import org.openmuc.openiec61850.internal.mms.asn1.VariableAccessSpecification; + +public class Urcb extends Rcb { + + ServerAssociation reserved = null; + boolean enabled = false; + private Timer integrityTimer; + // private ScheduledFuture integrityFuture = null; + private ScheduledFuture bufTmFuture = null; + final HashMap membersToBeReported = new LinkedHashMap<>(); + + public Urcb(ObjectReference objectReference, List children) { + super(objectReference, Fc.RP, children); + } + + /** + * Reserve URCB - The attribute Resv (if set to TRUE) shall indicate that the URCB is currently exclusively reserved + * for the client that has set the value to TRUE. Other clients shall not be allowed to set any attribute of that + * URCB. + * + * @return the Resv child + */ + public BdaBoolean getResv() { + return (BdaBoolean) children.get("Resv"); + } + + void enable() { + + for (FcModelNode dataSetMember : dataSet) { + for (BasicDataAttribute bda : dataSetMember.getBasicDataAttributes()) { + if (bda.dchg) { + if (getTrgOps().isDataChange()) { + synchronized (bda.chgRcbs) { + bda.chgRcbs.add(this); + } + } + } + else if (bda.qchg) { + if (getTrgOps().isQualityChange()) { + synchronized (bda.chgRcbs) { + bda.chgRcbs.add(this); + } + } + } + if (bda.dupd) { + if (getTrgOps().isDataUpdate()) { + synchronized (bda.dupdRcbs) { + bda.dupdRcbs.add(this); + } + } + } + } + } + + if (getTrgOps().isIntegrity() && !(getIntgPd().getValue() < 10l)) { + integrityTimer = new Timer(); + + integrityTimer.schedule(new TimerTask() { + // integrityFuture = reserved.executor.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + synchronized (Urcb.this) { + if (!enabled) { + return; + } + reserved.sendAnMmsPdu(getMmsReport(true, false)); + } + } + // }, getIntgPd().getValue(), getIntgPd().getValue(), TimeUnit.MILLISECONDS); + }, getIntgPd().getValue(), getIntgPd().getValue()); + + } + + enabled = true; + + } + + void disable() { + + for (FcModelNode dataSetMember : dataSet) { + for (BasicDataAttribute bda : dataSetMember.getBasicDataAttributes()) { + if (bda.dchg) { + if (getTrgOps().isDataChange()) { + synchronized (bda.chgRcbs) { + bda.chgRcbs.remove(this); + } + } + } + else if (bda.qchg) { + if (getTrgOps().isQualityChange()) { + synchronized (bda.chgRcbs) { + bda.chgRcbs.remove(this); + } + } + } + if (bda.dupd) { + if (getTrgOps().isDataUpdate()) { + synchronized (bda.dupdRcbs) { + bda.dupdRcbs.remove(this); + } + } + } + } + } + + // if (integrityFuture != null) { + // integrityFuture.cancel(false); + // } + if (integrityTimer != null) { + integrityTimer.cancel(); + } + + enabled = false; + + } + + void generalInterrogation() { + reserved.executor.execute(new Runnable() { + @Override + public void run() { + synchronized (Urcb.this) { + if (!enabled) { + return; + } + reserved.sendAnMmsPdu(getMmsReport(false, true)); + } + } + }); + } + + private MMSpdu getMmsReport(boolean integrity, boolean gi) { + + InformationReport.ListOfAccessResult listOfAccessResult = new InformationReport.ListOfAccessResult(); + + List accessResults = listOfAccessResult.getAccessResult(); + + AccessResult accessResult = new AccessResult(); + accessResult.setSuccess(getRptId().getMmsDataObj()); + accessResults.add(accessResult); + + accessResult = new AccessResult(); + accessResult.setSuccess(getOptFlds().getMmsDataObj()); + accessResults.add(accessResult); + + if (getOptFlds().isSequenceNumber()) { + accessResult = new AccessResult(); + accessResult.setSuccess(getSqNum().getMmsDataObj()); + accessResults.add(accessResult); + } + getSqNum().setValue((short) (getSqNum().getValue() + 1)); + + if (getOptFlds().isReportTimestamp()) { + BdaEntryTime entryTime = new BdaEntryTime(null, null, null, false, false); + entryTime.setTimestamp(System.currentTimeMillis()); + + accessResult = new AccessResult(); + accessResult.setSuccess(entryTime.getMmsDataObj()); + accessResults.add(accessResult); + } + + if (getOptFlds().isDataSetName()) { + accessResult = new AccessResult(); + accessResult.setSuccess(getDatSet().getMmsDataObj()); + accessResults.add(accessResult); + } + + if (getOptFlds().isConfigRevision()) { + accessResult = new AccessResult(); + accessResult.setSuccess(getConfRev().getMmsDataObj()); + accessResults.add(accessResult); + } + + // segmentation not supported + + List dataSetMembers = dataSet.getMembers(); + int dataSetSize = dataSetMembers.size(); + + // inclusion bitstring + byte[] inclusionStringArray = new byte[(dataSetSize - 1) / 8 + 1]; + + if (integrity || gi) { + + for (int i = 0; i < dataSetSize; i++) { + inclusionStringArray[i / 8] |= 1 << (7 - i % 8); + } + BerBitString inclusionString = new BerBitString(inclusionStringArray, dataSetSize); + + Data data = new Data(); + data.setBitString(inclusionString); + accessResult = new AccessResult(); + accessResult.setSuccess(data); + accessResults.add(accessResult); + + // data reference sending not supported for now + + for (FcModelNode dataSetMember : dataSetMembers) { + accessResult = new AccessResult(); + accessResult.setSuccess(dataSetMember.getMmsDataObj()); + accessResults.add(accessResult); + } + + BdaReasonForInclusion reasonForInclusion = new BdaReasonForInclusion(null); + if (integrity) { + reasonForInclusion.setIntegrity(true); + } + else { + reasonForInclusion.setGeneralInterrogation(true); + } + + if (getOptFlds().isReasonForInclusion()) { + for (int i = 0; i < dataSetMembers.size(); i++) { + accessResult = new AccessResult(); + accessResult.setSuccess(reasonForInclusion.getMmsDataObj()); + accessResults.add(accessResult); + } + } + + } + else { + + int index = 0; + for (FcModelNode dataSetMember : dataSet) { + if (membersToBeReported.get(dataSetMember) != null) { + inclusionStringArray[index / 8] |= 1 << (7 - index % 8); + } + index++; + } + BerBitString inclusionString = new BerBitString(inclusionStringArray, dataSetSize); + + Data data = new Data(); + data.setBitString(inclusionString); + accessResult = new AccessResult(); + accessResult.setSuccess(data); + accessResults.add(accessResult); + + // data reference sending not supported for now + + for (FcModelNode dataSetMember : dataSetMembers) { + if (membersToBeReported.get(dataSetMember) != null) { + accessResult = new AccessResult(); + accessResult.setSuccess(dataSetMember.getMmsDataObj()); + accessResults.add(accessResult); + } + } + + if (getOptFlds().isReasonForInclusion()) { + for (FcModelNode dataSetMember : dataSetMembers) { + BdaReasonForInclusion reasonForInclusion = membersToBeReported.get(dataSetMember); + if (reasonForInclusion != null) { + accessResult = new AccessResult(); + accessResult.setSuccess(reasonForInclusion.getMmsDataObj()); + accessResults.add(accessResult); + } + } + } + + membersToBeReported.clear(); + bufTmFuture = null; + + } + + ObjectName objectName = new ObjectName(); + objectName.setVmdSpecific(new Identifier("RPT".getBytes())); + + VariableAccessSpecification varAccSpec = new VariableAccessSpecification(); + varAccSpec.setVariableListName(objectName); + // null, + // new ObjectName(new Identifier("RPT".getBytes()), null, null)); + + InformationReport infoReport = new InformationReport(); + infoReport.setVariableAccessSpecification(varAccSpec); + infoReport.setListOfAccessResult(listOfAccessResult); + // varAccSpec, + // new InformationReport.ListOfAccessResult(listOfAccessResult)); + + UnconfirmedService unconfirmedService = new UnconfirmedService(); + unconfirmedService.setInformationReport(infoReport); + + UnconfirmedPDU unconfirmedPDU = new UnconfirmedPDU(); + unconfirmedPDU.setService(unconfirmedService); + + MMSpdu mmsPdu = new MMSpdu(); + mmsPdu.setUnconfirmedPDU(unconfirmedPDU); + + return mmsPdu; + } + + @Override + public FcDataObject copy() { + List childCopies = new ArrayList<>(children.size()); + for (ModelNode childNode : children.values()) { + childCopies.add((FcModelNode) childNode.copy()); + } + Urcb urcb = new Urcb(objectReference, childCopies); + urcb.dataSet = dataSet; + return urcb; + } + + void report(BasicDataAttribute bda, boolean dchg, boolean qchg, boolean dupd) { + + synchronized (this) { + + if (!enabled) { + return; + } + + FcModelNode memberFound = null; + FcModelNode fcModelNode = bda; + while (memberFound == null) { + for (FcModelNode member : dataSet) { + if (member == fcModelNode) { + memberFound = fcModelNode; + break; + } + } + if (memberFound != null) { + break; + } + if (!(fcModelNode.parent instanceof FcModelNode)) { + // Unable to report Basic Data Attribute because it is not part of the referenced data set + return; + } + fcModelNode = (FcModelNode) fcModelNode.parent; + } + + BdaReasonForInclusion reasonForInclusion = membersToBeReported.get(fcModelNode); + if (reasonForInclusion == null) { + reasonForInclusion = new BdaReasonForInclusion(null); + membersToBeReported.put(fcModelNode, reasonForInclusion); + } + + if (dchg) { + reasonForInclusion.setDataChange(true); + } + if (dupd) { + reasonForInclusion.setDataUpdate(true); + } + else if (qchg) { + reasonForInclusion.setQualityChange(true); + } + + // if bufTmFuture is not null then it is already scheduled and will send the combined report + if (bufTmFuture == null) { + bufTmFuture = reserved.executor.schedule(new Runnable() { + @Override + public void run() { + synchronized (Urcb.this) { + if (!enabled) { + return; + } + reserved.sendAnMmsPdu(getMmsReport(false, false)); + } + } + }, getBufTm().getValue(), TimeUnit.MILLISECONDS); + } + + } + + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/app/ConsoleClient.java b/src/main/java/org/openmuc/openiec61850/app/ConsoleClient.java new file mode 100644 index 0000000..6e713b7 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/app/ConsoleClient.java @@ -0,0 +1,276 @@ +package org.openmuc.openiec61850.app; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.List; + +import org.openmuc.openiec61850.ClientAssociation; +import org.openmuc.openiec61850.ClientEventListener; +import org.openmuc.openiec61850.ClientSap; +import org.openmuc.openiec61850.Fc; +import org.openmuc.openiec61850.FcModelNode; +import org.openmuc.openiec61850.ModelNode; +import org.openmuc.openiec61850.Report; +import org.openmuc.openiec61850.SclParseException; +import org.openmuc.openiec61850.ServerModel; +import org.openmuc.openiec61850.ServiceError; +import org.openmuc.openiec61850.internal.cli.Action; +import org.openmuc.openiec61850.internal.cli.ActionException; +import org.openmuc.openiec61850.internal.cli.ActionListener; +import org.openmuc.openiec61850.internal.cli.ActionProcessor; +import org.openmuc.openiec61850.internal.cli.CliParameter; +import org.openmuc.openiec61850.internal.cli.CliParameterBuilder; +import org.openmuc.openiec61850.internal.cli.CliParseException; +import org.openmuc.openiec61850.internal.cli.CliParser; +import org.openmuc.openiec61850.internal.cli.IntCliParameter; +import org.openmuc.openiec61850.internal.cli.StringCliParameter; + +/** + * + * @author Stefan Feuerhahn + * + */ +public class ConsoleClient { + + private static final String RETRIEVE_MODEL_KEY = "m"; + private static final String RETRIEVE_MODEL_KEY_DESCRIPTION = "retrieve model from server"; + private static final String READ_MODEL_FROM_FILE_KEY = "s"; + private static final String READ_MODEL_FROM_FILE_KEY_DESCRIPTION = "read model from file"; + private static final String GET_DATA_VALUES_KEY = "r"; + private static final String GET_DATA_VALUES_KEY_DESCRIPTION = "GetDataValues request"; + + private static final StringCliParameter hostParam = new CliParameterBuilder("-h") + .setDescription("The IP/domain address of the server you want to access.") + .setMandatory() + .buildStringParameter("host"); + private static final IntCliParameter portParam = new CliParameterBuilder("-p") + .setDescription("The port to connect to.").buildIntParameter("port", 102); + + private static volatile ClientAssociation association; + private static ServerModel serverModel; + private static final ActionProcessor actionProcessor = new ActionProcessor(new ActionExecutor()); + + private static class EventListener implements ClientEventListener { + + @Override + public void newReport(Report report) { + System.out.println("Received report: " + report); + } + + @Override + public void associationClosed(IOException e) { + System.out.print("Received connection closed signal. Reason: "); + if (!e.getMessage().isEmpty()) { + System.out.println(e.getMessage()); + } + else { + System.out.println("unknown"); + } + actionProcessor.close(); + } + } + + private static class ActionExecutor implements ActionListener { + + @Override + public void actionCalled(String actionKey) throws ActionException { + try { + switch (actionKey) { + case RETRIEVE_MODEL_KEY: + System.out.println("** Retrieving model."); + + try { + serverModel = association.retrieveModel(); + } catch (ServiceError e) { + System.out.println("Service error: " + e.getMessage()); + return; + } catch (IOException e) { + System.out.println("Fatal error: " + e.getMessage()); + return; + } + + System.out.println("successfully read model"); + System.out.println(serverModel); + + break; + case READ_MODEL_FROM_FILE_KEY: + System.out.println("** Reading model from file."); + + System.out.println("Enter the name of the SCL file: "); + String modelFileName = actionProcessor.getReader().readLine(); + + try { + serverModel = association.getModelFromSclFile(modelFileName); + } catch (SclParseException e1) { + System.out.println("Error parsing SCL file: " + e1.getMessage()); + return; + } + + System.out.println("successfully read model"); + System.out.println(serverModel); + + break; + case GET_DATA_VALUES_KEY: + + System.out.println("** Sending GetDataValues request."); + + if (serverModel == null) { + System.out.println("You have to retrieve the model before reading data."); + return; + } + + System.out.println("Enter reference to read (e.g. myld/MYLN0.do.da.bda): "); + String reference = actionProcessor.getReader().readLine(); + System.out.println("Enter functional constraint of referenced node: "); + String fcString = actionProcessor.getReader().readLine(); + + Fc fc = Fc.fromString(fcString); + if (fc == null) { + System.out.println("Unknown functional constraint."); + return; + } + + ModelNode modelNode = serverModel.findModelNode(reference, Fc.fromString(fcString)); + if (modelNode == null) { + System.out.println( + "A model node with the given reference and functional constraint could not be found."); + return; + } + + if (!(modelNode instanceof FcModelNode)) { + System.out.println("The given model node is not a functionally constraint model node."); + return; + } + + FcModelNode fcModelNode = (FcModelNode) serverModel.findModelNode(reference, + Fc.fromString(fcString)); + + try { + association.getDataValues(fcModelNode); + } catch (ServiceError e) { + System.out.println("Service error: " + e.getMessage()); + return; + } catch (IOException e) { + System.out.println("Fatal error: " + e.getMessage()); + return; + } + + System.out.println("Successfully read data."); + System.out.println(fcModelNode); + break; + default: + break; + } + } catch (Exception e) { + throw new ActionException(e); + } + } + + @Override + public void quit() { + System.out.println("** Closing connection."); + association.close(); + return; + } + } + + public static void main(String[] args) { + + List cliParameters = new ArrayList<>(); + cliParameters.add(hostParam); + cliParameters.add(portParam); + + CliParser cliParser = new CliParser("openiec61850-console-client", + "A client application to access IEC 61850 MMS servers."); + cliParser.addParameters(cliParameters); + + try { + cliParser.parseArguments(args); + } catch (CliParseException e1) { + System.err.println("Error parsing command line parameters: " + e1.getMessage()); + System.out.println(cliParser.getUsageString()); + System.exit(1); + } + + InetAddress address; + try { + address = InetAddress.getByName(hostParam.getValue()); + } catch (UnknownHostException e) { + System.out.println("Unknown host: " + hostParam.getValue()); + return; + } + + ClientSap clientSap = new ClientSap(); + // alternatively you could use ClientSap(SocketFactory factory) to e.g. connect using SSL + + // optionally you can set some association parameters (but usually the default should work): + // clientSap.setTSelRemote(new byte[] { 0, 1 }); + // clientSap.setTSelLocal(new byte[] { 0, 0 }); + + try { + association = clientSap.associate(address, portParam.getValue(), null, new EventListener()); + } catch (IOException e) { + System.out.println("Unable to connect to remote host."); + return; + } + + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + association.close(); + } + }); + + System.out.println("successfully connected"); + + actionProcessor.addAction(new Action(RETRIEVE_MODEL_KEY, RETRIEVE_MODEL_KEY_DESCRIPTION)); + actionProcessor.addAction(new Action(GET_DATA_VALUES_KEY, GET_DATA_VALUES_KEY_DESCRIPTION)); + actionProcessor.addAction(new Action(READ_MODEL_FROM_FILE_KEY, READ_MODEL_FROM_FILE_KEY_DESCRIPTION)); + + actionProcessor.start(); + + // + // // example for writing a variable: + // FcModelNode modCtlModel = (FcModelNode) serverModel.findModelNode("ied1lDevice1/CSWI1.Mod.ctlModel", Fc.CF); + // association.setDataValues(modCtlModel); + // + // // example for enabling reporting + // Urcb urcb = serverModel.getUrcb("ied1lDevice1/LLN0.urcb1"); + // if (urcb == null) { + // System.out.println("ReportControlBlock not found"); + // } + // else { + // association.getRcbValues(urcb); + // System.out.println("urcb name: " + urcb.getName()); + // System.out.println("RptId: " + urcb.getRptId()); + // System.out.println("RptEna: " + urcb.getRptEna().getValue()); + // association.reserveUrcb(urcb); + // association.enableReporting(urcb); + // association.startGi(urcb); + // association.disableReporting(urcb); + // association.cancelUrcbReservation(urcb); + // } + // + // // example for reading a variable: + // FcModelNode totW = (FcModelNode) serverModel.findModelNode("ied1lDevice1/MMXU1.TotW", Fc.MX); + // BdaFloat32 totWmag = (BdaFloat32) totW.getChild("mag").getChild("f"); + // BdaTimestamp totWt = (BdaTimestamp) totW.getChild("t"); + // BdaQuality totWq = (BdaQuality) totW.getChild("q"); + // + // while (true) { + // association.getDataValues(totW); + // System.out.println("got totW: mag " + totWmag.getFloat() + ", time " + totWt.getDate() + ", quality " + // + totWq.getValidity()); + // + // try { + // Thread.sleep(5000); + // } catch (InterruptedException e) { + // } + // + // } + + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/app/ConsoleServer.java b/src/main/java/org/openmuc/openiec61850/app/ConsoleServer.java new file mode 100644 index 0000000..fb73c9a --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/app/ConsoleServer.java @@ -0,0 +1,247 @@ +package org.openmuc.openiec61850.app; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.openmuc.openiec61850.BasicDataAttribute; +import org.openmuc.openiec61850.BdaFloat32; +import org.openmuc.openiec61850.BdaFloat64; +import org.openmuc.openiec61850.BdaInt16; +import org.openmuc.openiec61850.BdaInt16U; +import org.openmuc.openiec61850.BdaInt32; +import org.openmuc.openiec61850.BdaInt32U; +import org.openmuc.openiec61850.BdaInt64; +import org.openmuc.openiec61850.BdaInt8; +import org.openmuc.openiec61850.BdaInt8U; +import org.openmuc.openiec61850.Fc; +import org.openmuc.openiec61850.ModelNode; +import org.openmuc.openiec61850.SclParseException; +import org.openmuc.openiec61850.ServerEventListener; +import org.openmuc.openiec61850.ServerModel; +import org.openmuc.openiec61850.ServerSap; +import org.openmuc.openiec61850.ServiceError; +import org.openmuc.openiec61850.internal.cli.Action; +import org.openmuc.openiec61850.internal.cli.ActionException; +import org.openmuc.openiec61850.internal.cli.ActionListener; +import org.openmuc.openiec61850.internal.cli.ActionProcessor; +import org.openmuc.openiec61850.internal.cli.CliParameter; +import org.openmuc.openiec61850.internal.cli.CliParameterBuilder; +import org.openmuc.openiec61850.internal.cli.CliParseException; +import org.openmuc.openiec61850.internal.cli.CliParser; +import org.openmuc.openiec61850.internal.cli.IntCliParameter; +import org.openmuc.openiec61850.internal.cli.StringCliParameter; + +/** + * + * @author Stefan Feuerhahn + * + */ +public class ConsoleServer { + + private static final String WRITE_VALUE_KEY = "w"; + private static final String WRITE_VALUE_KEY_DESCRIPTION = "write value to model node"; + + private static final String PRINT_SERVER_MODEL_KEY = "p"; + private static final String PRINT_SERVER_MODEL_KEY_DESCRIPTION = "print server's model"; + + private static final IntCliParameter portParam = new CliParameterBuilder("-p") + .setDescription("The port to listen on. On unix based systems you need root privilages for ports < 1000.") + .buildIntParameter("port", 102); + + private static final StringCliParameter modelFileParam = new CliParameterBuilder("-m") + .setDescription("The SCL file that contains the server's information model.") + .setMandatory() + .buildStringParameter("model-file"); + + private static ServerModel serverModel; + private static final ActionProcessor actionProcessor = new ActionProcessor(new ActionExecutor()); + + private static ServerSap serverSap = null; + + private static class EventListener implements ServerEventListener { + + @Override + public void serverStoppedListening(ServerSap serverSap) { + System.out.println("The SAP stopped listening"); + } + + @Override + public List write(List bdas) { + for (BasicDataAttribute bda : bdas) { + System.out.println("got a write request: " + bda); + } + return null; + } + } + + private static class ActionExecutor implements ActionListener { + + @Override + public void actionCalled(String actionKey) throws ActionException { + try { + switch (actionKey) { + case PRINT_SERVER_MODEL_KEY: + System.out.println("** Printing model."); + + System.out.println(serverModel); + + break; + case WRITE_VALUE_KEY: + System.out.println("** Reading model from file."); + + System.out.println("Enter reference to read (e.g. myld/MYLN0.do.da.bda): "); + String reference = actionProcessor.getReader().readLine(); + System.out.println("Enter functional constraint of referenced node: "); + String fcString = actionProcessor.getReader().readLine(); + + Fc fc = Fc.fromString(fcString); + if (fc == null) { + System.out.println("Unknown functional constraint."); + return; + } + + ModelNode modelNode = serverModel.findModelNode(reference, Fc.fromString(fcString)); + if (modelNode == null) { + System.out.println( + "A model node with the given reference and functional constraint could not be found."); + return; + } + + if (!(modelNode instanceof BasicDataAttribute)) { + System.out.println("The given model node is not a basic data attribute."); + return; + } + + BasicDataAttribute bda = (BasicDataAttribute) serverModel.findModelNode(reference, + Fc.fromString(fcString)); + + System.out.println("Enter value to write: "); + String valueString = actionProcessor.getReader().readLine(); + + try { + setBdaValue(bda, valueString); + } catch (Exception e) { + System.out.println( + "The console server does not support writing this type of basic data attribute."); + return; + } + + List bdas = new ArrayList<>(); + bdas.add(bda); + serverSap.setValues(bdas); + + System.out.println("Successfully wrote data."); + System.out.println(bda); + + break; + + default: + break; + } + } catch (Exception e) { + throw new ActionException(e); + } + } + + private void setBdaValue(BasicDataAttribute bda, String valueString) { + if (bda instanceof BdaFloat32) { + float value = Float.parseFloat(valueString); + ((BdaFloat32) bda).setFloat(value); + } + else if (bda instanceof BdaFloat64) { + double value = Float.parseFloat(valueString); + ((BdaFloat64) bda).setDouble(value); + } + else if (bda instanceof BdaInt8) { + byte value = Byte.parseByte(valueString); + ((BdaInt8) bda).setValue(value); + } + else if (bda instanceof BdaInt8U) { + short value = Short.parseShort(valueString); + ((BdaInt8U) bda).setValue(value); + } + else if (bda instanceof BdaInt16) { + short value = Short.parseShort(valueString); + ((BdaInt16) bda).setValue(value); + } + else if (bda instanceof BdaInt16U) { + int value = Integer.parseInt(valueString); + ((BdaInt16U) bda).setValue(value); + } + else if (bda instanceof BdaInt32) { + int value = Integer.parseInt(valueString); + ((BdaInt32) bda).setValue(value); + } + else if (bda instanceof BdaInt32U) { + long value = Long.parseLong(valueString); + ((BdaInt32U) bda).setValue(value); + } + else if (bda instanceof BdaInt64) { + long value = Long.parseLong(valueString); + ((BdaInt64) bda).setValue(value); + } + else { + throw new IllegalArgumentException(); + } + } + + @Override + public void quit() { + System.out.println("** Stopping server."); + serverSap.stop(); + return; + } + + } + + public static void main(String[] args) throws IOException { + + List cliParameters = new ArrayList<>(); + cliParameters.add(modelFileParam); + cliParameters.add(portParam); + + CliParser cliParser = new CliParser("openiec61850-console-server", "An IEC 61850 MMS console server."); + cliParser.addParameters(cliParameters); + + try { + cliParser.parseArguments(args); + } catch (CliParseException e1) { + System.err.println("Error parsing command line parameters: " + e1.getMessage()); + System.out.println(cliParser.getUsageString()); + System.exit(1); + } + + List serverSaps = null; + try { + serverSaps = ServerSap.getSapsFromSclFile(modelFileParam.getValue()); + } catch (SclParseException e) { + System.out.println("Error parsing SCL/ICD file: " + e.getMessage()); + return; + } + + serverSap = serverSaps.get(0); + serverSap.setPort(portParam.getValue()); + + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + if (serverSap != null) { + serverSap.stop(); + } + System.out.println("Server was stopped."); + } + }); + + serverModel = serverSap.getModelCopy(); + + serverSap.startListening(new EventListener()); + + actionProcessor.addAction(new Action(PRINT_SERVER_MODEL_KEY, PRINT_SERVER_MODEL_KEY_DESCRIPTION)); + actionProcessor.addAction(new Action(WRITE_VALUE_KEY, WRITE_VALUE_KEY_DESCRIPTION)); + + actionProcessor.start(); + + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/BasicDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/BasicDataBind.java new file mode 100644 index 0000000..ef61561 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/BasicDataBind.java @@ -0,0 +1,70 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui; + +import javax.swing.JComponent; +import javax.swing.JLabel; + +import org.openmuc.openiec61850.BasicDataAttribute; +import org.openmuc.openiec61850.BdaType; + +public abstract class BasicDataBind { + protected final E data; + + private JComponent valueField; + + public BasicDataBind(E data, BdaType type) { + if (data.getBasicType() != type) { + throw new IllegalArgumentException(data.getName() + " is no " + type); + } + this.data = data; + } + + public JLabel getNameLabel() { + return new JLabel(data.getName()); + } + + public JComponent getValueField() { + if (valueField == null) { + valueField = init(); + } + + return valueField; + } + + public void reset() { + if (valueField == null) { + valueField = init(); + } + + resetImpl(); + } + + public void write() { + if (valueField == null) { + valueField = init(); + } + + writeImpl(); + } + + protected abstract JComponent init(); + + protected abstract void resetImpl(); + + protected abstract void writeImpl(); +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/ClientGui.java b/src/main/java/org/openmuc/openiec61850/clientgui/ClientGui.java new file mode 100644 index 0000000..397fd77 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/ClientGui.java @@ -0,0 +1,445 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Properties; + +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JTextField; +import javax.swing.JTree; +import javax.swing.ToolTipManager; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; + +import org.openmuc.openiec61850.ClientAssociation; +import org.openmuc.openiec61850.ClientSap; +import org.openmuc.openiec61850.ServerModel; +import org.openmuc.openiec61850.ServiceError; +import org.openmuc.openiec61850.clientgui.util.Counter; + +public class ClientGui extends JFrame implements ActionListener, TreeSelectionListener { + + private static final String ADDRESS_KEY = "serverAddress"; + private static final String PORT_KEY = "serverPort"; + private static final String TSEL_LOCAL_KEY = "tselLocal"; + private static final String TSEL_REMOTE_KEY = "tselRemote"; + private static final String LASTCONNECTION_FILE = "lastconnection.properties"; + + private static final long serialVersionUID = -1938913902977758367L; + + private final JTextField ipTextField = new JTextField("127.0.0.1"); + private final JTextField portTextField = new JTextField("10002"); + private final JTree tree = new JTree(new DefaultMutableTreeNode("No server connected")); + private final JPanel detailsPanel = new JPanel(); + private final GridBagLayout detailsLayout = new GridBagLayout(); + + private final SettingsFrame settingsFrame = new SettingsFrame(); + + private ClientAssociation association; + + private DataTreeNode selectedNode; + + public ClientGui() { + super("OpenIEC61850 Client GUI"); + + Properties lastConnection = new Properties(); + + InputStream in = null; + try { + in = new FileInputStream(LASTCONNECTION_FILE); + lastConnection.load(in); + + ipTextField.setText(lastConnection.getProperty(ADDRESS_KEY)); + portTextField.setText(lastConnection.getProperty(PORT_KEY)); + + String[] tselString = lastConnection.getProperty(TSEL_LOCAL_KEY).split(","); + byte[] tsel = new byte[] { (byte) Integer.parseInt(tselString[0]), (byte) Integer.parseInt(tselString[1]) }; + settingsFrame.setTselLocal(tsel); + + tselString = lastConnection.getProperty(TSEL_REMOTE_KEY).split(","); + tsel = new byte[] { (byte) Integer.parseInt(tselString[0]), (byte) Integer.parseInt(tselString[1]) }; + settingsFrame.setTselRemote(tsel); + } catch (Exception ex) { + // no lastconnection.properties file found, use default. + } finally { + try { + if (in != null) { + in.close(); + } + } catch (IOException e) { + e.printStackTrace(); + + } + } + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException e) { + System.out.println("Class not found: " + e.getMessage()); + } catch (InstantiationException e) { + System.out.println("Object not instantiated: " + e.getMessage()); + } catch (IllegalAccessException e) { + System.out.println("Illegal acces: " + e.getMessage()); + } catch (UnsupportedLookAndFeelException e) { + System.out.println("Unsupported LookAndFeel: " + e.getMessage()); + } + + GridBagLayout gbl = new GridBagLayout(); + setLayout(gbl); + + JPanel topPanel = new JPanel(); + topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.X_AXIS)); + + GridBagConstraints topPanelConstraint = new GridBagConstraints(); + topPanelConstraint.fill = GridBagConstraints.HORIZONTAL; + topPanelConstraint.gridwidth = GridBagConstraints.REMAINDER; + topPanelConstraint.gridx = 0; + topPanelConstraint.gridy = 0; + topPanelConstraint.insets = new Insets(5, 5, 5, 5); + topPanelConstraint.anchor = GridBagConstraints.NORTH; + gbl.setConstraints(topPanel, topPanelConstraint); + add(topPanel); + + JLabel label = new JLabel("IP: "); + topPanel.add(label); + topPanel.add(ipTextField); + topPanel.add(Box.createRigidArea(new Dimension(5, 0))); + + label = new JLabel("Port: "); + topPanel.add(label); + topPanel.add(portTextField); + topPanel.add(Box.createRigidArea(new Dimension(5, 0))); + + JButton newServerButton = new JButton("Connect to Server"); + newServerButton.addActionListener(this); + newServerButton.setActionCommand("Connect"); + topPanel.add(newServerButton); + topPanel.add(Box.createRigidArea(new Dimension(5, 0))); + + JButton settingsButton = new JButton("Settings"); + settingsButton.addActionListener(this); + settingsButton.setActionCommand("Settings"); + topPanel.add(settingsButton); + + ToolTipManager.sharedInstance().registerComponent(tree); + + tree.setCellRenderer(new DataObjectTreeCellRenderer()); + tree.setMinimumSize(new Dimension(100, 0)); + tree.addTreeSelectionListener(this); + JScrollPane treeScrollPane = new JScrollPane(tree); + treeScrollPane.setMinimumSize(new Dimension(100, 0)); + treeScrollPane.setVisible(true); + + GridBagConstraints treeScrollPaneConstraint = new GridBagConstraints(); + treeScrollPaneConstraint.fill = GridBagConstraints.BOTH; + treeScrollPaneConstraint.gridx = 0; + treeScrollPaneConstraint.gridy = 1; + treeScrollPaneConstraint.weightx = 0.2; + treeScrollPaneConstraint.weighty = 1; + treeScrollPaneConstraint.insets = new Insets(5, 5, 5, 5); + gbl.setConstraints(treeScrollPane, treeScrollPaneConstraint); + add(treeScrollPane); + + detailsPanel.setLayout(detailsLayout); + detailsPanel.setAlignmentY(TOP_ALIGNMENT); + JScrollPane detailsScrollPane = new JScrollPane(detailsPanel); + detailsPanel.setMaximumSize(detailsScrollPane.getSize()); + detailsScrollPane.setMinimumSize(new Dimension(0, 0)); + detailsScrollPane.setPreferredSize(new Dimension(200, 0)); + detailsScrollPane.setVisible(true); + GridBagConstraints detailsScrollPaneConstraint = new GridBagConstraints(); + detailsScrollPaneConstraint.fill = GridBagConstraints.BOTH; + detailsScrollPaneConstraint.gridx = 1; + detailsScrollPaneConstraint.gridy = 1; + detailsScrollPaneConstraint.weightx = 0.8; + detailsScrollPaneConstraint.weighty = 1; + detailsScrollPaneConstraint.insets = new Insets(5, 5, 5, 5); + gbl.setConstraints(detailsScrollPane, detailsScrollPaneConstraint); + add(detailsScrollPane); + + // Display the window. + setSize(700, 500); + setMinimumSize(new Dimension(420, 0)); + setVisible(true); + } + + public static void main(String[] args) { + ClientGui clientGui = new ClientGui(); + clientGui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + clientGui.setVisible(true); + } + + @Override + public void actionPerformed(ActionEvent arg0) { + if ("connect".equalsIgnoreCase(arg0.getActionCommand())) { + connect(); + } + else if ("reload".equalsIgnoreCase(arg0.getActionCommand())) { + reload(); + } + else if ("write".equalsIgnoreCase(arg0.getActionCommand())) { + write(); + } + else if ("settings".equalsIgnoreCase(arg0.getActionCommand())) { + settingsFrame.setVisible(true); + } + } + + @Override + public void valueChanged(TreeSelectionEvent e) { + detailsPanel.removeAll(); + detailsPanel.repaint(); + if (e.getNewLeadSelectionPath() != null) { + selectedNode = (DataTreeNode) e.getNewLeadSelectionPath().getLastPathComponent(); + if (selectedNode.readable()) { + showDataDetails(selectedNode, new Counter()); + + JPanel filler = new JPanel(); + GridBagConstraints gbc = new GridBagConstraints(); + gbc.fill = GridBagConstraints.BOTH; + gbc.gridx = 0; + gbc.gridy = GridBagConstraints.RELATIVE; + gbc.gridwidth = 3; + gbc.gridheight = 1; + gbc.weightx = 0; + gbc.weighty = 1; + detailsLayout.setConstraints(filler, gbc); + detailsPanel.add(filler); + + JButton button = new JButton("Reload values"); + button.addActionListener(this); + button.setActionCommand("reload"); + gbc = new GridBagConstraints(); + gbc.fill = GridBagConstraints.NONE; + gbc.gridx = 0; + gbc.gridy = GridBagConstraints.RELATIVE; + gbc.gridwidth = 2; + gbc.gridheight = 1; + gbc.weightx = 0; + gbc.weighty = 0; + gbc.anchor = GridBagConstraints.SOUTHWEST; + gbc.insets = new Insets(0, 5, 5, 0); + detailsLayout.setConstraints(button, gbc); + detailsPanel.add(button); + + if (selectedNode.writable()) { + button = new JButton("Write values"); + button.addActionListener(this); + button.setActionCommand("write"); + gbc = new GridBagConstraints(); + gbc.fill = GridBagConstraints.NONE; + gbc.gridx = 2; + gbc.gridy = GridBagConstraints.RELATIVE; + gbc.gridwidth = 1; + gbc.gridheight = 1; + gbc.weightx = 0; + gbc.weighty = 0; + gbc.anchor = GridBagConstraints.SOUTHEAST; + gbc.insets = new Insets(0, 0, 5, 5); + detailsLayout.setConstraints(button, gbc); + detailsPanel.add(button); + } + } + } + else { + selectedNode = null; + } + + validate(); + } + + private void connect() { + ClientSap clientSap = new ClientSap(); + + InetAddress address = null; + try { + address = InetAddress.getByName(ipTextField.getText()); + } catch (UnknownHostException e1) { + e1.printStackTrace(); + return; + } + + int remotePort = 10002; + try { + remotePort = Integer.parseInt(portTextField.getText()); + if (remotePort < 1 || remotePort > 0xFFFF) { + throw new NumberFormatException("port must be in range [1, 65535]"); + } + } catch (NumberFormatException e) { + e.printStackTrace(); + return; + } + + clientSap.setTSelLocal(settingsFrame.getTselLocal()); + clientSap.setTSelRemote(settingsFrame.getTselRemote()); + + try { + association = clientSap.associate(address, remotePort, null, null); + } catch (IOException e) { + System.out.println("Error connecting to server: " + e.getMessage()); + return; + } + + ServerModel serverModel; + try { + serverModel = association.retrieveModel(); + association.getAllDataValues(); + } catch (ServiceError e) { + System.out.println("Service Error requesting model." + e.getMessage()); + association.close(); + return; + } catch (IOException e) { + System.out.println("Fatal IOException requesting model." + e.getMessage()); + return; + } + + ServerModelParser parser = new ServerModelParser(serverModel); + tree.setModel(new DefaultTreeModel(parser.getModelTree())); + + Properties lastConnectSettings = new Properties(); + FileOutputStream out = null; + try { + lastConnectSettings.setProperty(ADDRESS_KEY, ipTextField.getText()); + lastConnectSettings.setProperty(PORT_KEY, portTextField.getText()); + byte[] tsel = settingsFrame.getTselLocal(); + lastConnectSettings.setProperty(TSEL_LOCAL_KEY, tsel[0] + "," + tsel[1]); + tsel = settingsFrame.getTselRemote(); + lastConnectSettings.setProperty(TSEL_REMOTE_KEY, tsel[0] + "," + tsel[1]); + + out = new FileOutputStream(LASTCONNECTION_FILE); + lastConnectSettings.store(out, null); + } catch (IOException ex) { + System.out.println("Writing properties file failed. Reason: " + ex.getMessage()); + } finally { + try { + if (out != null) { + out.close(); + } + } catch (IOException e) { + } + } + + validate(); + } + + private void reload() { + if (selectedNode.readable()) { + try { + selectedNode.reset(association); + } catch (ServiceError e) { + System.out.println("ServiceError on reading" + e.getMessage()); + return; + } catch (IOException e) { + System.out.println("IOException on reading" + e.getMessage()); + return; + } + validate(); + } + } + + private void write() { + if (selectedNode.writable()) { + try { + selectedNode.writeValues(association); + } catch (ServiceError e) { + System.out.println("ServiceError on writing" + e.getMessage()); + return; + } catch (IOException e) { + System.out.println("IOException on writing" + e.getMessage()); + return; + } + validate(); + } + } + + private void showDataDetails(DataTreeNode node, Counter y) { + if (node.getData() != null) { + BasicDataBind data = node.getData(); + JLabel nameLabel = data.getNameLabel(); + nameLabel.setText(nameLabel.getText() + ": "); + addDetailsComponent(nameLabel, 0, y.getValue(), 1, 1, 0, 0); + addDetailsComponent(data.getValueField(), 1, y.getValue(), 2, 1, 1, 0); + y.increment(); + } + else { + for (int i = 0; i < node.getChildCount(); i++) { + y.increment(); + DataObjectTreeNode childNode = (DataObjectTreeNode) node.getChildAt(i); + showDataDetails(childNode, childNode.toString(), y); + } + } + } + + private void showDataDetails(DataTreeNode node, String pre, Counter y) { + if (node.getData() != null) { + BasicDataBind data = node.getData(); + JLabel nameLabel = data.getNameLabel(); + nameLabel.setText(pre + ": "); + addDetailsComponent(nameLabel, 0, y.getValue(), 1, 1, 0, 0); + addDetailsComponent(data.getValueField(), 1, y.getValue(), 2, 1, 1, 0); + y.increment(); + } + else { + for (int i = 0; i < node.getChildCount(); i++) { + y.increment(); + DataObjectTreeNode childNode = (DataObjectTreeNode) node.getChildAt(i); + showDataDetails(childNode, pre + "." + childNode.toString(), y); + detailsPanel.add(new JSeparator()); + addDetailsComponent(new JSeparator(), 0, y.getValue(), 3, 1, 1, 0); + } + } + } + + private void addDetailsComponent(Component c, int x, int y, int width, int height, double weightx, double weighty) { + GridBagConstraints gbc = new GridBagConstraints(); + gbc.fill = GridBagConstraints.HORIZONTAL; + gbc.gridx = x; + gbc.gridy = y; + gbc.gridwidth = width; + gbc.gridheight = height; + gbc.weightx = weightx; + gbc.weighty = weighty; + gbc.anchor = GridBagConstraints.NORTH; + gbc.insets = new Insets(3, 3, 3, 3); + detailsLayout.setConstraints(c, gbc); + detailsPanel.add(c); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/DataObjectTreeCellRenderer.java b/src/main/java/org/openmuc/openiec61850/clientgui/DataObjectTreeCellRenderer.java new file mode 100644 index 0000000..2138759 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/DataObjectTreeCellRenderer.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui; + +import java.awt.Component; + +import javax.swing.JTree; +import javax.swing.tree.DefaultTreeCellRenderer; + +import org.openmuc.openiec61850.BasicDataAttribute; +import org.openmuc.openiec61850.FcModelNode; + +public class DataObjectTreeCellRenderer extends DefaultTreeCellRenderer { + + private static final long serialVersionUID = 1682378972258556129L; + + @Override + public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, + int row, boolean hasFocus) { + super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); + + if (value instanceof DataObjectTreeNode) { + DataObjectTreeNode treeNode = (DataObjectTreeNode) value; + if (!leaf && treeNode.getNode() instanceof FcModelNode) { + setIcon(getLeafIcon()); + } + + if (treeNode.getNode() instanceof BasicDataAttribute) { + BasicDataAttribute attribute = (BasicDataAttribute) treeNode.getNode(); + String tooltip = attribute.getSAddr(); + setToolTipText(tooltip); + } + } + + return this; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/DataObjectTreeNode.java b/src/main/java/org/openmuc/openiec61850/clientgui/DataObjectTreeNode.java new file mode 100644 index 0000000..377f93c --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/DataObjectTreeNode.java @@ -0,0 +1,222 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui; + +import java.io.IOException; + +import javax.swing.tree.DefaultMutableTreeNode; + +import org.openmuc.openiec61850.BasicDataAttribute; +import org.openmuc.openiec61850.BdaBoolean; +import org.openmuc.openiec61850.BdaCheck; +import org.openmuc.openiec61850.BdaDoubleBitPos; +import org.openmuc.openiec61850.BdaEntryTime; +import org.openmuc.openiec61850.BdaFloat32; +import org.openmuc.openiec61850.BdaFloat64; +import org.openmuc.openiec61850.BdaInt16; +import org.openmuc.openiec61850.BdaInt16U; +import org.openmuc.openiec61850.BdaInt32; +import org.openmuc.openiec61850.BdaInt32U; +import org.openmuc.openiec61850.BdaInt64; +import org.openmuc.openiec61850.BdaInt8; +import org.openmuc.openiec61850.BdaInt8U; +import org.openmuc.openiec61850.BdaOctetString; +import org.openmuc.openiec61850.BdaOptFlds; +import org.openmuc.openiec61850.BdaQuality; +import org.openmuc.openiec61850.BdaReasonForInclusion; +import org.openmuc.openiec61850.BdaTapCommand; +import org.openmuc.openiec61850.BdaTimestamp; +import org.openmuc.openiec61850.BdaTriggerConditions; +import org.openmuc.openiec61850.BdaUnicodeString; +import org.openmuc.openiec61850.BdaVisibleString; +import org.openmuc.openiec61850.ClientAssociation; +import org.openmuc.openiec61850.Fc; +import org.openmuc.openiec61850.FcModelNode; +import org.openmuc.openiec61850.ModelNode; +import org.openmuc.openiec61850.ServiceError; +import org.openmuc.openiec61850.clientgui.databind.BooleanDataBind; +import org.openmuc.openiec61850.clientgui.databind.CheckDataBind; +import org.openmuc.openiec61850.clientgui.databind.DoubleBitPosDataBind; +import org.openmuc.openiec61850.clientgui.databind.EntryTimeDataBind; +import org.openmuc.openiec61850.clientgui.databind.Float32DataBind; +import org.openmuc.openiec61850.clientgui.databind.Float64DataBind; +import org.openmuc.openiec61850.clientgui.databind.Int16DataBind; +import org.openmuc.openiec61850.clientgui.databind.Int16UDataBind; +import org.openmuc.openiec61850.clientgui.databind.Int32DataBind; +import org.openmuc.openiec61850.clientgui.databind.Int32UDataBind; +import org.openmuc.openiec61850.clientgui.databind.Int64DataBind; +import org.openmuc.openiec61850.clientgui.databind.Int8DataBind; +import org.openmuc.openiec61850.clientgui.databind.Int8UDataBind; +import org.openmuc.openiec61850.clientgui.databind.OctetStringDataBind; +import org.openmuc.openiec61850.clientgui.databind.OptfldsDataBind; +import org.openmuc.openiec61850.clientgui.databind.QualityDataBind; +import org.openmuc.openiec61850.clientgui.databind.ReasonForInclusionDataBind; +import org.openmuc.openiec61850.clientgui.databind.TapCommandDataBind; +import org.openmuc.openiec61850.clientgui.databind.TimeStampDataBind; +import org.openmuc.openiec61850.clientgui.databind.TriggerConditionDataBind; +import org.openmuc.openiec61850.clientgui.databind.UnicodeStringDataBind; +import org.openmuc.openiec61850.clientgui.databind.VisibleStringDataBind; + +public class DataObjectTreeNode extends DefaultMutableTreeNode implements DataTreeNode { + + private static final long serialVersionUID = -3596243932937737877L; + + private final ModelNode node; + private final BasicDataBind data; + + public DataObjectTreeNode(String name, ModelNode node) { + super(name); + this.node = node; + if (node != null && node.getChildren() == null) { + // for (ModelNode child : node.getChildren()) { + // if (child instanceof BasicDataAttribute) { + // data.add(createDataBind((BasicDataAttribute) child)); + // } + // } + data = createDataBind((BasicDataAttribute) node); + } + else { + data = null; + } + } + + public ModelNode getNode() { + return node; + } + + /* + * (non-Javadoc) + * + * @see org.openmuc.openiec61850.clientgui.DataTreeNode#getData() + */ + @Override + public BasicDataBind getData() { + return data; + } + + /* + * (non-Javadoc) + * + * @see org.openmuc.openiec61850.clientgui.DataTreeNode#reset() + */ + @Override + public void reset(ClientAssociation association) throws ServiceError, IOException { + if (association != null) { + association.getDataValues((FcModelNode) node); + } + if (data != null) { + data.reset(); + } + else { + for (int i = 0; i < getChildCount(); i++) { + if (getChildAt(i) instanceof DataObjectTreeNode) { + DataTreeNode child = (DataTreeNode) getChildAt(i); + child.reset(null); + } + } + } + } + + /* + * (non-Javadoc) + * + * @see org.openmuc.openiec61850.clientgui.DataTreeNode#writeValues() + */ + @Override + public void writeValues(ClientAssociation association) throws ServiceError, IOException { + if (data != null) { + data.write(); + } + else { + for (int i = 0; i < getChildCount(); i++) { + if (getChildAt(i) instanceof DataObjectTreeNode) { + DataTreeNode child = (DataTreeNode) getChildAt(i); + child.writeValues(null); + } + } + } + if (association != null) { + association.setDataValues((FcModelNode) node); + } + } + + @Override + public boolean writable() { + if (node instanceof FcModelNode) { + FcModelNode modelNode = (FcModelNode) node; + Fc constraint = modelNode.getFc(); + return constraint != Fc.ST && constraint != Fc.MX; + } + return false; + } + + @Override + public boolean readable() { + return node instanceof FcModelNode; + } + + private static BasicDataBind createDataBind(BasicDataAttribute bda) { + switch (bda.getBasicType()) { + case BOOLEAN: + return new BooleanDataBind((BdaBoolean) bda); + case ENTRY_TIME: + return new EntryTimeDataBind((BdaEntryTime) bda); + case FLOAT32: + return new Float32DataBind((BdaFloat32) bda); + case FLOAT64: + return new Float64DataBind((BdaFloat64) bda); + case INT16: + return new Int16DataBind((BdaInt16) bda); + case INT16U: + return new Int16UDataBind((BdaInt16U) bda); + case INT32: + return new Int32DataBind((BdaInt32) bda); + case INT32U: + return new Int32UDataBind((BdaInt32U) bda); + case INT64: + return new Int64DataBind((BdaInt64) bda); + case INT8: + return new Int8DataBind((BdaInt8) bda); + case INT8U: + return new Int8UDataBind((BdaInt8U) bda); + case OCTET_STRING: + return new OctetStringDataBind((BdaOctetString) bda); + case TIMESTAMP: + return new TimeStampDataBind((BdaTimestamp) bda); + case UNICODE_STRING: + return new UnicodeStringDataBind((BdaUnicodeString) bda); + case VISIBLE_STRING: + return new VisibleStringDataBind((BdaVisibleString) bda); + case CHECK: + return new CheckDataBind((BdaCheck) bda); + case DOUBLE_BIT_POS: + return new DoubleBitPosDataBind((BdaDoubleBitPos) bda); + case OPTFLDS: + return new OptfldsDataBind((BdaOptFlds) bda); + case QUALITY: + return new QualityDataBind((BdaQuality) bda); + case REASON_FOR_INCLUSION: + return new ReasonForInclusionDataBind((BdaReasonForInclusion) bda); + case TAP_COMMAND: + return new TapCommandDataBind((BdaTapCommand) bda); + case TRIGGER_CONDITIONS: + return new TriggerConditionDataBind((BdaTriggerConditions) bda); + default: + throw new IllegalArgumentException("BasicType " + bda.getBasicType() + " unknown"); + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/DataSetTreeNode.java b/src/main/java/org/openmuc/openiec61850/clientgui/DataSetTreeNode.java new file mode 100644 index 0000000..b32bf6d --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/DataSetTreeNode.java @@ -0,0 +1,82 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui; + +import java.io.IOException; + +import javax.swing.tree.DefaultMutableTreeNode; + +import org.openmuc.openiec61850.ClientAssociation; +import org.openmuc.openiec61850.DataSet; +import org.openmuc.openiec61850.ServiceError; + +public class DataSetTreeNode extends DefaultMutableTreeNode implements DataTreeNode { + + private static final long serialVersionUID = 7919716359809465616L; + + private final DataSet node; + + public DataSetTreeNode(String name, DataSet node) { + super(name); + this.node = node; + } + + public DataSet getNode() { + return node; + } + + @Override + public void reset(ClientAssociation association) throws ServiceError, IOException { + if (association != null) { + association.getDataSetValues(node); + } + for (int i = 0; i < getChildCount(); i++) { + if (getChildAt(i) instanceof DataObjectTreeNode) { + DataTreeNode child = (DataTreeNode) getChildAt(i); + child.reset(null); + } + } + } + + @Override + public void writeValues(ClientAssociation association) throws ServiceError, IOException { + for (int i = 0; i < getChildCount(); i++) { + if (getChildAt(i) instanceof DataObjectTreeNode) { + DataTreeNode child = (DataTreeNode) getChildAt(i); + child.writeValues(null); + } + } + if (association != null) { + association.setDataSetValues(node); + } + } + + @Override + public BasicDataBind getData() { + return null; + } + + @Override + public boolean writable() { + return true; + } + + @Override + public boolean readable() { + return true; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/DataTreeNode.java b/src/main/java/org/openmuc/openiec61850/clientgui/DataTreeNode.java new file mode 100644 index 0000000..9569b9f --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/DataTreeNode.java @@ -0,0 +1,41 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui; + +import java.io.IOException; + +import javax.swing.tree.TreeNode; + +import org.openmuc.openiec61850.ClientAssociation; +import org.openmuc.openiec61850.ServiceError; + +public interface DataTreeNode { + + public abstract BasicDataBind getData(); + + public abstract void reset(ClientAssociation association) throws ServiceError, IOException; + + public abstract void writeValues(ClientAssociation association) throws ServiceError, IOException; + + public abstract int getChildCount(); + + public abstract TreeNode getChildAt(int index); + + public abstract boolean writable(); + + public abstract boolean readable(); +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/ServerModelParser.java b/src/main/java/org/openmuc/openiec61850/clientgui/ServerModelParser.java new file mode 100644 index 0000000..786e5d2 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/ServerModelParser.java @@ -0,0 +1,137 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import javax.swing.tree.TreeNode; + +import org.openmuc.openiec61850.DataSet; +import org.openmuc.openiec61850.Fc; +import org.openmuc.openiec61850.FcModelNode; +import org.openmuc.openiec61850.LogicalDevice; +import org.openmuc.openiec61850.LogicalNode; +import org.openmuc.openiec61850.ModelNode; +import org.openmuc.openiec61850.ServerModel; + +public class ServerModelParser { + + private final ServerModel model; + private DataObjectTreeNode modelTree; + + public ServerModelParser(ServerModel model) { + this.model = model; + } + + public TreeNode getModelTree() { + if (modelTree == null) { + createModelTree(); + } + return modelTree; + } + + private synchronized void createModelTree() { + if (modelTree == null) { + modelTree = new DataObjectTreeNode("server", null); + for (ModelNode node : model.getChildren()) { + if (node instanceof LogicalDevice == false) { + System.out.println( + "Node " + node.getName() + " is " + node.getClass() + " (should be LogicalDevice)"); + continue; + } + addLogicalDevice(modelTree, (LogicalDevice) node); + } + for (DataSet dataSet : model.getDataSets()) { + addDataSet(modelTree, dataSet); + } + } + } + + private void addLogicalDevice(DataObjectTreeNode root, LogicalDevice node) { + DataObjectTreeNode treeLD = new DataObjectTreeNode(node.getName(), node); + root.add(treeLD); + for (ModelNode subNode : node.getChildren()) { + if (subNode instanceof LogicalNode == false) { + System.out.println( + "Node " + subNode.getName() + " is " + subNode.getClass() + " (should be LogicalNode)"); + continue; + } + addLogicalNode(treeLD, (LogicalNode) subNode); + } + } + + private void addLogicalNode(DataObjectTreeNode parent, LogicalNode node) { + DataObjectTreeNode treeLN = new DataObjectTreeNode(node.getName(), node); + parent.add(treeLN); + Collection children = node.getChildren(); + Map> childMap = new HashMap<>(); + for (ModelNode child : children) { + if (!childMap.containsKey(child.getName())) { + childMap.put(child.getName(), new HashSet()); + } + childMap.get(child.getName()).add(((FcModelNode) child).getFc()); + } + for (Entry> childEntry : childMap.entrySet()) { + addFunctionalConstraintObject(treeLN, node, childEntry.getKey(), childEntry.getValue()); + } + } + + private void addDataSet(DataObjectTreeNode parent, DataSet node) { + DataSetTreeNode treeDS = new DataSetTreeNode(node.getReferenceStr(), node); + parent.add(treeDS); + Collection children = node.getMembers(); + for (ModelNode child : children) { + addFunctionalConstraintObject(treeDS, node, child); + } + } + + private void addFunctionalConstraintObject(DataObjectTreeNode parent, LogicalNode parentNode, String childName, + Set childFcs) { + DataObjectTreeNode treeFCDO = new DataObjectTreeNode(childName, null); + parent.add(treeFCDO); + + for (Fc constraint : childFcs) { + ModelNode subNode = parentNode.getChild(childName, constraint); + addDataObject(treeFCDO, "[" + constraint + "]", subNode); + } + } + + private void addFunctionalConstraintObject(DataSetTreeNode parent, DataSet parentNode, ModelNode node) { + DataObjectTreeNode treeFCDO = new DataObjectTreeNode(node.getReference().toString(), node); + parent.add(treeFCDO); + if (node.getChildren() != null) { + for (ModelNode subNode : node.getChildren()) { + addDataObject(treeFCDO, subNode.getName(), subNode); + } + } + } + + private void addDataObject(DataObjectTreeNode parent, String name, ModelNode node) { + DataObjectTreeNode treeDO = new DataObjectTreeNode(name, node); + parent.add(treeDO); + if (node.getChildren() != null) { + for (ModelNode subNode : node.getChildren()) { + addDataObject(treeDO, subNode.getName(), subNode); + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/SettingsFrame.java b/src/main/java/org/openmuc/openiec61850/clientgui/SettingsFrame.java new file mode 100644 index 0000000..2fbc187 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/SettingsFrame.java @@ -0,0 +1,210 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui; + +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JTextField; + +public class SettingsFrame extends JDialog implements ActionListener { + + private static final long serialVersionUID = -411845634137160667L; + + private int tselLocal1 = 0; + private int tselLocal2 = 0; + + private int tselRemote1 = 0; + private int tselRemote2 = 1; + + private final JTextField tselLocalField1 = new JTextField(Integer.toString(tselLocal1)); + private final JTextField tselLocalField2 = new JTextField(Integer.toString(tselLocal2)); + + private final JTextField tselRemoteField1 = new JTextField(Integer.toString(tselRemote1)); + private final JTextField tselRemoteField2 = new JTextField(Integer.toString(tselRemote2)); + + public SettingsFrame() { + setModalityType(ModalityType.APPLICATION_MODAL); + + final GridBagLayout layout = new GridBagLayout(); + setLayout(layout); + + this.setSize(200, 120); + setLocationRelativeTo(null); + + JLabel label = new JLabel("TSelLocal: "); + GridBagConstraints constraint = new GridBagConstraints(); + constraint.gridwidth = 1; + constraint.gridheight = 1; + constraint.gridx = 0; + constraint.gridy = 0; + constraint.insets = new Insets(5, 5, 5, 5); + constraint.anchor = GridBagConstraints.WEST; + layout.setConstraints(label, constraint); + add(label); + + constraint = new GridBagConstraints(); + constraint.fill = GridBagConstraints.HORIZONTAL; + constraint.gridwidth = 1; + constraint.gridheight = 1; + constraint.gridx = 1; + constraint.gridy = 0; + constraint.weightx = 1; + constraint.insets = new Insets(5, 5, 5, 5); + constraint.anchor = GridBagConstraints.WEST; + layout.setConstraints(tselLocalField1, constraint); + add(tselLocalField1); + + constraint = new GridBagConstraints(); + constraint.fill = GridBagConstraints.HORIZONTAL; + constraint.gridwidth = 1; + constraint.gridheight = 1; + constraint.gridx = 2; + constraint.gridy = 0; + constraint.weightx = 1; + constraint.insets = new Insets(5, 5, 5, 5); + constraint.anchor = GridBagConstraints.WEST; + layout.setConstraints(tselLocalField2, constraint); + add(tselLocalField2); + + label = new JLabel("TSelRemote: "); + constraint = new GridBagConstraints(); + constraint.gridwidth = 1; + constraint.gridheight = 1; + constraint.gridx = 0; + constraint.gridy = 1; + constraint.insets = new Insets(5, 5, 5, 5); + constraint.anchor = GridBagConstraints.WEST; + layout.setConstraints(label, constraint); + add(label); + + constraint = new GridBagConstraints(); + constraint.fill = GridBagConstraints.HORIZONTAL; + constraint.gridwidth = 1; + constraint.gridheight = 1; + constraint.gridx = 1; + constraint.gridy = 1; + constraint.weightx = 1; + constraint.insets = new Insets(5, 5, 5, 5); + constraint.anchor = GridBagConstraints.WEST; + layout.setConstraints(tselRemoteField1, constraint); + add(tselRemoteField1); + + constraint = new GridBagConstraints(); + constraint.fill = GridBagConstraints.HORIZONTAL; + constraint.gridwidth = 1; + constraint.gridheight = 1; + constraint.gridx = 2; + constraint.gridy = 1; + constraint.weightx = 1; + constraint.insets = new Insets(5, 5, 5, 5); + constraint.anchor = GridBagConstraints.WEST; + layout.setConstraints(tselRemoteField2, constraint); + add(tselRemoteField2); + + JButton button = new JButton("Cancel"); + button.setActionCommand("Cancel"); + button.addActionListener(this); + constraint.gridwidth = 1; + constraint.gridheight = 1; + constraint.gridx = 0; + constraint.gridy = 2; + constraint.insets = new Insets(5, 5, 5, 5); + constraint.anchor = GridBagConstraints.SOUTHWEST; + layout.setConstraints(button, constraint); + add(button); + + button = new JButton("OK"); + button.setActionCommand("Okay"); + button.addActionListener(this); + constraint.gridwidth = 2; + constraint.gridheight = 1; + constraint.gridx = 1; + constraint.gridy = 2; + constraint.insets = new Insets(5, 5, 5, 5); + constraint.anchor = GridBagConstraints.SOUTHWEST; + layout.setConstraints(button, constraint); + add(button); + } + + @Override + public void actionPerformed(ActionEvent e) { + if ("cancel".equalsIgnoreCase(e.getActionCommand())) { + tselLocalField1.setText(Integer.toString(tselLocal1 & 0xFF)); + tselLocalField2.setText(Integer.toString(tselLocal2 & 0xFF)); + tselRemoteField1.setText(Integer.toString(tselRemote1 & 0xFF)); + tselRemoteField2.setText(Integer.toString(tselRemote2 & 0xFF)); + setVisible(false); + } + else if ("okay".equalsIgnoreCase(e.getActionCommand())) { + tselLocal1 = parseTextField(tselLocalField1, tselLocal1); + tselLocal2 = parseTextField(tselLocalField2, tselLocal2); + tselRemote1 = parseTextField(tselRemoteField1, tselRemote1); + tselRemote2 = parseTextField(tselRemoteField2, tselRemote2); + setVisible(false); + } + } + + public byte[] getTselLocal() { + return new byte[] { (byte) tselLocal1, (byte) tselLocal2 }; + } + + public byte[] getTselRemote() { + return new byte[] { (byte) tselRemote1, (byte) tselRemote2 }; + } + + public void setTselLocal(byte[] tsel) { + if (tsel.length != 2) { + throw new IllegalArgumentException("TSel must consist of 2 bytes"); + } + tselLocal1 = tsel[0]; + tselLocal2 = tsel[1]; + + tselLocalField1.setText(Integer.toString(tselLocal1 & 0xFF)); + tselLocalField2.setText(Integer.toString(tselLocal2 & 0xFF)); + } + + public void setTselRemote(byte[] tsel) { + if (tsel.length != 2) { + throw new IllegalArgumentException("TSel must consist of 2 bytes"); + } + tselRemote1 = tsel[0]; + tselRemote2 = tsel[1]; + + tselRemoteField1.setText(Integer.toString(tselRemote1 & 0xFF)); + tselRemoteField2.setText(Integer.toString(tselRemote2 & 0xFF)); + } + + private int parseTextField(JTextField field, int oldValue) { + int value = oldValue; + try { + int newValue = Integer.parseInt(field.getText()); + if (newValue >= 0 && newValue <= 255) { + value = newValue; + } + } catch (NumberFormatException e) { + return oldValue; + } + return value; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/BooleanDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/BooleanDataBind.java new file mode 100644 index 0000000..4c4e6d7 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/BooleanDataBind.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import javax.swing.JCheckBox; +import javax.swing.JComponent; + +import org.openmuc.openiec61850.BdaBoolean; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class BooleanDataBind extends BasicDataBind { + + private JCheckBox checkbox; + + public BooleanDataBind(BdaBoolean data) { + super(data, BdaType.BOOLEAN); + } + + @Override + protected JComponent init() { + checkbox = new JCheckBox(); + checkbox.setBorder(null); + checkbox.setSelected(data.getValue()); + return checkbox; + } + + @Override + protected void resetImpl() { + checkbox.setSelected(data.getValue()); + } + + @Override + protected void writeImpl() { + data.setValue(checkbox.isSelected()); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/CheckDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/CheckDataBind.java new file mode 100644 index 0000000..9f97587 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/CheckDataBind.java @@ -0,0 +1,60 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import java.awt.Component; + +import javax.swing.BoxLayout; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.JPanel; + +import org.openmuc.openiec61850.BdaCheck; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class CheckDataBind extends BasicDataBind { + + private final JCheckBox interlock = new JCheckBox("Interlock"); + private final JCheckBox synchron = new JCheckBox("Synchron"); + + public CheckDataBind(BdaCheck data) { + super(data, BdaType.CHECK); + } + + @Override + protected JComponent init() { + interlock.setAlignmentX(Component.LEFT_ALIGNMENT); + JPanel valuePanel = new JPanel(); + valuePanel.setLayout(new BoxLayout(valuePanel, BoxLayout.PAGE_AXIS)); + valuePanel.add(interlock); + valuePanel.add(synchron); + return valuePanel; + } + + @Override + protected void resetImpl() { + interlock.setSelected(data.getInterlockCheck()); + synchron.setSelected(data.getSynchrocheck()); + } + + @Override + protected void writeImpl() { + data.setInterlockCheck(interlock.isSelected()); + data.setSynchrocheck(synchron.isSelected()); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/DoubleBitPosDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/DoubleBitPosDataBind.java new file mode 100644 index 0000000..c7bfe88 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/DoubleBitPosDataBind.java @@ -0,0 +1,50 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import javax.swing.JComboBox; +import javax.swing.JComponent; + +import org.openmuc.openiec61850.BdaDoubleBitPos; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class DoubleBitPosDataBind extends BasicDataBind { + + @SuppressWarnings("unchecked") + private final JComboBox valueField = new JComboBox(BdaDoubleBitPos.DoubleBitPos.values()); + + public DoubleBitPosDataBind(BdaDoubleBitPos data) { + super(data, BdaType.DOUBLE_BIT_POS); + } + + @Override + protected JComponent init() { + return valueField; + } + + @Override + protected void resetImpl() { + valueField.setSelectedItem(data.getDoubleBitPos()); + } + + @Override + protected void writeImpl() { + // TODO uncomment once data.setTapCommand() is implemented + // data.setTapCommand(valueField.getSelectedItem()); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/EntryTimeDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/EntryTimeDataBind.java new file mode 100644 index 0000000..e3dc9c8 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/EntryTimeDataBind.java @@ -0,0 +1,57 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import javax.swing.JComponent; +import javax.swing.JLabel; + +import org.openmuc.openiec61850.BdaEntryTime; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class EntryTimeDataBind extends BasicDataBind { + + public EntryTimeDataBind(BdaEntryTime data) { + super(data, BdaType.ENTRY_TIME); + } + + @Override + protected JComponent init() { + byte[] value = data.getValue(); + StringBuilder sb; + + sb = new StringBuilder("EntryTime ["); + for (int i = 0; i < value.length; i++) { + sb.append(Integer.toHexString(value[i] & 0xff)); + if (i != value.length - 1) { + sb.append(", "); + } + } + sb.append("]"); + return new JLabel(sb.toString()); + } + + @Override + protected void resetImpl() { + // ignore for now + } + + @Override + protected void writeImpl() { + // ignore for now + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Float32DataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Float32DataBind.java new file mode 100644 index 0000000..5227e2b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Float32DataBind.java @@ -0,0 +1,52 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaFloat32; +import org.openmuc.openiec61850.BdaType; + +public class Float32DataBind extends TextFieldDataBind { + + private static final FloatFilter FILTER = new FloatFilter(); + + public Float32DataBind(BdaFloat32 data) { + super(data, BdaType.FLOAT32, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(data.getFloat().toString()); + } + + @Override + protected void writeImpl() { + float newFloat = Float.parseFloat(inputField.getText()); + data.setFloat(newFloat); + } + + private static class FloatFilter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + Float.parseFloat(text); + return true; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Float64DataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Float64DataBind.java new file mode 100644 index 0000000..a63269d --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Float64DataBind.java @@ -0,0 +1,52 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaFloat64; +import org.openmuc.openiec61850.BdaType; + +public class Float64DataBind extends TextFieldDataBind { + + private static final DoubleFilter FILTER = new DoubleFilter(); + + public Float64DataBind(BdaFloat64 data) { + super(data, BdaType.FLOAT64, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(data.getDouble().toString()); + } + + @Override + protected void writeImpl() { + double newDouble = Double.parseDouble(inputField.getText()); + data.setDouble(newDouble); + } + + private static class DoubleFilter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + Double.parseDouble(text); + return true; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int16DataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int16DataBind.java new file mode 100644 index 0000000..8c866a0 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int16DataBind.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaInt16; +import org.openmuc.openiec61850.BdaType; + +public class Int16DataBind extends TextFieldDataBind { + + private static final Int16Filter FILTER = new Int16Filter(); + + public Int16DataBind(BdaInt16 data) { + super(data, BdaType.INT16, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(new Short(data.getValue()).toString()); + } + + @Override + protected void writeImpl() { + data.setValue(Short.parseShort(inputField.getText())); + } + + private static class Int16Filter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + Short.parseShort(text); + return true; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int16UDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int16UDataBind.java new file mode 100644 index 0000000..3bac69f --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int16UDataBind.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaInt16U; +import org.openmuc.openiec61850.BdaType; + +public class Int16UDataBind extends TextFieldDataBind { + + private static final UInt16Filter FILTER = new UInt16Filter(); + + public Int16UDataBind(BdaInt16U data) { + super(data, BdaType.INT16U, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(new Integer(data.getValue()).toString()); + } + + @Override + protected void writeImpl() { + data.setValue(Integer.parseInt(inputField.getText())); + } + + private static class UInt16Filter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + int value = Integer.parseInt(text); + return value >= 0 && value <= 0xFFFF; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int32DataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int32DataBind.java new file mode 100644 index 0000000..1df9c66 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int32DataBind.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaInt32; +import org.openmuc.openiec61850.BdaType; + +public class Int32DataBind extends TextFieldDataBind { + + private static final Int32Filter FILTER = new Int32Filter(); + + public Int32DataBind(BdaInt32 data) { + super(data, BdaType.INT32, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(new Integer(data.getValue()).toString()); + } + + @Override + protected void writeImpl() { + data.setValue(Integer.parseInt(inputField.getText())); + } + + private static class Int32Filter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + Integer.parseInt(text); + return true; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int32UDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int32UDataBind.java new file mode 100644 index 0000000..a95303c --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int32UDataBind.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaInt32U; +import org.openmuc.openiec61850.BdaType; + +public class Int32UDataBind extends TextFieldDataBind { + + private static final UInt32Filter FILTER = new UInt32Filter(); + + public Int32UDataBind(BdaInt32U data) { + super(data, BdaType.INT32U, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(new Long(data.getValue()).toString()); + } + + @Override + protected void writeImpl() { + data.setValue(Long.parseLong(inputField.getText())); + } + + private static class UInt32Filter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + long value = Long.parseLong(text); + return value >= 0 && value <= 0xFFFFFFFFL; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int64DataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int64DataBind.java new file mode 100644 index 0000000..8b5d9b1 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int64DataBind.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaInt64; +import org.openmuc.openiec61850.BdaType; + +public class Int64DataBind extends TextFieldDataBind { + + private static final Int64Filter FILTER = new Int64Filter(); + + public Int64DataBind(BdaInt64 data) { + super(data, BdaType.INT64, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(new Long(data.getValue()).toString()); + } + + @Override + protected void writeImpl() { + data.setValue(Long.parseLong(inputField.getText())); + } + + private static class Int64Filter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + Long.parseLong(text); + return true; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int8DataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int8DataBind.java new file mode 100644 index 0000000..3263b37 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int8DataBind.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaInt8; +import org.openmuc.openiec61850.BdaType; + +public class Int8DataBind extends TextFieldDataBind { + + private static final Int8Filter FILTER = new Int8Filter(); + + public Int8DataBind(BdaInt8 data) { + super(data, BdaType.INT8, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(new Byte(data.getValue()).toString()); + } + + @Override + protected void writeImpl() { + data.setValue(Byte.parseByte(inputField.getText())); + } + + private static class Int8Filter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + Byte.parseByte(text); + return true; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int8UDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int8UDataBind.java new file mode 100644 index 0000000..d91b712 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/Int8UDataBind.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import org.openmuc.openiec61850.BdaInt8U; +import org.openmuc.openiec61850.BdaType; + +public class Int8UDataBind extends TextFieldDataBind { + + private static final UInt8Filter FILTER = new UInt8Filter(); + + public Int8UDataBind(BdaInt8U data) { + super(data, BdaType.INT8U, FILTER); + } + + @Override + protected void resetImpl() { + inputField.setText(new Short(data.getValue()).toString()); + } + + @Override + protected void writeImpl() { + data.setValue(Short.parseShort(inputField.getText())); + } + + private static class UInt8Filter extends AbstractFilter { + @Override + protected boolean test(String text) { + try { + short value = Short.parseShort(text); + return value >= 0 && value <= 0xFF; + } catch (NumberFormatException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/OctetStringDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/OctetStringDataBind.java new file mode 100644 index 0000000..8a0bacb --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/OctetStringDataBind.java @@ -0,0 +1,57 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import javax.swing.JComponent; +import javax.swing.JLabel; + +import org.openmuc.openiec61850.BdaOctetString; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class OctetStringDataBind extends BasicDataBind { + + public OctetStringDataBind(BdaOctetString data) { + super(data, BdaType.OCTET_STRING); + } + + @Override + protected JComponent init() { + byte[] value = data.getValue(); + StringBuilder sb; + + sb = new StringBuilder("OctetString ["); + for (int i = 0; i < value.length; i++) { + sb.append(Integer.toHexString(value[i] & 0xff)); + if (i != value.length - 1) { + sb.append(", "); + } + } + sb.append("]"); + return new JLabel(sb.toString()); + } + + @Override + protected void resetImpl() { + // ignore for now + } + + @Override + protected void writeImpl() { + // ignore for now + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/OptfldsDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/OptfldsDataBind.java new file mode 100644 index 0000000..0bfce37 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/OptfldsDataBind.java @@ -0,0 +1,88 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import java.awt.Component; + +import javax.swing.BoxLayout; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.JPanel; + +import org.openmuc.openiec61850.BdaOptFlds; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class OptfldsDataBind extends BasicDataBind { + + private final JCheckBox bufferOverflow = new JCheckBox("BufferOverflow"); + private final JCheckBox configRevision = new JCheckBox("ConfigRevision"); + private final JCheckBox dataReference = new JCheckBox("DataReference"); + private final JCheckBox dataSetName = new JCheckBox("DataSetName"); + private final JCheckBox entryId = new JCheckBox("EntryId"); + private final JCheckBox reasonForInclusion = new JCheckBox("ReasonForInclusion"); + private final JCheckBox reportTimestamp = new JCheckBox("ReportTimestamp"); + private final JCheckBox segmentation = new JCheckBox("Segmentation"); + private final JCheckBox sequenceNumber = new JCheckBox("SequenceNumber"); + + public OptfldsDataBind(BdaOptFlds data) { + super(data, BdaType.OPTFLDS); + } + + @Override + protected JComponent init() { + bufferOverflow.setAlignmentX(Component.LEFT_ALIGNMENT); + JPanel valuePanel = new JPanel(); + valuePanel.setLayout(new BoxLayout(valuePanel, BoxLayout.PAGE_AXIS)); + valuePanel.add(bufferOverflow); + valuePanel.add(configRevision); + valuePanel.add(dataReference); + valuePanel.add(dataSetName); + valuePanel.add(entryId); + valuePanel.add(reasonForInclusion); + valuePanel.add(reportTimestamp); + valuePanel.add(segmentation); + valuePanel.add(sequenceNumber); + return valuePanel; + } + + @Override + protected void resetImpl() { + bufferOverflow.setSelected(data.isBufferOverflow()); + configRevision.setSelected(data.isConfigRevision()); + dataReference.setSelected(data.isDataReference()); + dataSetName.setSelected(data.isDataSetName()); + entryId.setSelected(data.isEntryId()); + reasonForInclusion.setSelected(data.isReasonForInclusion()); + reportTimestamp.setSelected(data.isReportTimestamp()); + segmentation.setSelected(data.isSegmentation()); + sequenceNumber.setSelected(data.isSequenceNumber()); + } + + @Override + protected void writeImpl() { + data.setBufferOverflow(bufferOverflow.isSelected()); + data.setConfigRevision(configRevision.isSelected()); + data.setDataReference(dataReference.isSelected()); + data.setDataSetName(dataSetName.isSelected()); + data.setEntryId(entryId.isSelected()); + data.setReasonForInclusion(reasonForInclusion.isSelected()); + data.setReportTimestamp(reportTimestamp.isSelected()); + data.setSegmentation(segmentation.isSelected()); + data.setSequenceNumber(sequenceNumber.isSelected()); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/QualityDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/QualityDataBind.java new file mode 100644 index 0000000..220443e --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/QualityDataBind.java @@ -0,0 +1,105 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import java.awt.Component; + +import javax.swing.BoxLayout; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JPanel; + +import org.openmuc.openiec61850.BdaQuality; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class QualityDataBind extends BasicDataBind { + + @SuppressWarnings("unchecked") + private final JComboBox validity = new JComboBox(BdaQuality.Validity.values()); + + private final JCheckBox badReference = new JCheckBox("BadReference"); + private final JCheckBox failure = new JCheckBox("Failure"); + private final JCheckBox inaccurate = new JCheckBox("Inaccurate"); + private final JCheckBox inconsistent = new JCheckBox("Inconsistent"); + private final JCheckBox oldData = new JCheckBox("OldData"); + private final JCheckBox operatorBlocked = new JCheckBox("OperatorBlocked"); + private final JCheckBox oscillatory = new JCheckBox("Oscillatory"); + private final JCheckBox outOfRange = new JCheckBox("OutOfRange"); + private final JCheckBox overflow = new JCheckBox("Overflow"); + private final JCheckBox substituded = new JCheckBox("Substituded"); + private final JCheckBox test = new JCheckBox("Test"); + + public QualityDataBind(BdaQuality data) { + super(data, BdaType.QUALITY); + } + + @Override + protected JComponent init() { + validity.setAlignmentX(Component.LEFT_ALIGNMENT); + JPanel valuePanel = new JPanel(); + valuePanel.setLayout(new BoxLayout(valuePanel, BoxLayout.PAGE_AXIS)); + valuePanel.setAlignmentX(Component.LEFT_ALIGNMENT); + valuePanel.add(validity); + valuePanel.add(badReference); + valuePanel.add(failure); + valuePanel.add(inaccurate); + valuePanel.add(inconsistent); + valuePanel.add(oldData); + valuePanel.add(operatorBlocked); + valuePanel.add(oscillatory); + valuePanel.add(outOfRange); + valuePanel.add(overflow); + valuePanel.add(substituded); + valuePanel.add(test); + return valuePanel; + } + + @Override + protected void resetImpl() { + validity.setSelectedItem(data.getValidity()); + badReference.setSelected(data.isBadReference()); + failure.setSelected(data.isFailure()); + inaccurate.setSelected(data.isInaccurate()); + inconsistent.setSelected(data.isInconsistent()); + oldData.setSelected(data.isOldData()); + operatorBlocked.setSelected(data.isOperatorBlocked()); + oscillatory.setSelected(data.isOscillatory()); + outOfRange.setSelected(data.isOutOfRange()); + overflow.setSelected(data.isOverflow()); + substituded.setSelected(data.isSubstituted()); + test.setSelected(data.isTest()); + } + + @Override + protected void writeImpl() { + // TODO uncomment once mutators are implemented + // data.setValidity(validity.getSelectedItem()); + // data.setBadReference(badReference.isSelected()); + // data.setFailure(failure.isSelected()); + // data.setInaccurate(inaccurate.isSelected()); + // data.setInconsistent(inconsistent.isSelected()); + // data.setOldData(oldData.isSelected()); + // data.setOperatorBlocked(operatorBlocked.isSelected()); + // data.setOlscillatory(oscillatory.isSelected()); + // data.setOutOfRange(outOfRange.isSelected()); + // data.setOverflow(overflow.isSelected()); + // data.setSubstituded(substituded.isSelected()); + // data.setTest(test.isSelected()); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/ReasonForInclusionDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/ReasonForInclusionDataBind.java new file mode 100644 index 0000000..d4d7910 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/ReasonForInclusionDataBind.java @@ -0,0 +1,76 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import java.awt.Component; + +import javax.swing.BoxLayout; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.JPanel; + +import org.openmuc.openiec61850.BdaReasonForInclusion; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class ReasonForInclusionDataBind extends BasicDataBind { + + private final JCheckBox applicationTrigger = new JCheckBox("ApplicationTrigger"); + private final JCheckBox dataChange = new JCheckBox("DataChange"); + private final JCheckBox dataUpdate = new JCheckBox("DataUpdate"); + private final JCheckBox generalInterrogation = new JCheckBox("GeneralInterrogation"); + private final JCheckBox integrity = new JCheckBox("Integrity"); + private final JCheckBox qualitychanged = new JCheckBox("QualityChanged"); + + public ReasonForInclusionDataBind(BdaReasonForInclusion data) { + super(data, BdaType.REASON_FOR_INCLUSION); + } + + @Override + protected JComponent init() { + applicationTrigger.setAlignmentX(Component.LEFT_ALIGNMENT); + JPanel valuePanel = new JPanel(); + valuePanel.setLayout(new BoxLayout(valuePanel, BoxLayout.PAGE_AXIS)); + valuePanel.add(applicationTrigger); + valuePanel.add(dataChange); + valuePanel.add(dataUpdate); + valuePanel.add(generalInterrogation); + valuePanel.add(integrity); + valuePanel.add(qualitychanged); + return valuePanel; + } + + @Override + protected void resetImpl() { + applicationTrigger.setSelected(data.isApplicationTrigger()); + dataChange.setSelected(data.isDataChange()); + dataUpdate.setSelected(data.isDataUpdate()); + generalInterrogation.setSelected(data.isGeneralInterrogation()); + integrity.setSelected(data.isIntegrity()); + qualitychanged.setSelected(data.isQualityChange()); + } + + @Override + protected void writeImpl() { + data.setApplicationTrigger(applicationTrigger.isSelected()); + data.setDataChange(dataChange.isSelected()); + data.setDataUpdate(dataUpdate.isSelected()); + data.setGeneralInterrogation(generalInterrogation.isSelected()); + data.setIntegrity(integrity.isSelected()); + data.setQualityChange(qualitychanged.isSelected()); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/TapCommandDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/TapCommandDataBind.java new file mode 100644 index 0000000..44df588 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/TapCommandDataBind.java @@ -0,0 +1,50 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import javax.swing.JComboBox; +import javax.swing.JComponent; + +import org.openmuc.openiec61850.BdaTapCommand; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class TapCommandDataBind extends BasicDataBind { + + @SuppressWarnings("unchecked") + private final JComboBox tapCommand = new JComboBox(BdaTapCommand.TapCommand.values()); + + public TapCommandDataBind(BdaTapCommand data) { + super(data, BdaType.TAP_COMMAND); + } + + @Override + protected JComponent init() { + return tapCommand; + } + + @Override + protected void resetImpl() { + tapCommand.setSelectedItem(data.getTapCommand()); + } + + @Override + protected void writeImpl() { + // TODO uncomment once data.setTapCommand is implemented + // data.setTapCommand(tapCommand.getSelectedItem()); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/TextFieldDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/TextFieldDataBind.java new file mode 100644 index 0000000..734ea38 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/TextFieldDataBind.java @@ -0,0 +1,93 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import javax.swing.JComponent; +import javax.swing.JTextField; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.DocumentFilter; +import javax.swing.text.PlainDocument; + +import org.openmuc.openiec61850.BasicDataAttribute; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public abstract class TextFieldDataBind extends BasicDataBind { + + private final DocumentFilter filter; + protected JTextField inputField; + + public TextFieldDataBind(E data, BdaType type, AbstractFilter filter) { + super(data, type); + this.filter = filter; + } + + @Override + protected JComponent init() { + inputField = new JTextField(); + PlainDocument doc = (PlainDocument) inputField.getDocument(); + doc.setDocumentFilter(filter); + resetImpl(); + return inputField; + } + + protected static abstract class AbstractFilter extends DocumentFilter { + @Override + public final void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) + throws BadLocationException { + + Document doc = fb.getDocument(); + StringBuilder sb = new StringBuilder(); + sb.append(doc.getText(0, doc.getLength())); + sb.insert(offset, string); + + if (test(sb.toString())) { + super.insertString(fb, offset, string, attr); + } + } + + @Override + public final void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs) + throws BadLocationException { + + Document doc = fb.getDocument(); + StringBuilder sb = new StringBuilder(); + sb.append(doc.getText(0, doc.getLength())); + sb.replace(offset, offset + length, text); + + if (test(sb.toString())) { + super.replace(fb, offset, length, text, attrs); + } + } + + @Override + public final void remove(FilterBypass fb, int offset, int length) throws BadLocationException { + Document doc = fb.getDocument(); + StringBuilder sb = new StringBuilder(); + sb.append(doc.getText(0, doc.getLength())); + sb.delete(offset, offset + length); + + if (test(sb.toString())) { + super.remove(fb, offset, length); + } + } + + protected abstract boolean test(String text); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/TimeStampDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/TimeStampDataBind.java new file mode 100644 index 0000000..80cf302 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/TimeStampDataBind.java @@ -0,0 +1,89 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.util.Date; + +import javax.swing.Box; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.JSpinner; +import javax.swing.SpinnerDateModel; + +import org.openmuc.openiec61850.BdaTimestamp; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +import com.toedter.calendar.JDateChooser; + +public class TimeStampDataBind extends BasicDataBind { + + private static final Dimension DATECHOOSERDIMENSION = new Dimension(120, 20); + + private JDateChooser dateChooser; + private JSpinner timeSpinner; + + public TimeStampDataBind(BdaTimestamp data) { + super(data, BdaType.TIMESTAMP); + } + + @Override + protected JComponent init() { + dateChooser = new JDateChooser(); + dateChooser.setDateFormatString("dd-MM-yyyy"); + dateChooser.setPreferredSize(DATECHOOSERDIMENSION); + timeSpinner = new JSpinner(new SpinnerDateModel()); + JSpinner.DateEditor timeEditor = new JSpinner.DateEditor(timeSpinner, "HH:mm:ss"); + timeSpinner.setEditor(timeEditor); + + Date d = data.getDate(); + if (d == null) { + d = new Date(0); + } + dateChooser.setDate(d); + timeSpinner.setValue(d); + + JPanel dateTimePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + dateTimePanel.add(dateChooser); + dateTimePanel.add(Box.createRigidArea(new Dimension(5, 0))); + dateTimePanel.add(timeSpinner); + return dateTimePanel; + } + + @Override + protected void resetImpl() { + Date d = data.getDate(); + if (d == null) { + d = new Date(0); + } + dateChooser.setDate(d); + timeSpinner.setValue(d); + } + + @SuppressWarnings("deprecation") + @Override + protected void writeImpl() { + Date newDate = dateChooser.getDate(); + Date timeValues = (Date) timeSpinner.getValue(); + newDate.setHours(timeValues.getHours()); + newDate.setMinutes(timeValues.getMinutes()); + newDate.setSeconds(timeValues.getSeconds()); + data.setDate(newDate); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/TriggerConditionDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/TriggerConditionDataBind.java new file mode 100644 index 0000000..7ff996c --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/TriggerConditionDataBind.java @@ -0,0 +1,72 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import java.awt.Component; + +import javax.swing.BoxLayout; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.JPanel; + +import org.openmuc.openiec61850.BdaTriggerConditions; +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.clientgui.BasicDataBind; + +public class TriggerConditionDataBind extends BasicDataBind { + + private final JCheckBox dataChange = new JCheckBox("DataChange"); + private final JCheckBox dataUpdate = new JCheckBox("DataUpdate"); + private final JCheckBox generalInterrogation = new JCheckBox("GeneralInterrogation"); + private final JCheckBox integrity = new JCheckBox("Integrity"); + private final JCheckBox qualityChange = new JCheckBox("QualityChange"); + + public TriggerConditionDataBind(BdaTriggerConditions data) { + super(data, BdaType.TRIGGER_CONDITIONS); + } + + @Override + protected JComponent init() { + dataChange.setAlignmentX(Component.LEFT_ALIGNMENT); + JPanel valuePanel = new JPanel(); + valuePanel.setLayout(new BoxLayout(valuePanel, BoxLayout.PAGE_AXIS)); + valuePanel.add(dataChange); + valuePanel.add(dataUpdate); + valuePanel.add(generalInterrogation); + valuePanel.add(integrity); + valuePanel.add(qualityChange); + return valuePanel; + } + + @Override + protected void resetImpl() { + dataChange.setSelected(data.isDataChange()); + dataUpdate.setSelected(data.isDataUpdate()); + generalInterrogation.setSelected(data.isGeneralInterrogation()); + integrity.setSelected(data.isIntegrity()); + qualityChange.setSelected(data.isQualityChange()); + } + + @Override + protected void writeImpl() { + data.setDataChange(dataChange.isSelected()); + data.setDataUpdate(dataUpdate.isSelected()); + data.setGeneralInterrogation(generalInterrogation.isSelected()); + data.setIntegrity(integrity.isSelected()); + data.setQualityChange(qualityChange.isSelected()); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/UnicodeStringDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/UnicodeStringDataBind.java new file mode 100644 index 0000000..fc25165 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/UnicodeStringDataBind.java @@ -0,0 +1,63 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import java.nio.CharBuffer; +import java.nio.charset.CharacterCodingException; +import java.nio.charset.Charset; +import java.nio.charset.CharsetEncoder; + +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.BdaUnicodeString; + +public class UnicodeStringDataBind extends TextFieldDataBind { + + private static final Charset UTF8 = Charset.forName("UTF-8"); + + public UnicodeStringDataBind(BdaUnicodeString data) { + super(data, BdaType.UNICODE_STRING, new Utf8Filter(data.getMaxLength())); + } + + @Override + protected void resetImpl() { + inputField.setText(new String(data.getValue(), UTF8)); + } + + @Override + protected void writeImpl() { + data.setValue(UTF8.encode(inputField.getText()).array()); + } + + private static class Utf8Filter extends AbstractFilter { + private final CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder(); + private final int maxBytes; + + public Utf8Filter(int maxBytes) { + this.maxBytes = maxBytes; + } + + @Override + protected boolean test(String text) { + try { + byte[] codedString = encoder.encode(CharBuffer.wrap(text)).array(); + return codedString.length <= maxBytes; + } catch (CharacterCodingException e) { + return false; + } + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/databind/VisibleStringDataBind.java b/src/main/java/org/openmuc/openiec61850/clientgui/databind/VisibleStringDataBind.java new file mode 100644 index 0000000..3e37163 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/databind/VisibleStringDataBind.java @@ -0,0 +1,64 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.databind; + +import java.nio.CharBuffer; +import java.nio.charset.CharacterCodingException; +import java.nio.charset.Charset; +import java.nio.charset.CharsetEncoder; + +import org.openmuc.openiec61850.BdaType; +import org.openmuc.openiec61850.BdaVisibleString; + +public class VisibleStringDataBind extends TextFieldDataBind { + + private static final Charset ASCII = Charset.forName("US-ASCII"); + + public VisibleStringDataBind(BdaVisibleString data) { + super(data, BdaType.VISIBLE_STRING, new AsciiFilter(data.getMaxLength())); + } + + @Override + protected void resetImpl() { + inputField.setText(new String(data.getValue(), ASCII)); + } + + @Override + protected void writeImpl() { + data.setValue(ASCII.encode(inputField.getText()).array()); + } + + private static class AsciiFilter extends TextFieldDataBind.AbstractFilter { + private final CharsetEncoder encoder = Charset.forName("US-ASCII").newEncoder(); + private final int maxBytes; + + public AsciiFilter(int maxBytes) { + this.maxBytes = maxBytes; + } + + @Override + protected boolean test(String text) { + try { + byte[] codedString = encoder.encode(CharBuffer.wrap(text)).array(); + return codedString.length <= maxBytes; + } catch (CharacterCodingException e) { + return false; + } + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/clientgui/util/Counter.java b/src/main/java/org/openmuc/openiec61850/clientgui/util/Counter.java new file mode 100644 index 0000000..cfb78ed --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/clientgui/util/Counter.java @@ -0,0 +1,37 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.clientgui.util; + +public class Counter { + private int value; + + public Counter(int value) { + this.value = value; + } + + public Counter() { + this(0); + } + + public void increment() { + value++; + } + + public int getValue() { + return value; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/Action.java b/src/main/java/org/openmuc/openiec61850/internal/cli/Action.java new file mode 100644 index 0000000..9239e68 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/Action.java @@ -0,0 +1,21 @@ +package org.openmuc.openiec61850.internal.cli; + +public class Action { + + private final String key; + private final String description; + + public Action(String key, String description) { + this.key = key; + this.description = description; + } + + public String getKey() { + return key; + } + + public String getDescription() { + return description; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/ActionException.java b/src/main/java/org/openmuc/openiec61850/internal/cli/ActionException.java new file mode 100644 index 0000000..897e15b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/ActionException.java @@ -0,0 +1,23 @@ +package org.openmuc.openiec61850.internal.cli; + +public final class ActionException extends Exception { + + private static final long serialVersionUID = 4806947065917148946L; + + public ActionException() { + super(); + } + + public ActionException(String s) { + super(s); + } + + public ActionException(Throwable cause) { + super(cause); + } + + public ActionException(String s, Throwable cause) { + super(s, cause); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/ActionListener.java b/src/main/java/org/openmuc/openiec61850/internal/cli/ActionListener.java new file mode 100644 index 0000000..4cfe1fb --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/ActionListener.java @@ -0,0 +1,9 @@ +package org.openmuc.openiec61850.internal.cli; + +public interface ActionListener { + + public void actionCalled(String actionKey) throws ActionException; + + public void quit(); + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/ActionProcessor.java b/src/main/java/org/openmuc/openiec61850/internal/cli/ActionProcessor.java new file mode 100644 index 0000000..741e59a --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/ActionProcessor.java @@ -0,0 +1,120 @@ +package org.openmuc.openiec61850.internal.cli; + +import static java.lang.System.exit; +import static java.lang.System.out; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.LinkedHashMap; +import java.util.Map; + +public class ActionProcessor { + + private static final String SEPARATOR_LINE = "------------------------------------------------------"; + + private final BufferedReader reader; + private final ActionListener actionListener; + private volatile boolean closed = false; + + private final Map actionMap = new LinkedHashMap<>(); + + private final Action helpAction = new Action("h", "print help message"); + private final Action quitAction = new Action("q", "quit the application"); + + public ActionProcessor(ActionListener actionListener) { + reader = new BufferedReader(new InputStreamReader(System.in)); + this.actionListener = actionListener; + } + + public void addAction(Action action) { + actionMap.put(action.getKey(), action); + } + + public BufferedReader getReader() { + return reader; + } + + public void start() { + + actionMap.put(helpAction.getKey(), helpAction); + actionMap.put(quitAction.getKey(), quitAction); + + printHelp(); + + try { + + String actionKey; + while (true) { + + if (closed) { + exit(1); + return; + } + + System.out.println("\n** Enter action key: "); + + try { + actionKey = reader.readLine(); + } catch (IOException e) { + System.err.printf("%s. Application is being shut down.\n", e.getMessage()); + exit(2); + return; + } + + if (closed) { + exit(1); + return; + } + + if (actionMap.get(actionKey) == null) { + System.err.println("Illegal action key.\n"); + printHelp(); + continue; + } + + if (actionKey.equals(helpAction.getKey())) { + printHelp(); + continue; + } + + if (actionKey.equals(quitAction.getKey())) { + actionListener.quit(); + return; + } + + actionListener.actionCalled(actionKey); + + } + + } catch (Exception e) { + e.printStackTrace(); + actionListener.quit(); + } finally { + close(); + } + } + + private void printHelp() { + final String message = " %s - %s\n"; + out.flush(); + out.println(); + out.println(SEPARATOR_LINE); + + for (Action action : actionMap.values()) { + out.printf(message, action.getKey(), action.getDescription()); + } + + out.println(SEPARATOR_LINE); + + } + + public void close() { + closed = true; + try { + reader.close(); + } catch (IOException e) { + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/CliParameter.java b/src/main/java/org/openmuc/openiec61850/internal/cli/CliParameter.java new file mode 100644 index 0000000..ab632f1 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/CliParameter.java @@ -0,0 +1,47 @@ +package org.openmuc.openiec61850.internal.cli; + +public abstract class CliParameter { + + final String name; + final String description; + final boolean optional; + boolean selected; + + CliParameter(CliParameterBuilder builder) { + name = builder.name; + description = builder.description; + optional = builder.optional; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @return the optional + */ + public boolean isOptional() { + return optional; + } + + public boolean isSelected() { + return selected; + } + + abstract int parse(String[] args, int i) throws CliParseException; + + abstract int appendSynopsis(StringBuilder sb); + + abstract void appendDescription(StringBuilder sb); + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/CliParameterBuilder.java b/src/main/java/org/openmuc/openiec61850/internal/cli/CliParameterBuilder.java new file mode 100644 index 0000000..bca62cb --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/CliParameterBuilder.java @@ -0,0 +1,61 @@ +package org.openmuc.openiec61850.internal.cli; + +import java.util.List; + +public class CliParameterBuilder { + + final String name; + String description; + boolean optional = true; + + public CliParameterBuilder(String name) { + this.name = name; + } + + public CliParameterBuilder setDescription(String description) { + this.description = description; + return this; + } + + public CliParameterBuilder setMandatory() { + optional = false; + return this; + } + + public LongCliParameter buildLongParameter(String parameterName, long defaultValue) { + return new LongCliParameter(this, parameterName, defaultValue); + } + + public LongCliParameter buildLongParameter(String parameterName) { + return new LongCliParameter(this, parameterName); + } + + public IntCliParameter buildIntParameter(String parameterName, int defaultValue) { + return new IntCliParameter(this, parameterName, defaultValue); + } + + public IntCliParameter buildIntParameter(String parameterName) { + return new IntCliParameter(this, parameterName); + } + + public StringCliParameter buildStringParameter(String parameterName, String defaultValue) { + return new StringCliParameter(this, parameterName, defaultValue); + } + + public StringCliParameter buildStringParameter(String parameterName) { + return new StringCliParameter(this, parameterName); + } + + public StringListCliParameter buildStringListParameter(String parameterName) { + return new StringListCliParameter(this, parameterName); + } + + public StringListCliParameter buildStringListParameter(String parameterName, List defaultValue) { + return new StringListCliParameter(this, parameterName, defaultValue); + } + + public FlagCliParameter buildFlagParameter() { + return new FlagCliParameter(this); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/CliParseException.java b/src/main/java/org/openmuc/openiec61850/internal/cli/CliParseException.java new file mode 100644 index 0000000..396c266 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/CliParseException.java @@ -0,0 +1,23 @@ +package org.openmuc.openiec61850.internal.cli; + +public final class CliParseException extends Exception { + + private static final long serialVersionUID = -5162894897245715377L; + + public CliParseException() { + super(); + } + + public CliParseException(String s) { + super(s); + } + + public CliParseException(Throwable cause) { + super(cause); + } + + public CliParseException(String s, Throwable cause) { + super(s, cause); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/CliParser.java b/src/main/java/org/openmuc/openiec61850/internal/cli/CliParser.java new file mode 100644 index 0000000..b0fe058 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/CliParser.java @@ -0,0 +1,136 @@ +package org.openmuc.openiec61850.internal.cli; + +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +public class CliParser { + + private final String name; + private final String description; + private String selectedGroup = ""; + + private static final String HELP = "--help"; + + private static class ParameterGroup { + private final String name; + private final List parameters; + + public ParameterGroup(String name, List parameters) { + this.name = name; + this.parameters = parameters; + } + } + + private final List commandLineParameterGroups = new ArrayList<>(); + + public CliParser(String name, String description) { + this.name = name; + this.description = description; + } + + public void addParameterGroup(String groupName, List parameters) { + commandLineParameterGroups.add(new ParameterGroup(groupName.toLowerCase(), parameters)); + } + + public void addParameters(List parameters) { + commandLineParameterGroups.clear(); + commandLineParameterGroups.add(new ParameterGroup("", parameters)); + } + + public String getSelectedGroup() { + return selectedGroup; + } + + public void parseArguments(String[] args) throws CliParseException { + + if (args.length > 0 && HELP.equals(args[0])) { + System.out.println(getUsageString()); + System.exit(0); + } + + List parameters = null; + + int i = 0; + if (commandLineParameterGroups.get(0).name.isEmpty()) { + parameters = commandLineParameterGroups.get(0).parameters; + } + else { + if (args.length == 0) { + throw new CliParseException("No parameters found."); + } + for (ParameterGroup parameterGroup : commandLineParameterGroups) { + if (parameterGroup.name.equals(args[0].toLowerCase())) { + selectedGroup = parameterGroup.name; + parameters = parameterGroup.parameters; + } + } + if (parameters == null) { + throw new CliParseException("Group name " + args[0] + " is undefined."); + } + i++; + } + + while (i < args.length) { + boolean found = false; + for (CliParameter option : parameters) { + if (args[i].equals(option.getName())) { + i += option.parse(args, i); + found = true; + break; + } + } + if (!found) { + throw new CliParseException("Unknown parameter found: " + args[i]); + } + } + + for (CliParameter option : parameters) { + if (!option.isOptional() && !option.isSelected()) { + throw new CliParseException("Parameter " + option.getName() + " is mandatory but was not selected."); + } + } + } + + public String getUsageString() { + + StringBuilder sb = new StringBuilder(); + sb.append("NAME\n\t").append(name).append(" - ").append(description).append("\n\nSYNOPSIS\n"); + + for (ParameterGroup parameterGroup : commandLineParameterGroups) { + sb.append("\t").append(name).append(" ").append(parameterGroup.name); + + int characterColumn = name.length() + parameterGroup.name.length() + 1; + + for (CliParameter parameter : parameterGroup.parameters) { + if ((characterColumn + parameter.appendSynopsis(new StringBuilder())) > 90) { + characterColumn = 0; + sb.append("\n\t "); + } + sb.append(' '); + characterColumn += parameter.appendSynopsis(sb) + 1; + } + sb.append("\n"); + } + + sb.append("\nOPTIONS\n"); + + Set parameters = new LinkedHashSet<>(); + + for (ParameterGroup parameterGroup : commandLineParameterGroups) { + parameters.addAll(parameterGroup.parameters); + } + + for (CliParameter parameter : parameters) { + sb.append(' '); + parameter.appendDescription(sb); + sb.append("\n\n"); + } + + sb.append("\t--help display this help and exit"); + + return sb.toString(); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/FlagCliParameter.java b/src/main/java/org/openmuc/openiec61850/internal/cli/FlagCliParameter.java new file mode 100644 index 0000000..5691769 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/FlagCliParameter.java @@ -0,0 +1,36 @@ +package org.openmuc.openiec61850.internal.cli; + +public class FlagCliParameter extends CliParameter { + + FlagCliParameter(CliParameterBuilder builder) { + super(builder); + } + + @Override + int appendSynopsis(StringBuilder sb) { + int length = 0; + if (optional) { + sb.append("["); + length++; + } + sb.append(name); + length += name.length(); + if (optional) { + sb.append("]"); + length++; + } + return length; + } + + @Override + void appendDescription(StringBuilder sb) { + sb.append("\t").append(name).append("\n\t ").append(description); + } + + @Override + int parse(String[] args, int i) throws CliParseException { + selected = true; + return 1; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/IntCliParameter.java b/src/main/java/org/openmuc/openiec61850/internal/cli/IntCliParameter.java new file mode 100644 index 0000000..776899b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/IntCliParameter.java @@ -0,0 +1,45 @@ +package org.openmuc.openiec61850.internal.cli; + +public class IntCliParameter extends ValueCliParameter { + + Integer value; + private Integer defaultValue = null; + + IntCliParameter(CliParameterBuilder builder, String parameterName, int defaultValue) { + super(builder, parameterName); + this.defaultValue = defaultValue; + value = defaultValue; + } + + IntCliParameter(CliParameterBuilder builder, String parameterName) { + super(builder, parameterName); + } + + public int getValue() { + return value; + } + + @Override + int parse(String[] args, int i) throws CliParseException { + selected = true; + + if (args.length < (i + 2)) { + throw new CliParseException("Parameter " + name + " has no value."); + } + + try { + value = Integer.decode(args[i + 1]); + } catch (Exception e) { + throw new CliParseException("Parameter value " + args[i + 1] + " cannot be converted to int."); + } + return 2; + } + + @Override + void appendDescription(StringBuilder sb) { + super.appendDescription(sb); + if (defaultValue != null) { + sb.append(" Default is ").append(defaultValue).append("."); + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/LongCliParameter.java b/src/main/java/org/openmuc/openiec61850/internal/cli/LongCliParameter.java new file mode 100644 index 0000000..e786d5f --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/LongCliParameter.java @@ -0,0 +1,45 @@ +package org.openmuc.openiec61850.internal.cli; + +public class LongCliParameter extends ValueCliParameter { + + Long value; + private Long defaultValue = null; + + LongCliParameter(CliParameterBuilder builder, String parameterName, long defaultValue) { + super(builder, parameterName); + this.defaultValue = defaultValue; + value = defaultValue; + } + + LongCliParameter(CliParameterBuilder builder, String parameterName) { + super(builder, parameterName); + } + + public long getValue() { + return value; + } + + @Override + int parse(String[] args, int i) throws CliParseException { + selected = true; + + if (args.length < (i + 2)) { + throw new CliParseException("Parameter " + name + " has no value."); + } + + try { + value = Long.decode(args[i + 1]); + } catch (Exception e) { + throw new CliParseException("Parameter value " + args[i + 1] + " cannot be converted to long."); + } + return 2; + } + + @Override + void appendDescription(StringBuilder sb) { + super.appendDescription(sb); + if (defaultValue != null) { + sb.append(" Default is ").append(defaultValue).append("."); + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/StringCliParameter.java b/src/main/java/org/openmuc/openiec61850/internal/cli/StringCliParameter.java new file mode 100644 index 0000000..a716245 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/StringCliParameter.java @@ -0,0 +1,41 @@ +package org.openmuc.openiec61850.internal.cli; + +public class StringCliParameter extends ValueCliParameter { + + String value; + private String defaultValue = null; + + StringCliParameter(CliParameterBuilder builder, String parameterName, String defaultValue) { + super(builder, parameterName); + this.defaultValue = defaultValue; + value = defaultValue; + } + + StringCliParameter(CliParameterBuilder builder, String parameterName) { + super(builder, parameterName); + } + + public String getValue() { + return value; + } + + @Override + int parse(String[] args, int i) throws CliParseException { + selected = true; + + if (args.length < (i + 2)) { + throw new CliParseException("Parameter " + name + " has no value."); + } + value = args[i + 1]; + + return 2; + } + + @Override + public void appendDescription(StringBuilder sb) { + super.appendDescription(sb); + if (defaultValue != null) { + sb.append(" Default is \"").append(defaultValue).append("\"."); + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/StringListCliParameter.java b/src/main/java/org/openmuc/openiec61850/internal/cli/StringListCliParameter.java new file mode 100644 index 0000000..9623707 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/StringListCliParameter.java @@ -0,0 +1,72 @@ +package org.openmuc.openiec61850.internal.cli; + +import java.util.ArrayList; +import java.util.List; + +public class StringListCliParameter extends ValueCliParameter { + + List value; + private List defaultValue = null; + + StringListCliParameter(CliParameterBuilder builder, String parameterName, List defaultValue) { + super(builder, parameterName); + this.defaultValue = defaultValue; + value = defaultValue; + } + + StringListCliParameter(CliParameterBuilder builder, String parameterName) { + super(builder, parameterName); + } + + public List getValue() { + return value; + } + + @Override + int parse(String[] args, int i) throws CliParseException { + selected = true; + + value = new ArrayList<>(); + i++; + while (i < args.length) { + if (args[i].length() > 0 && args[i].startsWith("-")) { + break; + } + value.add(args[i++]); + } + + if (value.size() == 0) { + throw new CliParseException("Parameter " + name + " has no value."); + } + + return value.size() + 1; + } + + @Override + int appendSynopsis(StringBuilder sb) { + int length = 0; + if (optional) { + sb.append("["); + length++; + } + sb.append(name).append(" <").append(parameterName).append(">..."); + length += (name.length() + 6 + parameterName.length()); + if (optional) { + sb.append("]"); + length++; + } + return length; + } + + @Override + public void appendDescription(StringBuilder sb) { + sb.append("\t").append(name).append(" <").append(parameterName).append(">...\n\t ").append(description); + if (defaultValue != null) { + sb.append(" Default is \""); + for (String stringValue : defaultValue) { + sb.append(stringValue); + } + sb.append("\"."); + } + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/cli/ValueCliParameter.java b/src/main/java/org/openmuc/openiec61850/internal/cli/ValueCliParameter.java new file mode 100644 index 0000000..025fe7b --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/cli/ValueCliParameter.java @@ -0,0 +1,32 @@ +package org.openmuc.openiec61850.internal.cli; + +abstract class ValueCliParameter extends CliParameter { + + String parameterName; + + ValueCliParameter(CliParameterBuilder builder, String parameterName) { + super(builder); + this.parameterName = parameterName; + } + + @Override + int appendSynopsis(StringBuilder sb) { + int length = 0; + if (optional) { + sb.append("["); + length++; + } + sb.append(name).append(" <").append(parameterName).append(">"); + length += (name.length() + 3 + parameterName.length()); + if (optional) { + sb.append("]"); + length++; + } + return length; + } + + @Override + void appendDescription(StringBuilder sb) { + sb.append("\t").append(name).append(" <").append(parameterName).append(">\n\t ").append(description); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractDataAttribute.java b/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractDataAttribute.java new file mode 100644 index 0000000..19123a0 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractDataAttribute.java @@ -0,0 +1,88 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public abstract class AbstractDataAttribute extends AbstractElement { + + // attributes not needed: valKind + + private String sAddr = null; /* optional - short address */ + private String bType = null; /* mandatory - basic type */ + + private String type = null; /* conditional - if bType = "Enum" or "Struct" */ + private int count = 0; /* optional - number of array elements */ + public String value = null; + + public AbstractDataAttribute(Node xmlNode) throws SclParseException { + super(xmlNode); + + NamedNodeMap attributes = xmlNode.getAttributes(); + + for (int i = 0; i < attributes.getLength(); i++) { + Node node = attributes.item(i); + String nodeName = node.getNodeName(); + + if (nodeName.equals("type")) { + type = node.getNodeValue(); + } + else if (nodeName.equals("sAddr")) { + sAddr = node.getNodeValue(); + } + else if (nodeName.equals("bType")) { + bType = node.getNodeValue(); + } + else if (nodeName.equals("count")) { + count = Integer.parseInt(node.getNodeValue()); + } + } + + if (bType == null) { + throw new SclParseException("Required attribute \"bType\" not found!"); + } + + NodeList elements = xmlNode.getChildNodes(); + for (int i = 0; i < elements.getLength(); i++) { + Node node = elements.item(i); + if (node.getNodeName().equals("Val")) { + value = node.getTextContent(); + } + } + + } + + public String getsAddr() { + return sAddr; + } + + public String getbType() { + return bType; + } + + public String getType() { + return type; + } + + public int getCount() { + return count; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractElement.java b/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractElement.java new file mode 100644 index 0000000..18f9c9e --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractElement.java @@ -0,0 +1,56 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +public abstract class AbstractElement { + + private String name = null; + private String desc = null; + + public AbstractElement(String name, String desc) { + this.name = name; + this.desc = desc; + } + + public AbstractElement(Node xmlNode) throws SclParseException { + NamedNodeMap attributes = xmlNode.getAttributes(); + + Node node = attributes.getNamedItem("name"); + if (node == null) { + throw new SclParseException("Required attribute \"name\" not found!"); + } + name = node.getNodeValue(); + + node = attributes.getNamedItem("desc"); + if (node != null) { + desc = node.getNodeValue(); + } + + } + + public String getName() { + return name; + } + + public String getDesc() { + return desc; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractType.java b/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractType.java new file mode 100644 index 0000000..b372291 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/AbstractType.java @@ -0,0 +1,35 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.Node; + +public abstract class AbstractType { + + public String id = null; + + // attributes not needed: desc + + public AbstractType(Node xmlNode) throws SclParseException { + Node idNode = xmlNode.getAttributes().getNamedItem("id"); + if (idNode == null) { + throw new SclParseException("Required attribute \"id\" not found!"); + } + id = idNode.getNodeValue(); + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/Bda.java b/src/main/java/org/openmuc/openiec61850/internal/scl/Bda.java new file mode 100644 index 0000000..b3cb09d --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/Bda.java @@ -0,0 +1,28 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.Node; + +public final class Bda extends AbstractDataAttribute { + + public Bda(Node xmlNode) throws SclParseException { + super(xmlNode); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/Da.java b/src/main/java/org/openmuc/openiec61850/internal/scl/Da.java new file mode 100644 index 0000000..e8774af --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/Da.java @@ -0,0 +1,80 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.Fc; +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +public final class Da extends AbstractDataAttribute { + + private Fc fc = null; + private boolean dchg = false; + private boolean qchg = false; + private boolean dupd = false; + + public Da(Node xmlNode) throws SclParseException { + + super(xmlNode); + + NamedNodeMap attributes = xmlNode.getAttributes(); + + for (int i = 0; i < attributes.getLength(); i++) { + Node node = attributes.item(i); + String nodeName = node.getNodeName(); + + if (nodeName.equals("fc")) { + fc = Fc.fromString(node.getNodeValue()); + if (fc == null) { + throw new SclParseException("Invalid Functional Constraint"); + } + } + else if (nodeName.equals("dchg")) { + dchg = "true".equals(node.getNodeValue()); + } + else if (nodeName.equals("qchg")) { + qchg = "true".equals(node.getNodeValue()); + } + else if (nodeName.equals("dupd")) { + dupd = "true".equals(node.getNodeValue()); + } + } + + if (fc == null) { + throw new SclParseException("Required attribute \"fc\" not found!"); + } + + } + + public Fc getFc() { + return fc; + } + + public boolean isDchg() { + return dchg; + } + + public boolean isQchg() { + return qchg; + } + + public boolean isDupd() { + return dupd; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/DaType.java b/src/main/java/org/openmuc/openiec61850/internal/scl/DaType.java new file mode 100644 index 0000000..a60ddf4 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/DaType.java @@ -0,0 +1,46 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import java.util.ArrayList; +import java.util.List; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public final class DaType extends AbstractType { + + // attributes not needed: iedType + + public List bdas = new ArrayList<>(); + + public DaType(Node xmlNode) throws SclParseException { + + super(xmlNode); + + NodeList elements = xmlNode.getChildNodes(); + + for (int i = 0; i < elements.getLength(); i++) { + Node node = elements.item(i); + if (node.getNodeName().equals("BDA")) { + bdas.add(new Bda(node)); + } + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/Do.java b/src/main/java/org/openmuc/openiec61850/internal/scl/Do.java new file mode 100644 index 0000000..8ade0ff --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/Do.java @@ -0,0 +1,49 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +public final class Do extends AbstractElement { + + private String type; + + public Do(String name, String desc, String type) { + super(name, desc); + } + + public Do(Node xmlNode) throws SclParseException { + super(xmlNode); + + NamedNodeMap attributes = xmlNode.getAttributes(); + + Node node = attributes.getNamedItem("type"); + + if (node == null) { + throw new SclParseException("Required attribute \"type\" not found!"); + } + + type = node.getNodeValue(); + } + + public String getType() { + return type; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/DoType.java b/src/main/java/org/openmuc/openiec61850/internal/scl/DoType.java new file mode 100644 index 0000000..9f238e5 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/DoType.java @@ -0,0 +1,54 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import java.util.ArrayList; +import java.util.List; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public final class DoType extends AbstractType { + + // attributes not needed: cdc, iedType + + public List das = new ArrayList<>(); + public List sdos = new ArrayList<>(); + + public DoType(Node xmlNode) throws SclParseException { + + super(xmlNode); + + if (xmlNode.getAttributes().getNamedItem("cdc") == null) { + throw new SclParseException("Required attribute \"cdc\" not found in DOType!"); + } + + NodeList elements = xmlNode.getChildNodes(); + + for (int i = 0; i < elements.getLength(); i++) { + Node node = elements.item(i); + if (node.getNodeName().equals("SDO")) { + sdos.add(new Sdo(node)); + } + if (node.getNodeName().equals("DA")) { + das.add(new Da(node)); + } + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/EnumType.java b/src/main/java/org/openmuc/openiec61850/internal/scl/EnumType.java new file mode 100644 index 0000000..c134ff8 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/EnumType.java @@ -0,0 +1,60 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import java.util.ArrayList; +import java.util.List; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public final class EnumType extends AbstractType { + + public List values; + public int max = 0; + public int min = 0; + + public EnumType(Node xmlNode) throws SclParseException { + super(xmlNode); + + NodeList elements = xmlNode.getChildNodes(); + + values = new ArrayList<>(); + + for (int i = 0; i < elements.getLength(); i++) { + Node node = elements.item(i); + + if (node.getNodeName().equals("EnumVal")) { + EnumVal val = new EnumVal(node); + if (val.getOrd() < min) { + min = val.getOrd(); + } + else if (val.getOrd() > max) { + max = val.getOrd(); + } + values.add(val); + } + } + + } + + public List getValues() { + return values; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/EnumVal.java b/src/main/java/org/openmuc/openiec61850/internal/scl/EnumVal.java new file mode 100644 index 0000000..4442094 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/EnumVal.java @@ -0,0 +1,58 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +public final class EnumVal { + + private final String id; + private int ord; + + public EnumVal(String id, int ord) { + this.id = id; + this.ord = ord; + } + + public EnumVal(Node xmlNode) throws SclParseException { + id = xmlNode.getTextContent(); + + NamedNodeMap attributes = xmlNode.getAttributes(); + + Node node = attributes.getNamedItem("ord"); + + if (node == null) { + throw new SclParseException("Required attribute \"ord\" not found!"); + } + + try { + ord = Integer.parseInt(node.getNodeValue()); + } catch (NumberFormatException e) { + throw new SclParseException("EnumVal contains invalid \"ord\" number."); + } + } + + public String getId() { + return id; + } + + public int getOrd() { + return ord; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/LnSubDef.java b/src/main/java/org/openmuc/openiec61850/internal/scl/LnSubDef.java new file mode 100644 index 0000000..32f81db --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/LnSubDef.java @@ -0,0 +1,32 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.LogicalNode; +import org.w3c.dom.Node; + +public class LnSubDef { + + public Node defXmlNode; + public LogicalNode logicalNode; + + public LnSubDef(Node dataSetDefXmlNode, LogicalNode logicalNode) { + defXmlNode = dataSetDefXmlNode; + this.logicalNode = logicalNode; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/LnType.java b/src/main/java/org/openmuc/openiec61850/internal/scl/LnType.java new file mode 100644 index 0000000..19aa349 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/LnType.java @@ -0,0 +1,50 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import java.util.ArrayList; +import java.util.List; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public final class LnType extends AbstractType { + + // attributes not needed: lnClass, iedType + + public List dos = new ArrayList<>(); + + public LnType(Node xmlNode) throws SclParseException { + + super(xmlNode); + + if (xmlNode.getAttributes().getNamedItem("lnClass") == null) { + throw new SclParseException("Required attribute \"lnClass\" not found in LNType!"); + } + + NodeList elements = xmlNode.getChildNodes(); + + for (int i = 0; i < elements.getLength(); i++) { + Node node = elements.item(i); + if (node.getNodeName().equals("DO")) { + dos.add(new Do(node)); + } + } + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/Sdo.java b/src/main/java/org/openmuc/openiec61850/internal/scl/Sdo.java new file mode 100644 index 0000000..c65e115 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/Sdo.java @@ -0,0 +1,48 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.SclParseException; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +public final class Sdo extends AbstractElement { + + private String type = null; + + public Sdo(String name, String desc, DoType type) { + super(name, desc); + } + + public Sdo(Node xmlNode) throws SclParseException { + super(xmlNode); + + NamedNodeMap attributes = xmlNode.getAttributes(); + + Node node = attributes.getNamedItem("type"); + + if (node == null) { + throw new SclParseException("Required attribute \"type\" not found!"); + } + + type = node.getNodeValue(); + } + + public String getType() { + return type; + } +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/TypeDefinitions.java b/src/main/java/org/openmuc/openiec61850/internal/scl/TypeDefinitions.java new file mode 100644 index 0000000..0e4c2b3 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/TypeDefinitions.java @@ -0,0 +1,88 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import java.util.ArrayList; + +public final class TypeDefinitions { + + private final ArrayList lnodeTypes = new ArrayList<>(); + private final ArrayList doTypes = new ArrayList<>(); + private final ArrayList daTypes = new ArrayList<>(); + private final ArrayList enumTypes = new ArrayList<>(); + + public TypeDefinitions() { + } + + public void putLNodeType(LnType lnodeType) { + lnodeTypes.add(lnodeType); + } + + public void putDOType(DoType doType) { + doTypes.add(doType); + } + + public void putDAType(DaType daType) { + daTypes.add(daType); + } + + public void putEnumType(EnumType enumType) { + enumTypes.add(enumType); + } + + public DaType getDaType(String daType) { + for (DaType datype : daTypes) { + if (datype.id.equals(daType)) { + return datype; + } + } + + return null; + } + + public DoType getDOType(String doType) { + for (DoType dotype : doTypes) { + if (dotype.id.equals(doType)) { + return dotype; + } + } + + return null; + } + + public LnType getLNodeType(String lnType) { + + for (LnType ntype : lnodeTypes) { + if (ntype.id.equals(lnType)) { + return ntype; + } + } + + return null; + } + + public EnumType getEnumType(String enumTypeRef) { + for (EnumType enumType : enumTypes) { + if (enumType.id.equals(enumTypeRef)) { + return enumType; + } + } + + return null; + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/Util.java b/src/main/java/org/openmuc/openiec61850/internal/scl/Util.java new file mode 100644 index 0000000..cffece2 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/Util.java @@ -0,0 +1,112 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +import org.openmuc.openiec61850.SclParseException; + +public final class Util { + + static boolean parseBooleanValue(String value) throws SclParseException { + if (value.equals("true")) { + return true; + } + else if (value.equals("false")) { + return false; + } + else { + throw new SclParseException("Not a boolean value"); + } + } + + public static boolean isBasicType(String bType) throws SclParseException { + if (bType.equals("BOOLEAN")) { + return true; + } + if (bType.equals("INT8")) { + return true; + } + if (bType.equals("INT16")) { + return true; + } + if (bType.equals("INT32")) { + return true; + } + if (bType.equals("INT64")) { + return true; + } + if (bType.equals("INT8U")) { + return true; + } + if (bType.equals("INT16U")) { + return true; + } + if (bType.equals("INT32U")) { + return true; + } + if (bType.equals("FLOAT32")) { + return true; + } + if (bType.equals("FLOAT64")) { + return true; + } + if (bType.equals("Timestamp")) { + return true; + } + if (bType.equals("VisString32")) { + return true; + } + if (bType.equals("VisString64")) { + return true; + } + if (bType.equals("VisString65")) { + return true; + } + if (bType.equals("VisString129")) { + return true; + } + if (bType.equals("VisString255")) { + return true; + } + if (bType.equals("Unicode255")) { + return true; + } + if (bType.equals("Octet64")) { + return true; + } + if (bType.equals("Struct")) { + return false; + } + if (bType.equals("Enum")) { + return true; + } + if (bType.equals("Quality")) { + return true; + } + if (bType.equals("Check")) { + return true; + } + if (bType.equals("Dbpos")) { + return true; + } + if (bType.equals("Tcmd")) { + return true; + } + + throw new SclParseException("Invalid bType: " + bType); + } + +} diff --git a/src/main/java/org/openmuc/openiec61850/internal/scl/Value.java b/src/main/java/org/openmuc/openiec61850/internal/scl/Value.java new file mode 100644 index 0000000..bf316f9 --- /dev/null +++ b/src/main/java/org/openmuc/openiec61850/internal/scl/Value.java @@ -0,0 +1,23 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.openiec61850.internal.scl; + +public final class Value { + + public int sGroup; + public String value; +} diff --git a/src/run-scripts/console-client/openiec61850-console-client b/src/run-scripts/console-client/openiec61850-console-client new file mode 100755 index 0000000..9780588 --- /dev/null +++ b/src/run-scripts/console-client/openiec61850-console-client @@ -0,0 +1,20 @@ +#!/bin/bash + +JARS_LOCATION="../../build/libs-all" +MAIN_CLASS="org.openmuc.openiec61850.app.ConsoleClient" +SYSPROPS="" +PARAMS="" + +SCRIPT_HOME=`dirname $0` + +CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") + +for i in $@; do + if [[ $i == -D* ]]; then + SYSPROPS="$SYSPROPS $i"; + else + PARAMS="$PARAMS $i"; + fi +done + +java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS diff --git a/src/run-scripts/console-client/openiec61850-console-client.bat b/src/run-scripts/console-client/openiec61850-console-client.bat new file mode 100644 index 0000000..938643c --- /dev/null +++ b/src/run-scripts/console-client/openiec61850-console-client.bat @@ -0,0 +1,6 @@ +::BATCH file for windows + +set BATDIR=%~dp0 +set LIBDIR=%BATDIR%..\..\build\libs-all + +java -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.app.ConsoleClient %* diff --git a/src/run-scripts/console-server/logback.xml b/src/run-scripts/console-server/logback.xml new file mode 100644 index 0000000..fcd468f --- /dev/null +++ b/src/run-scripts/console-server/logback.xml @@ -0,0 +1,16 @@ + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + diff --git a/src/run-scripts/console-server/openiec61850-console-server b/src/run-scripts/console-server/openiec61850-console-server new file mode 100755 index 0000000..33d11ff --- /dev/null +++ b/src/run-scripts/console-server/openiec61850-console-server @@ -0,0 +1,37 @@ +#!/bin/bash + +JARS_LOCATION="../../build/libs-all" +MAIN_CLASS="org.openmuc.openiec61850.app.ConsoleServer" +SYSPROPS="-Dlogback.configurationFile=logback.xml" + +# from gradle start script: +# Attempt to set SCRIPT_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +SCRIPT_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + + +CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") + +for i in $@; do + if [[ $i == -D* ]]; then + SYSPROPS="$SYSPROPS $i"; + else + PARAMS="$PARAMS $i"; + fi +done + +java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS diff --git a/src/run-scripts/console-server/openiec61850-console-server.bat b/src/run-scripts/console-server/openiec61850-console-server.bat new file mode 100644 index 0000000..fdb9766 --- /dev/null +++ b/src/run-scripts/console-server/openiec61850-console-server.bat @@ -0,0 +1,6 @@ +::BATCH file to windows + +set BATDIR=%~dp0 +set LIBDIR=%BATDIR%..\..\build\libs-all + +java -Dlogback.configurationFile=logback.xml -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.app.ConsoleServer %* diff --git a/src/run-scripts/console-server/sample-model.icd b/src/run-scripts/console-server/sample-model.icd new file mode 100644 index 0000000..68d7863 --- /dev/null +++ b/src/run-scripts/console-server/sample-model.icd @@ -0,0 +1,293 @@ + + + +
+ + + Station bus + 10 + +
+

10.0.0.3

+

255.255.255.0

+

10.0.0.101

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + direct-with-normal-security + + + + + 1000 + + + sbo-with-normal-security + + + + + direct-with-enhanced-security + + + + + sbo-with-enhanced-security + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + diff --git a/src/run-scripts/gui-client/openiec61850-gui-client b/src/run-scripts/gui-client/openiec61850-gui-client new file mode 100755 index 0000000..96f038a --- /dev/null +++ b/src/run-scripts/gui-client/openiec61850-gui-client @@ -0,0 +1,39 @@ +#!/bin/bash + +JARS_LOCATION="../../build/libs-all" +MAIN_CLASS="org.openmuc.openiec61850.clientgui.ClientGui" +SYSPROPS="" +PARAMS="" + +# from gradle start script: +# Attempt to set SCRIPT_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +SCRIPT_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + + +CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") + +for i in $@; do + if [[ $i == -D* ]]; then + SYSPROPS="$SYSPROPS $i"; + else + PARAMS="$PARAMS $i"; + fi +done + +java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS + diff --git a/src/run-scripts/gui-client/openiec61850-gui-client.bat b/src/run-scripts/gui-client/openiec61850-gui-client.bat new file mode 100644 index 0000000..5cb44fb --- /dev/null +++ b/src/run-scripts/gui-client/openiec61850-gui-client.bat @@ -0,0 +1,6 @@ +::BATCH file to windows + +set BATDIR=%~dp0 +set LIBDIR=%BATDIR%..\..\build\libs-all + +java -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.clientgui.ClientGui %* diff --git a/src/test/java/.gitignore b/src/test/java/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/src/test/java/org/openmuc/josistack/ClientServerITest.java b/src/test/java/org/openmuc/josistack/ClientServerITest.java new file mode 100644 index 0000000..5ae4442 --- /dev/null +++ b/src/test/java/org/openmuc/josistack/ClientServerITest.java @@ -0,0 +1,157 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.josistack; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.Collections; +import java.util.concurrent.TimeoutException; + +import org.junit.Assert; +import org.junit.Test; + +public class ClientServerITest { + + private final byte[] mmsInitRequestPDU = new byte[] { (byte) 0xa8, 0x26, (byte) 0x80, 0x03, 0x00, (byte) 0xfd, + (byte) 0xe8, (byte) 0x81, 0x01, 0x06, (byte) 0x82, 0x01, 0x06, (byte) 0x83, 0x01, 0x06, (byte) 0xa4, 0x16, + (byte) 0x80, 0x01, 0x01, (byte) 0x81, 0x03, 0x05, (byte) 0xf1, 0x00, (byte) 0x82, 0x0c, 0x03, (byte) 0xee, + 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, (byte) 0xef, 0x18 }; + + private final byte[] testData = { 2, 1, 1 }; + + public class SampleServer implements AcseAssociationListener { + + @Override + public void serverStoppedListeningIndication(IOException e) { + } + + @Override + public void connectionIndication(AcseAssociation acseAssociation, ByteBuffer data) { + + try { + acseAssociation.accept(data); + } catch (IOException e) { + System.err.println("Caught accepting association:"); + e.printStackTrace(); + return; + } + + ByteBuffer receivedData = ByteBuffer.allocate(1000); + try { + acseAssociation.receive(receivedData); + } catch (IOException e) { + System.err.println("Caught exception receiving data:"); + e.printStackTrace(); + return; + } catch (TimeoutException e) { + e.printStackTrace(); + } catch (DecodingException e) { + e.printStackTrace(); + } + + try { + acseAssociation.send(receivedData); + } catch (IOException e) { + System.err.println("Caught exception sending data:"); + e.printStackTrace(); + return; + } + + } + } + + @Test + public void testClientServerCom() throws IOException, TimeoutException, DecodingException { + + int port = 14322; + + ServerAcseSap serverAcseSAP = new ServerAcseSap(port, 0, null, new SampleServer()); + serverAcseSAP.serverTSap.setMessageTimeout(6000); + + serverAcseSAP.startListening(); + + InetAddress address = InetAddress.getByName("127.0.0.1"); + + ClientAcseSap clientAcseSap = new ClientAcseSap(); + clientAcseSap.tSap.setMaxTPDUSizeParam(7); + clientAcseSap.tSap.setMessageTimeout(6000); + clientAcseSap.pSelLocal = new byte[] { 0x1, 0x1, 0x1, 0x1 }; + + AcseAssociation acseAssociation = clientAcseSap.associate(address, port, null, -1, null, + ByteBuffer.wrap(mmsInitRequestPDU)); + + ByteBuffer associationResponsePDU = acseAssociation.getAssociateResponseAPdu(); + + // Assert.assertThat(findSubArr(associationResponsePDU.array(), mmsInitRequestPDU), is(not(0))); + + acseAssociation.send(ByteBuffer.wrap(testData)); + + ByteBuffer receivedData = ByteBuffer.allocate(10000); + + acseAssociation.receive(receivedData); + + Assert.assertThat(findSubArr(receivedData.array(), testData), is(not(0))); + + acseAssociation.disconnect(); + + serverAcseSAP.stopListening(); + } + + public static int findArray(Byte[] array, Byte[] subArray) { + return Collections.indexOfSubList(Arrays.asList(array), Arrays.asList(subArray)); + } + + public static String getByteArrayString(byte[] byteArray) { + StringBuilder builder = new StringBuilder(); + int l = 1; + for (byte b : byteArray) { + if ((l != 1) && ((l - 1) % 8 == 0)) { + builder.append(' '); + } + if ((l != 1) && ((l - 1) % 16 == 0)) { + builder.append('\n'); + } + l++; + builder.append("0x"); + String hexString = Integer.toHexString(b & 0xff); + if (hexString.length() == 1) { + builder.append(0); + } + builder.append(hexString + " "); + } + return builder.toString(); + } + + int findSubArr(byte[] arr, byte[] subarr) { + int lim = arr.length - subarr.length; + byte[] tmpArr = new byte[subarr.length]; + for (int i = 0; i <= lim; i++) { + System.arraycopy(arr, i, tmpArr, 0, subarr.length); + if (Arrays.equals(tmpArr, subarr)) { + return i; // returns starting index of sub array + } + } + return -1;// return -1 on finding no sub-array + + } + +} diff --git a/src/test/java/org/openmuc/josistack/SiemensClientITest.java b/src/test/java/org/openmuc/josistack/SiemensClientITest.java new file mode 100644 index 0000000..3c01cf0 --- /dev/null +++ b/src/test/java/org/openmuc/josistack/SiemensClientITest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.josistack; + +import java.io.BufferedOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.Socket; +import java.nio.ByteBuffer; + +import org.junit.Assert; +import org.junit.Test; + +public class SiemensClientITest { + + public static boolean success = false; + + private final byte[] iso8073ConPacket = new byte[] { (byte) 0x03, 0x00, 0x00, 0x16, 0x11, (byte) 0xe0, 0x00, 0x00, + 0x00, 0x44, 0x00, (byte) 0xc1, 0x02, 0x00, 0x01, (byte) 0xc2, 0x02, 0x00, 0x01, (byte) 0xc0, 0x01, 0x0d }; + private final byte[] mmsConPacket = new byte[] { 0x03, (byte) 0x00, (byte) 0x00, (byte) 0xcd, (byte) 0x02, + (byte) 0xf0, (byte) 0x80, (byte) 0x0d, (byte) 0xc4, (byte) 0x05, (byte) 0x06, (byte) 0x13, (byte) 0x01, + (byte) 0x00, (byte) 0x16, (byte) 0x01, (byte) 0x02, (byte) 0x14, (byte) 0x02, (byte) 0x00, (byte) 0x02, + (byte) 0x33, (byte) 0x02, (byte) 0x00, (byte) 0x01, (byte) 0x34, (byte) 0x02, (byte) 0x00, (byte) 0x01, + (byte) 0xc1, (byte) 0xae, (byte) 0x31, (byte) 0x81, (byte) 0xab, (byte) 0xa0, (byte) 0x03, (byte) 0x80, + (byte) 0x01, (byte) 0x01, (byte) 0xa2, (byte) 0x81, (byte) 0xa3, (byte) 0x81, (byte) 0x04, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x82, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x01, (byte) 0xa4, (byte) 0x23, (byte) 0x30, (byte) 0x0f, (byte) 0x02, (byte) 0x01, (byte) 0x01, + (byte) 0x06, (byte) 0x04, (byte) 0x52, (byte) 0x01, (byte) 0x00, (byte) 0x01, (byte) 0x30, (byte) 0x04, + (byte) 0x06, (byte) 0x02, (byte) 0x51, (byte) 0x01, (byte) 0x30, (byte) 0x10, (byte) 0x02, (byte) 0x01, + (byte) 0x03, (byte) 0x06, (byte) 0x05, (byte) 0x28, (byte) 0xca, (byte) 0x22, (byte) 0x02, (byte) 0x01, + (byte) 0x30, (byte) 0x04, (byte) 0x06, (byte) 0x02, (byte) 0x51, (byte) 0x01, (byte) 0x88, (byte) 0x02, + (byte) 0x06, (byte) 0x00, (byte) 0x61, (byte) 0x6c, (byte) 0x30, (byte) 0x6a, (byte) 0x02, (byte) 0x01, + (byte) 0x01, (byte) 0xa0, (byte) 0x65, (byte) 0x60, (byte) 0x63, (byte) 0x80, (byte) 0x02, (byte) 0x07, + (byte) 0x80, (byte) 0xa1, (byte) 0x07, (byte) 0x06, (byte) 0x05, (byte) 0x28, (byte) 0xca, (byte) 0x22, + (byte) 0x02, (byte) 0x03, (byte) 0xa2, (byte) 0x06, (byte) 0x06, (byte) 0x04, (byte) 0x2b, (byte) 0xce, + (byte) 0x0f, (byte) 0x17, (byte) 0xa3, (byte) 0x03, (byte) 0x02, (byte) 0x01, (byte) 0x17, (byte) 0xa4, + (byte) 0x03, (byte) 0x02, (byte) 0x01, (byte) 0x00, (byte) 0xa5, (byte) 0x03, (byte) 0x02, (byte) 0x01, + (byte) 0x00, (byte) 0xa6, (byte) 0x06, (byte) 0x06, (byte) 0x04, (byte) 0x2b, (byte) 0xce, (byte) 0x0f, + (byte) 0x69, (byte) 0xa7, (byte) 0x03, (byte) 0x02, (byte) 0x01, (byte) 0x21, (byte) 0xbe, (byte) 0x30, + (byte) 0x28, (byte) 0x2e, (byte) 0x02, (byte) 0x01, (byte) 0x03, (byte) 0xa0, (byte) 0x29, (byte) 0xa8, + (byte) 0x27, (byte) 0x80, (byte) 0x02, (byte) 0x75, (byte) 0x30, (byte) 0x81, (byte) 0x02, (byte) 0x03, + (byte) 0xe8, (byte) 0x82, (byte) 0x02, (byte) 0x03, (byte) 0xe8, (byte) 0x83, (byte) 0x01, (byte) 0x05, + (byte) 0xa4, (byte) 0x16, (byte) 0x80, (byte) 0x01, (byte) 0x02, (byte) 0x81, (byte) 0x03, (byte) 0x05, + (byte) 0xfb, (byte) 0x00, (byte) 0x82, (byte) 0x0c, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00 }; + + public class SampleServer implements AcseAssociationListener { + + @Override + public void serverStoppedListeningIndication(IOException e) { + // System.out.println("Got indication that Server stopped listening."); + } + + @Override + public void connectionIndication(AcseAssociation acseAssociation, ByteBuffer data) { + + try { + acseAssociation.accept(data); + } catch (IOException e) { + System.err.println("Caught accepting association:"); + e.printStackTrace(); + return; + } + + SiemensClientITest.success = true; + + } + } + + @Test + public void testClientServerCom() throws IOException, InterruptedException { + + int port = 14322; + + ServerAcseSap serverAcseSAP = new ServerAcseSap(port, 0, null, new SampleServer()); + serverAcseSAP.serverTSap.setMessageTimeout(6000); + serverAcseSAP.startListening(); + + Socket socket = new Socket("localhost", port); + DataOutputStream dataOutputStream = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); + dataOutputStream.write(iso8073ConPacket); + dataOutputStream.write(mmsConPacket); + dataOutputStream.flush(); + + Thread.sleep(2000); + + Assert.assertTrue(success); + + serverAcseSAP.stopListening(); + } + +} diff --git a/src/test/java/org/openmuc/jositransport/ClientServerITest.java b/src/test/java/org/openmuc/jositransport/ClientServerITest.java new file mode 100644 index 0000000..2151f5d --- /dev/null +++ b/src/test/java/org/openmuc/jositransport/ClientServerITest.java @@ -0,0 +1,181 @@ +/* + * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.openmuc.jositransport; + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeoutException; + +import org.junit.Test; + +public class ClientServerITest { + + public class SampleServer implements TConnectionListener { + + @Override + public void connectionIndication(TConnection tConnection) { + + ByteBuffer pduBuffer = ByteBuffer.allocate(600); + + try { + tConnection.receive(pduBuffer); + } catch (IOException e1) { + System.err.println("Caught exception reading data:" + e1.getMessage()); + e1.printStackTrace(); + return; + } catch (TimeoutException e) { + System.err.println("Caught TimeoutException reading data:" + e.getMessage()); + e.printStackTrace(); + } + + try { + tConnection.send(pduBuffer.array(), pduBuffer.position(), pduBuffer.limit() - pduBuffer.position()); + } catch (IOException e) { + System.err.println("Caught exception writing data:"); + e.printStackTrace(); + return; + } + } + + @Override + public void serverStoppedListeningIndication(IOException e) { + System.out.println("Got an indication that the server stopped listening."); + } + + } + + @Test + public void testClientServerCom() throws IOException, TimeoutException { + + int port = 18982; + + ServerTSap serverTSAP = new ServerTSap(port, new SampleServer()); + + serverTSAP.startListening(); + + InetAddress address = InetAddress.getByName("127.0.0.1"); + + ClientTSap tSAP = new ClientTSap(); + tSAP.setMaxTPDUSizeParam(7); + TConnection tConnection = null; + + tConnection = tSAP.connectTo(address, port); + + byte[] testData = { (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d, (byte) 0x0e, + (byte) 0x0f, }; + + List testDataList = new ArrayList<>(); + testDataList.add(testData); + testDataList.add(testData); + + List offsetList = new ArrayList<>(); + offsetList.add(0); + offsetList.add(0); + + List lengthList = new ArrayList<>(); + lengthList.add(testData.length); + lengthList.add(testData.length); + + tConnection.send(testDataList, offsetList, lengthList); + + tConnection.setMessageTimeout(1000); + + ByteBuffer pduBuffer = ByteBuffer.allocate(600); + + tConnection.receive(pduBuffer); + + byte[] subArrayOfReturnedData = new byte[pduBuffer.limit() - pduBuffer.position()]; + + System.arraycopy(pduBuffer.array(), pduBuffer.arrayOffset() + pduBuffer.position(), subArrayOfReturnedData, 0, + subArrayOfReturnedData.length); + + Arrays.equals(subArrayOfReturnedData, concat(testData, testData)); + + tConnection.disconnect(); + + serverTSAP.stopListening(); + } + + public static String getByteArrayString(byte[] byteArray) { + StringBuilder builder = new StringBuilder(); + int l = 1; + for (byte b : byteArray) { + if ((l != 1) && ((l - 1) % 8 == 0)) { + builder.append(' '); + } + if ((l != 1) && ((l - 1) % 16 == 0)) { + builder.append('\n'); + } + l++; + builder.append("0x"); + String hexString = Integer.toHexString(b & 0xff); + if (hexString.length() == 1) { + builder.append(0); + } + builder.append(hexString + " "); + } + return builder.toString(); + } + + byte[] concat(byte[] A, byte[] B) { + byte[] C = new byte[A.length + B.length]; + System.arraycopy(A, 0, C, 0, A.length); + System.arraycopy(B, 0, C, A.length, B.length); + + return C; + } + +} diff --git a/src/test/java/org/openmuc/openiec61850/integrationtests/ClientServerITest.java b/src/test/java/org/openmuc/openiec61850/integrationtests/ClientServerITest.java new file mode 100644 index 0000000..62d7eeb --- /dev/null +++ b/src/test/java/org/openmuc/openiec61850/integrationtests/ClientServerITest.java @@ -0,0 +1,521 @@ +package org.openmuc.openiec61850.integrationtests; + +import java.io.IOException; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import javax.naming.ConfigurationException; + +import org.junit.Assert; +import org.junit.Test; +import org.openmuc.openiec61850.BasicDataAttribute; +import org.openmuc.openiec61850.BdaBoolean; +import org.openmuc.openiec61850.BdaFloat32; +import org.openmuc.openiec61850.BdaInt32; +import org.openmuc.openiec61850.BdaInt32U; +import org.openmuc.openiec61850.BdaQuality; +import org.openmuc.openiec61850.BdaQuality.Validity; +import org.openmuc.openiec61850.BdaReasonForInclusion; +import org.openmuc.openiec61850.BdaTimestamp; +import org.openmuc.openiec61850.BdaVisibleString; +import org.openmuc.openiec61850.ClientAssociation; +import org.openmuc.openiec61850.ClientEventListener; +import org.openmuc.openiec61850.ClientSap; +import org.openmuc.openiec61850.DataSet; +import org.openmuc.openiec61850.Fc; +import org.openmuc.openiec61850.FcModelNode; +import org.openmuc.openiec61850.ModelNode; +import org.openmuc.openiec61850.Report; +import org.openmuc.openiec61850.SclParseException; +import org.openmuc.openiec61850.ServerEventListener; +import org.openmuc.openiec61850.ServerModel; +import org.openmuc.openiec61850.ServerSap; +import org.openmuc.openiec61850.ServiceError; +import org.openmuc.openiec61850.Urcb; + +public class ClientServerITest extends Thread implements ServerEventListener, ClientEventListener { + + int port = 54321; + String host = "127.0.0.1"; + ClientSap clientSap = new ClientSap(); + ServerSap serverSap = null; + ClientAssociation clientAssociation = null; + ClientAssociation clientAssociation2 = null; + ServerModel serversServerModel = null; + private static int numReports = 0; + private static int numSuccess = 0; + private static int numAssociationClosed = 0; + + // Get the Java runtime + public static Runtime runtime = Runtime.getRuntime(); + + @Test + public void testClientServerCom() throws IOException, ServiceError, ConfigurationException, + javax.naming.ConfigurationException, SclParseException, InterruptedException { + + clientSap.setTSelRemote(new byte[] { 0, 1 }); + clientSap.setTSelLocal(new byte[] { 0, 0 }); + clientSap.setApTitleCalled(new int[] { 1, 1, 999, 1 }); + BdaTimestamp timestamp; + BdaVisibleString namePlateVendor; + + // --------------------------------------------------- + // ------------------1st test server------------------ + runServer("src/test/resources/openiec61850sample01.icd", port); + System.out.println("IED Server is running"); + + // ----------------------------------------------------------- + // Client + // ----------------------------------------------------------- + + System.out.println("Attempting to connect to server " + host + " on port " + port); + + clientAssociation = clientSap.associate(InetAddress.getByName(host), port, null, this); + + // ServerModel serverModel = clientAssociation.retrieveModel(); + ServerModel serverModel = clientAssociation.getModelFromSclFile("src/test/resources/openiec61850sample01.icd"); + + getAllBdas(serverModel); + + timestamp = (BdaTimestamp) serverModel.findModelNode("ied1lDevice1/MMXU1.TotW.t", Fc.MX); + clientAssociation.getDataValues(timestamp); + + namePlateVendor = (BdaVisibleString) serverModel.findModelNode("ied1lDevice1/LLN0.NamPlt.vendor", Fc.DC); + namePlateVendor.setValue("Fraunhofer ISE".getBytes()); + clientAssociation.setDataValues(namePlateVendor); + namePlateVendor.setDefault(); + clientAssociation.getDataValues(namePlateVendor); + + Assert.assertEquals("Fraunhofer ISE", new String(namePlateVendor.getValue())); + + // -------------Test DataSets-Start--------------------- + + Collection dataSets = serverModel.getDataSets(); + Assert.assertEquals(2, dataSets.size()); + + DataSet dataSet1 = serverModel.getDataSet("ied1lDevice1/LLN0.dataset1"); + + Assert.assertEquals("ied1lDevice1/LLN0.dataset1", dataSet1.getReferenceStr()); + + DataSet dataSet2 = serverModel.getDataSet("ied1lDevice1/LLN0.dataset2"); + + Assert.assertEquals("ied1lDevice1/LLN0.dataset2", dataSet2.getReferenceStr()); + + for (FcModelNode dataSet2Member : dataSet2) { + ((BdaInt32) dataSet2Member).setValue(9); + } + + clientAssociation.setDataSetValues(dataSet2); + + dataSet1 = serverModel.getDataSet(dataSet1.getReferenceStr()); + + clientAssociation.getDataSetValues(dataSet1); + + List nonPersistentDataSetMembers = new ArrayList<>(2); + nonPersistentDataSetMembers.add(namePlateVendor); + nonPersistentDataSetMembers.add(timestamp); + + DataSet nonPersistentDataSet = new DataSet("@nonPersistentDataSet", nonPersistentDataSetMembers); + + clientAssociation.createDataSet(nonPersistentDataSet); + + namePlateVendor.setDefault(); + + List serviceErrors = clientAssociation.getDataSetValues(nonPersistentDataSet); + + for (ServiceError serviceError : serviceErrors) { + Assert.assertNull(serviceError); + } + + Assert.assertTrue("Fraunhofer ISE".equals(new String(namePlateVendor.getValue()))); + + clientAssociation.deleteDataSet(nonPersistentDataSet); + + serviceErrors = clientAssociation.getDataSetValues(nonPersistentDataSet); + + Assert.assertEquals(2, serviceErrors.size()); + + for (ServiceError serviceError : serviceErrors) { + Assert.assertNotNull(serviceError); + } + + // -------------Test DataSets-End--------------------- + + serverModel.findModelNode("ied1lDevice1/MMXU1.TotW", Fc.MX); + + BdaFloat32 f = (BdaFloat32) serverModel.findModelNode("ied1lDevice1/MMXU1.W.phsA.cVal.mag.f", Fc.MX); + + f.setFloat(3.0f); + + Assert.assertEquals(f.getFloat(), 3.0f, 0.00001); + + clientAssociation.getDataSetValues(dataSet1); + + Assert.assertEquals(f.getFloat(), 0.0f, 0.00001); + + /* Test selecting a controllable Data Object */ + + BdaInt32U sboTimeout = (BdaInt32U) serverModel.findModelNode("ied1lDevice1/CSWI1.PosA.sboTimeout", Fc.CF); + sboTimeout.setValue(2000l); + + BdaVisibleString sbo = (BdaVisibleString) serverModel.findModelNode("ied1lDevice1/CSWI1.PosA.SBO", Fc.CO); + + Assert.assertNotNull(sbo); + + clientAssociation.getDataValues(sbo); + + Assert.assertTrue(sbo.getStringValue().equals("success")); + + clientAssociation.getDataValues(sbo); + + Assert.assertEquals(sbo.getStringValue(), "success"); + + /* select with second connection */ + + clientAssociation2 = clientSap.associate(InetAddress.getByName(host), port, null, this); + ServerModel serverModel2 = clientAssociation2.retrieveModel(); + + BdaVisibleString sbo2 = (BdaVisibleString) serverModel2.findModelNode("ied1lDevice1/CSWI1.PosA.SBO", Fc.CO); + + clientAssociation2.getDataValues(sbo2); + Assert.assertEquals(sbo2.getStringValue(), ""); + + /* select with second connection after the sboTimeout of 1000ms should have been run out */ + + // clientAssociation.close(); + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + clientAssociation2.getDataValues(sbo2); + Assert.assertEquals(sbo2.getStringValue(), "success"); + + /* select with first connnection after the second was quit */ + + clientAssociation.getDataValues(sbo); + Assert.assertEquals(sbo.getStringValue(), ""); + + clientAssociation2.close(); + + try { + Thread.sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + clientAssociation.getDataValues(sbo); + Assert.assertEquals(sbo.getStringValue(), "success"); + + FcModelNode switchPosAFcDo = (FcModelNode) serverModel.findModelNode("ied1lDevice1/CSWI1.PosA", Fc.CO); + + Assert.assertNotNull(switchPosAFcDo); + + clientAssociation.operate(switchPosAFcDo); + + // -------------Test Reporting-Start------------------- + + Urcb urcb1 = serverModel.getUrcb("ied1lDevice1/LLN0.urcb101"); + Assert.assertNotNull(urcb1); + + Urcb urcb2 = serverModel.getUrcb("ied1lDevice1/LLN0.urcb2"); + Assert.assertNotNull(urcb2); + + clientAssociation.getRcbValues(urcb1); + clientAssociation.getRcbValues(urcb2); + + BdaBoolean resv = (BdaBoolean) urcb1.getChild("Resv"); + Assert.assertNotNull(resv); + clientAssociation.getDataValues(resv); + Assert.assertFalse(resv.getValue()); + clientAssociation.reserveUrcb(urcb1); + clientAssociation.getDataValues(resv); + Assert.assertTrue(resv.getValue()); + + Assert.assertEquals("urcb1", urcb1.getRptId().getStringValue()); + Assert.assertEquals("ied1lDevice1/LLN0.urcb2", urcb2.getRptId().getStringValue()); + + Assert.assertEquals("ied1lDevice1/LLN0$dataset1", urcb1.getDatSet().getStringValue()); + Assert.assertEquals("ied1lDevice1/LLN0$dataset1", urcb2.getDatSet().getStringValue()); + + Assert.assertEquals(true, urcb1.getOptFlds().isDataSetName()); + Assert.assertEquals(false, urcb1.getOptFlds().isBufferOverflow()); + Assert.assertEquals(false, urcb1.getOptFlds().isConfigRevision()); + Assert.assertEquals(false, urcb1.getOptFlds().isDataReference()); + Assert.assertEquals(false, urcb1.getOptFlds().isEntryId()); + Assert.assertEquals(true, urcb1.getOptFlds().isReasonForInclusion()); + Assert.assertEquals(true, urcb1.getOptFlds().isReportTimestamp()); + Assert.assertEquals(false, urcb1.getOptFlds().isSegmentation()); + Assert.assertEquals(true, urcb1.getOptFlds().isSequenceNumber()); + + Assert.assertEquals(false, urcb2.getOptFlds().isDataSetName()); + Assert.assertEquals(false, urcb2.getOptFlds().isBufferOverflow()); + Assert.assertEquals(false, urcb2.getOptFlds().isConfigRevision()); + Assert.assertEquals(false, urcb2.getOptFlds().isDataReference()); + Assert.assertEquals(false, urcb2.getOptFlds().isEntryId()); + Assert.assertEquals(false, urcb2.getOptFlds().isReasonForInclusion()); + Assert.assertEquals(false, urcb2.getOptFlds().isReportTimestamp()); + Assert.assertEquals(false, urcb2.getOptFlds().isSegmentation()); + Assert.assertEquals(false, urcb2.getOptFlds().isSequenceNumber()); + + Assert.assertEquals(50L, urcb1.getBufTm().getValue()); + + Assert.assertEquals(true, urcb1.getTrgOps().isDataChange()); + Assert.assertEquals(true, urcb1.getTrgOps().isDataUpdate()); + Assert.assertEquals(true, urcb1.getTrgOps().isGeneralInterrogation()); + Assert.assertEquals(false, urcb1.getTrgOps().isIntegrity()); + Assert.assertEquals(true, urcb1.getTrgOps().isQualityChange()); + + Assert.assertEquals(false, urcb2.getTrgOps().isDataChange()); + Assert.assertEquals(false, urcb2.getTrgOps().isDataUpdate()); + Assert.assertEquals(true, urcb2.getTrgOps().isGeneralInterrogation()); + Assert.assertEquals(false, urcb2.getTrgOps().isIntegrity()); + Assert.assertEquals(false, urcb2.getTrgOps().isQualityChange()); + + Assert.assertEquals(5000L, urcb1.getIntgPd().getValue()); + + Assert.assertEquals(0, urcb1.getSqNum().getValue()); + + Assert.assertEquals(0L, urcb1.getConfRev().getValue()); + + urcb1.getRptId().setValue("myurcb1"); + urcb1.getTrgOps().setGeneralInterrogation(false); + urcb1.getTrgOps().setDataUpdate(false); + urcb1.getTrgOps().setDataChange(false); + + clientAssociation.setRcbValues(urcb1, true, true, true, true, true, true, true, true); + + urcb1.getRptId().setValue("fasdfsadf"); + + clientAssociation.getRcbValues(urcb1); + + Assert.assertEquals("myurcb1", urcb1.getRptId().getStringValue()); + + clientAssociation.reserveUrcb(urcb1); + clientAssociation.cancelUrcbReservation(urcb1); + clientAssociation.enableReporting(urcb1); + + boolean thrown = false; + try { + clientAssociation.startGi(urcb1); + } catch (ServiceError e) { + thrown = true; + } + Assert.assertTrue(thrown); + + urcb1.getTrgOps().setGeneralInterrogation(true); + urcb1.getTrgOps().setDataChange(true); + urcb1.getIntgPd().setValue(1000); + + serviceErrors = clientAssociation.setRcbValues(urcb1, false, false, false, false, true, true, false, false); + + Assert.assertNotNull(serviceErrors.get(0)); + clientAssociation.disableReporting(urcb1); + + serviceErrors = clientAssociation.setRcbValues(urcb1, false, false, false, false, true, true, false, false); + Assert.assertNull(serviceErrors.get(0)); + + clientAssociation.enableReporting(urcb1); + + clientAssociation.startGi(urcb1); + + Thread.sleep(4000); + + Assert.assertEquals(2, numReports); + Assert.assertEquals(2, numSuccess); + + clientAssociation.disableReporting(urcb1); + + urcb1.getTrgOps().setIntegrity(true); + serviceErrors = clientAssociation.setRcbValues(urcb1, false, false, false, false, true, false, false, false); + Assert.assertNull(serviceErrors.get(0)); + + clientAssociation.enableReporting(urcb1); + Thread.sleep(6500); + + Assert.assertEquals(8, numReports); + Assert.assertEquals(8, numSuccess); + + clientAssociation.disableReporting(urcb1); + + // -------------Test Reporting-End--------------------- + + clientAssociation.disconnect(); + + Thread.sleep(500); + Assert.assertEquals(2, numAssociationClosed); + + serverSap.stop(); + + } + + private void getAllBdas(ServerModel serverModel) throws ServiceError, IOException { + + for (ModelNode ld : serverModel) { + for (ModelNode ln : ld) { + getDataRecursive(ln, clientAssociation); + } + } + } + + private void runServer(String sclFilePath, int port) throws SclParseException, IOException { + + List serverSaps = null; + serverSaps = ServerSap.getSapsFromSclFile(sclFilePath); + + serverSap = serverSaps.get(0); + serverSap.setPort(port); + serverSap.startListening(this); + serversServerModel = serverSap.getModelCopy(); + start(); + } + + private static void getDataRecursive(ModelNode modelNode, ClientAssociation clientAssociation) + throws ServiceError, IOException { + if (modelNode.getChildren() == null) { + return; + } + for (ModelNode childNode : modelNode) { + FcModelNode fcChildNode = (FcModelNode) childNode; + if (fcChildNode.getFc() != Fc.CO) { + System.out.println("calling GetDataValues(" + childNode.getReference() + ")"); + clientAssociation.getDataValues(fcChildNode); + } + // clientAssociation.setDataValues(fcChildNode); + getDataRecursive(childNode, clientAssociation); + } + } + + public static int findArray(Byte[] array, Byte[] subArray) { + return Collections.indexOfSubList(Arrays.asList(array), Arrays.asList(subArray)); + } + + public static String getByteArrayString(byte[] byteArray) { + StringBuilder builder = new StringBuilder(); + int l = 1; + for (byte b : byteArray) { + if ((l != 1) && ((l - 1) % 8 == 0)) { + builder.append(' '); + } + if ((l != 1) && ((l - 1) % 16 == 0)) { + builder.append('\n'); + } + l++; + builder.append("0x"); + String hexString = Integer.toHexString(b & 0xff); + if (hexString.length() == 1) { + builder.append(0); + } + builder.append(hexString + " "); + } + return builder.toString(); + } + + @Override + public void serverStoppedListening(ServerSap serverSAP) { + // TODO Auto-generated method stub + } + + @Override + public List write(List bdas) { + System.out.println("DataSource: got write request"); + return null; + } + + @Override + public void run() { + + BdaFloat32 totWMag = (BdaFloat32) serversServerModel.findModelNode("ied1lDevice1/MMXU1.TotW.mag.f", Fc.MX); + BdaQuality q = (BdaQuality) serversServerModel.findModelNode("ied1lDevice1/MMXU1.TotW.q", Fc.MX); + BdaTimestamp t = (BdaTimestamp) serversServerModel.findModelNode("ied1lDevice1/MMXU1.TotW.t", Fc.MX); + + List totWBdas = new ArrayList<>(3); + totWBdas.add(totWMag); + totWBdas.add(q); + totWBdas.add(t); + + float totWMagVal = 0.0f; + q.setValidity(BdaQuality.Validity.GOOD); + + // for (int i = 0; i < 500000; i++) { + + totWMagVal += 1.0; + + System.out.println("setting totWmag to: " + totWMagVal); + totWMag.setFloat(totWMagVal); + t.setCurrentTime(); + + if (q.getValidity() == Validity.GOOD) { + q.setValidity(BdaQuality.Validity.INVALID); + } + else { + q.setValidity(BdaQuality.Validity.GOOD); + } + + try { + Thread.sleep(4000); + } catch (InterruptedException e) { + } + serverSap.setValues(totWBdas); + + // // Run the garbage collector + // runtime.gc(); + // // Calculate the used memory + // long memory = runtime.totalMemory() - runtime.freeMemory(); + // System.out.println("Used memory is bytes: " + memory); + // System.out.println("Used memory is megabytes: " + bytesToMegabytes(memory)); + + // try { + // Thread.sleep(2000); + // } catch (InterruptedException e) { + // } + // } + + } + + private static final long MEGABYTE = 1024L * 1024L; + + public static long bytesToMegabytes(long bytes) { + return bytes / MEGABYTE; + } + + @Override + public void newReport(Report report) { + System.out.println("got report!"); + numReports++; + + if (numReports == 1) { + List reasons = report.getReasonCodes(); + Assert.assertEquals(2, reasons.size()); + Assert.assertTrue(reasons.get(0).isGeneralInterrogation()); + Assert.assertFalse(reasons.get(0).isDataUpdate()); + } + else if (numReports == 2) { + List reasons = report.getReasonCodes(); + Assert.assertEquals(1, reasons.size()); + Assert.assertFalse(reasons.get(0).isGeneralInterrogation()); + Assert.assertTrue(reasons.get(0).isDataChange()); + } + else if (numReports >= 3) { + List reasons = report.getReasonCodes(); + Assert.assertEquals(2, reasons.size()); + Assert.assertTrue(reasons.get(0).isIntegrity()); + Assert.assertTrue(reasons.get(1).isIntegrity()); + } + + numSuccess++; + + } + + @Override + public void associationClosed(IOException e) { + System.out.println("Association closed!"); + numAssociationClosed++; + } +} diff --git a/src/test/java/org/openmuc/openiec61850/integrationtests/ClientServerITest2.java b/src/test/java/org/openmuc/openiec61850/integrationtests/ClientServerITest2.java new file mode 100644 index 0000000..5887d0c --- /dev/null +++ b/src/test/java/org/openmuc/openiec61850/integrationtests/ClientServerITest2.java @@ -0,0 +1,241 @@ +package org.openmuc.openiec61850.integrationtests; + +import java.io.IOException; +import java.net.InetAddress; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import javax.naming.ConfigurationException; + +import org.junit.Assert; +import org.junit.Test; +import org.openmuc.openiec61850.BasicDataAttribute; +import org.openmuc.openiec61850.BdaReasonForInclusion; +import org.openmuc.openiec61850.ClientAssociation; +import org.openmuc.openiec61850.ClientEventListener; +import org.openmuc.openiec61850.ClientSap; +import org.openmuc.openiec61850.Fc; +import org.openmuc.openiec61850.FcModelNode; +import org.openmuc.openiec61850.ModelNode; +import org.openmuc.openiec61850.Report; +import org.openmuc.openiec61850.SclParseException; +import org.openmuc.openiec61850.ServerEventListener; +import org.openmuc.openiec61850.ServerModel; +import org.openmuc.openiec61850.ServerSap; +import org.openmuc.openiec61850.ServiceError; + +public class ClientServerITest2 extends Thread implements ServerEventListener, ClientEventListener { + + int port = 54322; + String host = "127.0.0.1"; + ClientSap clientSap = new ClientSap(); + ServerSap serverSap = null; + ClientAssociation clientAssociation = null; + ClientAssociation clientAssociation2 = null; + ServerModel serversServerModel = null; + private static int numReports = 0; + private static int numSuccess = 0; + private static int numAssociationClosed = 0; + + // Get the Java runtime + public static Runtime runtime = Runtime.getRuntime(); + + @Test + public void testClientServerCom() throws IOException, ServiceError, ConfigurationException, + javax.naming.ConfigurationException, SclParseException, InterruptedException { + + clientSap.setTSelRemote(new byte[] { 0, 1 }); + clientSap.setTSelLocal(new byte[] { 0, 0 }); + clientSap.setApTitleCalled(new int[] { 1, 1, 999, 1 }); + + runServer("src/test/resources/testModel2.icd", port); + System.out.println("IED Server is running"); + + // ----------------------------------------------------------- + // Client + // ----------------------------------------------------------- + + System.out.println("Attempting to connect to server " + host + " on port " + port); + + clientAssociation = clientSap.associate(InetAddress.getByName(host), port, null, this); + + ServerModel serverModel = clientAssociation.getModelFromSclFile("src/test/resources/testModel2.icd"); + // ServerModel serverModel = clientAssociation.retrieveModel(); + + getAllBdas(serverModel); + + // timestamp = (BdaTimestamp) serverModel.findModelNode("ied1lDevice1/MMXU1.TotW.t", Fc.MX); + // clientAssociation.getDataValues(timestamp); + + clientAssociation.disconnect(); + + Thread.sleep(500); + serverSap.stop(); + + } + + private void getAllBdas(ServerModel serverModel) throws ServiceError, IOException { + + for (ModelNode ld : serverModel) { + for (ModelNode ln : ld) { + getDataRecursive(ln, clientAssociation); + } + } + } + + private void runServer(String sclFilePath, int port) throws SclParseException, IOException { + + List serverSaps = null; + serverSaps = ServerSap.getSapsFromSclFile(sclFilePath); + + serverSap = serverSaps.get(0); + serverSap.setPort(port); + serverSap.startListening(this); + serversServerModel = serverSap.getModelCopy(); + start(); + } + + private static void getDataRecursive(ModelNode modelNode, ClientAssociation clientAssociation) + throws ServiceError, IOException { + if (modelNode.getChildren() == null) { + return; + } + for (ModelNode childNode : modelNode) { + FcModelNode fcChildNode = (FcModelNode) childNode; + if (fcChildNode.getFc() != Fc.CO) { + System.out.println("calling GetDataValues(" + childNode.getReference() + ")"); + clientAssociation.getDataValues(fcChildNode); + } + // clientAssociation.setDataValues(fcChildNode); + getDataRecursive(childNode, clientAssociation); + } + } + + public static int findArray(Byte[] array, Byte[] subArray) { + return Collections.indexOfSubList(Arrays.asList(array), Arrays.asList(subArray)); + } + + public static String getByteArrayString(byte[] byteArray) { + StringBuilder builder = new StringBuilder(); + int l = 1; + for (byte b : byteArray) { + if ((l != 1) && ((l - 1) % 8 == 0)) { + builder.append(' '); + } + if ((l != 1) && ((l - 1) % 16 == 0)) { + builder.append('\n'); + } + l++; + builder.append("0x"); + String hexString = Integer.toHexString(b & 0xff); + if (hexString.length() == 1) { + builder.append(0); + } + builder.append(hexString + " "); + } + return builder.toString(); + } + + @Override + public void serverStoppedListening(ServerSap serverSAP) { + // TODO Auto-generated method stub + } + + @Override + public List write(List bdas) { + System.out.println("DataSource: got write request"); + return null; + } + + @Override + public void run() { + + // BdaFloat32 totWMag = (BdaFloat32) serversServerModel.findModelNode("ied1lDevice1/MMXU1.TotW.mag.f", Fc.MX); + // BdaQuality q = (BdaQuality) serversServerModel.findModelNode("ied1lDevice1/MMXU1.TotW.q", Fc.MX); + // BdaTimestamp t = (BdaTimestamp) serversServerModel.findModelNode("ied1lDevice1/MMXU1.TotW.t", Fc.MX); + // + // List totWBdas = new ArrayList(3); + // totWBdas.add(totWMag); + // totWBdas.add(q); + // totWBdas.add(t); + // + // float totWMagVal = 0.0f; + // q.setValidity(BdaQuality.Validity.GOOD); + // + // // for (int i = 0; i < 500000; i++) { + // + // totWMagVal += 1.0; + // + // logger.info("setting totWmag to: " + totWMagVal); + // totWMag.setFloat(totWMagVal); + // t.setCurrentTime(); + // + // if (q.getValidity() == Validity.GOOD) { + // q.setValidity(BdaQuality.Validity.INVALID); + // } + // else { + // q.setValidity(BdaQuality.Validity.GOOD); + // } + // + // try { + // Thread.sleep(4000); + // } catch (InterruptedException e) { + // } + // serverSap.setValues(totWBdas); + + // // Run the garbage collector + // runtime.gc(); + // // Calculate the used memory + // long memory = runtime.totalMemory() - runtime.freeMemory(); + // System.out.println("Used memory is bytes: " + memory); + // System.out.println("Used memory is megabytes: " + bytesToMegabytes(memory)); + + // try { + // Thread.sleep(2000); + // } catch (InterruptedException e) { + // } + // } + + } + + private static final long MEGABYTE = 1024L * 1024L; + + public static long bytesToMegabytes(long bytes) { + return bytes / MEGABYTE; + } + + @Override + public void newReport(Report report) { + System.out.println("got report!"); + numReports++; + + if (numReports == 1) { + List reasons = report.getReasonCodes(); + Assert.assertEquals(2, reasons.size()); + Assert.assertTrue(reasons.get(0).isGeneralInterrogation()); + Assert.assertFalse(reasons.get(0).isDataUpdate()); + } + else if (numReports == 2) { + List reasons = report.getReasonCodes(); + Assert.assertEquals(1, reasons.size()); + Assert.assertFalse(reasons.get(0).isGeneralInterrogation()); + Assert.assertTrue(reasons.get(0).isDataChange()); + } + else if (numReports >= 3) { + List reasons = report.getReasonCodes(); + Assert.assertEquals(2, reasons.size()); + Assert.assertTrue(reasons.get(0).isIntegrity()); + Assert.assertTrue(reasons.get(1).isIntegrity()); + } + + numSuccess++; + + } + + @Override + public void associationClosed(IOException e) { + System.out.println("Association closed!"); + numAssociationClosed++; + } +} diff --git a/src/test/java/org/openmuc/openiec61850/integrationtests/SclTests.java b/src/test/java/org/openmuc/openiec61850/integrationtests/SclTests.java new file mode 100644 index 0000000..e7fb7ad --- /dev/null +++ b/src/test/java/org/openmuc/openiec61850/integrationtests/SclTests.java @@ -0,0 +1,19 @@ +package org.openmuc.openiec61850.integrationtests; + +import org.junit.Test; +import org.openmuc.openiec61850.SclParseException; +import org.openmuc.openiec61850.ServerSap; + +public class SclTests { + + private final static String SCL_FILE_PATH_1 = "src/test/resources/testModel.icd"; + private final static String SCL_FILE_PATH_2 = "src/test/resources/testModel2.icd"; + + @Test + public void testClientServerCom() throws SclParseException { + + ServerSap.getSapsFromSclFile(SCL_FILE_PATH_1); + ServerSap.getSapsFromSclFile(SCL_FILE_PATH_2); + } + +} diff --git a/src/test/resources/openiec61850sample01.icd b/src/test/resources/openiec61850sample01.icd new file mode 100644 index 0000000..d8c0c87 --- /dev/null +++ b/src/test/resources/openiec61850sample01.icd @@ -0,0 +1,298 @@ + + +
+ + + Station bus + 10 + +
+

10.0.0.3

+

255.255.255.0

+

10.0.0.101

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + direct-with-normal-security + + + + + 1000 + + + sbo-with-normal-security + + + + + direct-with-enhanced-security + + + + + sbo-with-enhanced-security + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + diff --git a/src/test/resources/testModel.icd b/src/test/resources/testModel.icd new file mode 100644 index 0000000..32d3593 --- /dev/null +++ b/src/test/resources/testModel.icd @@ -0,0 +1,188 @@ + + + +
+ + + Station bus + 10 + +
+

10.0.0.3

+

255.255.255.0

+

10.0.0.101

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + diff --git a/src/test/resources/testModel2.icd b/src/test/resources/testModel2.icd new file mode 100644 index 0000000..d434770 --- /dev/null +++ b/src/test/resources/testModel2.icd @@ -0,0 +1,1049 @@ + + +
+ + + +
+

1,1,999,1,1

+

12

+

0001

+

0001

+

0001

+

127.0.0.1

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + operate-once + operate-many + + + pulse + persistent + + + no-check + synchrocheck + interlocking-check + both + + + on + blocked + test + test/blocked + off + + + Ok + Warning + Alarm + + + Not applicable / Unknown + Not operating + Operating + Starting up + Shutting down + At disconnect level + kW ramping + kVar ramping + Other + + + normal + high + low + high-high + low-low + + + + + m + kg + s + A + K + mol + cd + deg + rad + sr + Gy + q + °C + Sv + F + C + S + H + V + ohm + J + N + Hz + lx + Lm + Wb + T + W + Pa + + + m/s + m/s² + m³/s + m/m³ + M + kg/m³ + m²/s + W/m K + J/K + ppm + 1/s + rad/s + VA + W + VAr + theta + cos(theta) + Vs + + As + + A²t + VAh + Wh + VArh + V/Hz + Hz/s + + + y + z + a + f + p + n + μ + m + c + d + + da + h + k + M + G + T + P + E + Z + Y + + + intermediate-state + off + on + bad-state + + + Not applicable / Unknown + Manual + Regular + Backup + Emergency + Maintenance + Other + + + Not applicable / Unknown + Energy + Regulating + Load following + Contingency reserve spinning + Contingency reserve supplemental + Emergency reserve + Emission reserve + Frequency response + Energy balancing + Reactive power + Black start + Emergency islanding + Other + + + Not applicable / Unknown + + + + Not applicable / Unknown + Air + Water + Steam + Oil + Other + + + V + A + other + + + Va + Vb + Vc + Aa + Ab + Ac + Vab + Vbc + Vca + Vother + Aother + + +