Compare commits
145 Commits
Author | SHA1 | Date |
---|---|---|
![]() |
c5acb251b7 | 2 years ago |
![]() |
0d652ed0d0 | 2 years ago |
![]() |
0508da4073 | 2 years ago |
![]() |
6d8859f6f6 | 2 years ago |
![]() |
f9f34cde0c | 4 years ago |
![]() |
fa62271c46 | 4 years ago |
![]() |
cb903a3f61 | 4 years ago |
![]() |
77c7b009b4 | 5 years ago |
![]() |
e0770f03e6 | 5 years ago |
![]() |
ef06aea374 | 5 years ago |
![]() |
0afb4f56a1 | 5 years ago |
![]() |
eccb578588 | 5 years ago |
![]() |
1f01fcac02 | 5 years ago |
![]() |
05d75db9db | 5 years ago |
![]() |
cd11b7c9ff | 5 years ago |
![]() |
24cee0d77e | 5 years ago |
![]() |
fc8ec39ed9 | 5 years ago |
![]() |
fef09d40c8 | 5 years ago |
![]() |
48531ffd8d | 5 years ago |
![]() |
b3e45e0f16 | 5 years ago |
![]() |
69a1c96c04 | 5 years ago |
![]() |
792afe0ce8 | 5 years ago |
![]() |
6c89bb3639 | 5 years ago |
![]() |
49a6743e50 | 5 years ago |
![]() |
63db1782d1 | 5 years ago |
![]() |
667ae70c35 | 5 years ago |
![]() |
f416a33418 | 5 years ago |
![]() |
75ad0eb76c | 5 years ago |
![]() |
066a034c49 | 5 years ago |
![]() |
8e4a1b0f81 | 5 years ago |
![]() |
d7d87c6004 | 5 years ago |
![]() |
e37e072144 | 5 years ago |
![]() |
92705822d6 | 5 years ago |
![]() |
7552c59319 | 5 years ago |
![]() |
9b7e830559 | 5 years ago |
![]() |
983fbbddb4 | 5 years ago |
![]() |
9fc7d2376c | 5 years ago |
![]() |
fb6dded6c9 | 5 years ago |
![]() |
10dd18750a | 5 years ago |
![]() |
cbac75d770 | 5 years ago |
![]() |
42e855fce6 | 6 years ago |
![]() |
d1237d2e45 | 6 years ago |
![]() |
476bed5898 | 6 years ago |
![]() |
9d01e8b867 | 6 years ago |
![]() |
193e76209e | 6 years ago |
![]() |
c7c69b6294 | 6 years ago |
![]() |
7c4961db5f | 6 years ago |
![]() |
9aa85d1a90 | 6 years ago |
![]() |
5235f51e32 | 6 years ago |
![]() |
249b7c6dd9 | 6 years ago |
![]() |
7e9eb53e0f | 6 years ago |
![]() |
1cc94089f4 | 6 years ago |
![]() |
bbc98a065a | 6 years ago |
![]() |
d2c53aeb94 | 6 years ago |
![]() |
a3a11ed52c | 7 years ago |
![]() |
e8bb35fd02 | 7 years ago |
![]() |
40cbedc854 | 7 years ago |
![]() |
bea0860f4f | 7 years ago |
![]() |
4071101f54 | 7 years ago |
![]() |
72494fb83d | 7 years ago |
![]() |
2419583978 | 7 years ago |
![]() |
b38c813b2f | 7 years ago |
![]() |
a801db5404 | 7 years ago |
![]() |
88e96e1a0f | 7 years ago |
![]() |
e80f68c5aa | 7 years ago |
![]() |
59eee5cbc0 | 7 years ago |
![]() |
fafbec0786 | 7 years ago |
![]() |
0d3a5e2971 | 7 years ago |
![]() |
2e268028e9 | 7 years ago |
![]() |
3082a3739e | 7 years ago |
![]() |
d0caa66dc4 | 7 years ago |
![]() |
c0fb912326 | 7 years ago |
![]() |
1c29937cf4 | 7 years ago |
![]() |
f4259edb7a | 7 years ago |
![]() |
ec72200684 | 7 years ago |
![]() |
cdb5dc9231 | 7 years ago |
![]() |
940a3eaaaf | 7 years ago |
![]() |
53425c9b6d | 7 years ago |
![]() |
182d0a8687 | 7 years ago |
![]() |
c093bf0038 | 7 years ago |
![]() |
4a5a23b870 | 7 years ago |
![]() |
3d3abc16db | 7 years ago |
![]() |
03607911ce | 7 years ago |
![]() |
0645fc994e | 7 years ago |
![]() |
a97c91eda7 | 7 years ago |
![]() |
56fee3cf19 | 7 years ago |
![]() |
1c24852d77 | 7 years ago |
![]() |
648d839df7 | 7 years ago |
![]() |
484152d1ba | 7 years ago |
![]() |
0641743072 | 7 years ago |
![]() |
aad176e439 | 7 years ago |
![]() |
ca47659ebe | 7 years ago |
![]() |
1d5b09e0fc | 7 years ago |
![]() |
0200a86cb1 | 7 years ago |
![]() |
00ed96935f | 7 years ago |
![]() |
1788baa1d3 | 7 years ago |
![]() |
729b69f2db | 7 years ago |
![]() |
ffe3800619 | 7 years ago |
![]() |
3eec5f9589 | 7 years ago |
![]() |
d9590e1524 | 7 years ago |
![]() |
3e529ca8a1 | 7 years ago |
![]() |
23a4715f65 | 7 years ago |
![]() |
a03e1b29ba | 7 years ago |
![]() |
727c7eaffb | 7 years ago |
![]() |
646f7f4907 | 7 years ago |
![]() |
7f22d94496 | 7 years ago |
![]() |
febe96dc73 | 7 years ago |
![]() |
54a902e0de | 8 years ago |
![]() |
a70f921171 | 8 years ago |
![]() |
27512e4f5e | 8 years ago |
![]() |
ead6f7611c | 8 years ago |
![]() |
d2bd73adf7 | 8 years ago |
![]() |
acf5c15746 | 8 years ago |
![]() |
f064d16553 | 8 years ago |
![]() |
dc632f3007 | 8 years ago |
![]() |
b14388a764 | 8 years ago |
![]() |
bdb5db7aa0 | 8 years ago |
![]() |
c9d8278029 | 8 years ago |
![]() |
7fe11c6e0a | 8 years ago |
![]() |
e337276bd8 | 8 years ago |
![]() |
566582b15b | 8 years ago |
![]() |
ba8f0c969e | 8 years ago |
![]() |
370ce99967 | 8 years ago |
![]() |
2e2da64a97 | 8 years ago |
![]() |
f410af785e | 8 years ago |
![]() |
b14d228929 | 8 years ago |
![]() |
e3e1b86a12 | 8 years ago |
![]() |
c07eaa4cd9 | 8 years ago |
![]() |
bda67ef556 | 8 years ago |
![]() |
1da32db3d8 | 8 years ago |
![]() |
f45bdbaae5 | 8 years ago |
![]() |
f8b40c03ac | 8 years ago |
![]() |
78f80620c6 | 8 years ago |
![]() |
b4c30a3a6c | 8 years ago |
![]() |
b4de8d70a8 | 8 years ago |
![]() |
6d18d51efc | 8 years ago |
![]() |
734a58e338 | 8 years ago |
![]() |
9cedd0222f | 8 years ago |
![]() |
af6b48b80c | 8 years ago |
![]() |
bf8d299979 | 8 years ago |
![]() |
92c56aba0f | 8 years ago |
![]() |
6254d9ff36 | 8 years ago |
![]() |
6ed7849a1a | 8 years ago |
![]() |
10f6ee2898 | 8 years ago |
![]() |
3fd38df6dd | 8 years ago |
@ -1,24 +1,16 @@
|
||||
\#*
|
||||
.\#*
|
||||
*~
|
||||
target/
|
||||
bin/
|
||||
build/
|
||||
tmp/
|
||||
*.class
|
||||
# Gradle
|
||||
.gradle/
|
||||
.svn/
|
||||
build/
|
||||
gradle.properties
|
||||
|
||||
# IntelliJ IDEA
|
||||
.idea
|
||||
out/
|
||||
|
||||
# Eclipse
|
||||
.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
|
||||
**/bin/main/
|
||||
**/bin/test/
|
||||
|
@ -0,0 +1,4 @@
|
||||
# IEC61850bean
|
||||
IEC61850bean (previously known as OpenIEC61850) is a library implementing the IEC 61850 standard based on the MMS mapping for client and server communication.
|
||||
|
||||
For detailed information on IEC61850bean visit https://www.beanit.com/iec-61850/.
|
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd `dirname $0`
|
||||
|
||||
rm ../src/main/java-gen/com/beanit/josistack/internal/acse/asn1/*
|
||||
asn1bean-compiler -o "../src/main/java-gen/" -p "com.beanit.josistack.internal.acse" -f iso-acse-layer.asn -dv
|
||||
|
||||
rm ../src/main/java-gen/com/beanit/josistack/internal/presentation/asn1/*
|
||||
asn1bean-compiler -o "../src/main/java-gen/" -p "com.beanit.josistack.internal.presentation" -f iso-presentation-layer.asn -dv
|
||||
|
||||
rm -r ../src/main/java-gen/com/beanit/iec61850bean/internal/mms/asn1/*
|
||||
asn1bean-compiler -o "../src/main/java-gen" -p "com.beanit.iec61850bean.internal.mms" -f mms.asn -dv
|
@ -1,5 +0,0 @@
|
||||
#!/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
|
@ -1,5 +0,0 @@
|
||||
#!/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
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -r ../../src/main/java-gen/*
|
||||
|
||||
jasn1-compiler -o "../../src/main/java-gen" -p "org.openmuc.openiec61850.internal.mms" -f mms.asn
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,318 +0,0 @@
|
||||
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
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,10 @@
|
||||
steps to follow:
|
||||
|
||||
1) compile classes by executing compile.sh
|
||||
|
||||
2) format everything using IntelliJ
|
||||
|
||||
3) execute replace-berboolean.sh (this step does not work if step 2
|
||||
is not executed)
|
||||
|
||||
4) again format everyting using IntelliJ
|
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd `dirname $0`
|
||||
|
||||
# replace BerBoolean from ASN1bean with special one for IEC 61850 so that true is coded as 0x01 instead of 0xff
|
||||
find ../ -iname "*.java" | xargs sed -i 's/import com\.beanit\.asn1bean\.ber\.types\.BerBoolean/import com\.beanit\.iec61850bean\.internal\.BerBoolean/g'
|
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
JARS_LOCATION="build/libs-all"
|
||||
MAIN_CLASS="com.beanit.iec61850bean.app.ConsoleClient"
|
||||
SYSPROPS=""
|
||||
PARAMS=""
|
||||
|
||||
# Attempt to set APP_HOME (from Gradle start script)
|
||||
# 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
|
||||
|
||||
CLASSPATH=$(JARS=("$APP_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
|
||||
|
||||
PARAMS=( )
|
||||
SYSPROPS=( )
|
||||
for i in "$@"; do
|
||||
if [[ $i == -D* ]]; then
|
||||
SYSPROPS+=( "$i" )
|
||||
else
|
||||
PARAMS+=( "$i" )
|
||||
fi
|
||||
done
|
||||
|
||||
java "${SYSPROPS[@]}" -cp "$CLASSPATH" $MAIN_CLASS "${PARAMS[@]}"
|
@ -0,0 +1,7 @@
|
||||
::BATCH file to windows
|
||||
@echo off
|
||||
|
||||
set BATDIR=%~dp0
|
||||
set LIBDIR="%BATDIR%..\build\libs-all\*"
|
||||
|
||||
java -cp %LIBDIR% com.beanit.iec61850bean.app.ConsoleClient %*
|
@ -0,0 +1,8 @@
|
||||
::BATCH file to windows
|
||||
@echo off
|
||||
|
||||
set BATDIR=%~dp0
|
||||
set LIBDIR="%BATDIR%..\build\libs-all\*"
|
||||
|
||||
java -Dlogback.configurationFile=logback.xml -cp %LIBDIR% com.beanit.iec61850bean.app.ConsoleServer %*
|
||||
|
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
JARS_LOCATION="build/libs-all"
|
||||
MAIN_CLASS="com.beanit.iec61850bean.clientgui.ClientGui"
|
||||
SYSPROPS=""
|
||||
PARAMS=""
|
||||
|
||||
# Attempt to set APP_HOME (from Gradle start script)
|
||||
# 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
|
||||
|
||||
CLASSPATH=$(JARS=("$APP_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
|
||||
|
||||
PARAMS=( )
|
||||
SYSPROPS=( )
|
||||
for i in "$@"; do
|
||||
if [[ $i == -D* ]]; then
|
||||
SYSPROPS+=( "$i" )
|
||||
else
|
||||
PARAMS+=( "$i" )
|
||||
fi
|
||||
done
|
||||
|
||||
java "${SYSPROPS[@]}" -cp "$CLASSPATH" $MAIN_CLASS "${PARAMS[@]}"
|
@ -0,0 +1,7 @@
|
||||
::BATCH file to windows
|
||||
@echo off
|
||||
|
||||
set BATDIR=%~dp0
|
||||
set LIBDIR="%BATDIR%..\build\libs-all\*"
|
||||
|
||||
java -cp %LIBDIR% com.beanit.iec61850bean.clientgui.ClientGui %*
|
@ -1,271 +0,0 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
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.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: "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("-",".");
|
||||
}
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
@ -0,0 +1,317 @@
|
||||
import net.ltgt.gradle.errorprone.errorprone
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
signing
|
||||
eclipse
|
||||
id("biz.aQute.bnd.builder") version "5.1.1"
|
||||
id("com.diffplug.spotless") version "5.9.0"
|
||||
id("io.codearte.nexus-staging") version "0.22.0"
|
||||
id("net.ltgt.errorprone") version "1.3.0"
|
||||
}
|
||||
|
||||
var cfgJavaVersion = JavaVersion.VERSION_1_8
|
||||
|
||||
val sonatypeRepository: String? by project
|
||||
val sonatypeSnapshotRepository: String? by project
|
||||
val sonatypeUser: String? by project
|
||||
val sonatypePass: String? by project
|
||||
val sonatypeStagingProfileId: String? by project
|
||||
|
||||
//----------- project specific configuration start --------------------
|
||||
|
||||
val cfgVersion = "1.9.1-SNAPSHOT"
|
||||
val cfgGroup = "com.beanit"
|
||||
val cfgCopyToRoot = false
|
||||
val cfgSignPom = true
|
||||
val cfgRepository: String? = sonatypeRepository
|
||||
val cfgSnapshotRepository: String? = sonatypeSnapshotRepository
|
||||
val cfgRepositoryUser: String? = sonatypeUser
|
||||
val cfgRepositoryPass: String? = sonatypePass
|
||||
val cfgStagingProfileId: String? = sonatypeStagingProfileId
|
||||
val javaProjects: Set<Project> = allprojects
|
||||
val distributionProjects = javaProjects
|
||||
val docProjects = javaProjects
|
||||
val repositoryProjects = javaProjects
|
||||
val cfgModuleName = "com.beanit.iec61850bean"
|
||||
|
||||
tasks.register<Tar>("tar") {
|
||||
into(project.name) {
|
||||
from("./") {
|
||||
include("build.gradle.kts")
|
||||
include("LICENSE.txt")
|
||||
include("doc/**")
|
||||
include("bin/**")
|
||||
exclude("bin/main/")
|
||||
exclude("bin/test/")
|
||||
include("gradle/wrapper/**")
|
||||
include("gradlew")
|
||||
include("gradlew.bat")
|
||||
include("build/libs-all/**")
|
||||
include("src/**")
|
||||
|
||||
include("asn1/**")
|
||||
}
|
||||
}
|
||||
|
||||
into(project.name + "/doc/") {
|
||||
from("./build/docs/") {
|
||||
include("javadoc/**")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----java root project configurations
|
||||
|
||||
dependencies {
|
||||
implementation("com.beanit:asn1bean:1.12.0")
|
||||
implementation("org.slf4j:slf4j-api:1.7.25")
|
||||
runtimeOnly("ch.qos.logback:logback-classic:1.2.3")
|
||||
}
|
||||
|
||||
project.extra["cfgModuleName"] = "com.beanit.iec61850bean"
|
||||
|
||||
tasks["jar"].withConvention(aQute.bnd.gradle.BundleTaskConvention::class) {
|
||||
bnd("""
|
||||
Bundle-Name: IEC61850bean
|
||||
Bundle-SymbolicName: ${project.extra["cfgModuleName"]}
|
||||
-exportcontents: !*.internal.*,*
|
||||
Import-Package: com.beanit.asn1bean.*,javax.net,*;resolution:=optional
|
||||
""")
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
setSrcDirs(listOf("src/main/java", "src/main/java-gen"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maybeCreate<MavenPublication>("mavenJava").pom {
|
||||
name.set("IEC61850bean")
|
||||
description.set("IEC61850bean is a Java library implementing the IEC 61850 MMS communication standard for clients and servers.")
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name.set("The Apache License, Version 2.0")
|
||||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//----------- project specific configuration end ---------------------
|
||||
|
||||
|
||||
configure(allprojects) {
|
||||
version = cfgVersion
|
||||
group = cfgGroup
|
||||
}
|
||||
|
||||
nexusStaging {
|
||||
packageGroup = cfgGroup
|
||||
username = cfgRepositoryUser
|
||||
password = cfgRepositoryPass
|
||||
stagingProfileId = cfgStagingProfileId
|
||||
}
|
||||
|
||||
configure(javaProjects) {
|
||||
|
||||
apply(plugin = "java-library")
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "signing")
|
||||
apply(plugin = "eclipse")
|
||||
apply(plugin = "biz.aQute.bnd.builder")
|
||||
apply(plugin = "com.diffplug.spotless")
|
||||
apply(plugin = "net.ltgt.errorprone")
|
||||
|
||||
tasks.publish {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = cfgJavaVersion
|
||||
targetCompatibility = cfgJavaVersion
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
|
||||
testImplementation("com.tngtech.archunit:archunit-junit5:0.15.0")
|
||||
errorprone("com.google.errorprone:error_prone_core:2.5.1")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.errorprone.excludedPaths.set(".*java-gen.*")
|
||||
if (!JavaVersion.current().isJava9Compatible) {
|
||||
options.errorprone.isEnabled.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.jar {
|
||||
manifest {
|
||||
attributes["Automatic-Module-Name"] = project.extra["cfgModuleName"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spotless {
|
||||
java {
|
||||
googleJavaFormat()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Copy>("jarAll") {
|
||||
from(configurations.runtimeClasspath) // all runtime dependencies
|
||||
from(tasks.jar) // the jar file created
|
||||
if (cfgCopyToRoot) {
|
||||
into(rootDir.path + "/build/libs-all")
|
||||
} else {
|
||||
into("build/libs-all")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.build {
|
||||
dependsOn("jarAll")
|
||||
}
|
||||
|
||||
eclipse.pathVariables(mapOf("GRADLE_USER_HOME" to file(gradle.gradleUserHomeDir)))
|
||||
tasks.eclipse { dependsOn(tasks.cleanEclipse) }
|
||||
|
||||
tasks.javadoc {
|
||||
exclude("**/internal/**")
|
||||
exclude("**/java-gen/**")
|
||||
exclude("**/app/**")
|
||||
|
||||
//linking Javadoc in version prior 9 does not work well because Javadoc uses html frames.
|
||||
if (cfgJavaVersion.isJava9Compatible) {
|
||||
if (cfgJavaVersion.isJava11Compatible) {
|
||||
(options as StandardJavadocDocletOptions).links?.add("https://docs.oracle.com/en/java/javase/${cfgJavaVersion.majorVersion}/docs/api/")
|
||||
} else {
|
||||
(options as StandardJavadocDocletOptions).links?.add("https://docs.oracle.com/javase/${cfgJavaVersion.majorVersion}/docs/api/")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configure(repositoryProjects) {
|
||||
tasks.publish {
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
|
||||
configure(repositoryProjects) {
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
val mvnPublication: MavenPublication = maybeCreate<MavenPublication>("mavenJava")
|
||||
mvnPublication.from(components["java"])
|
||||
mvnPublication.versionMapping {
|
||||
usage("java-api") {
|
||||
fromResolutionOf("runtimeClasspath")
|
||||
}
|
||||
usage("java-runtime") {
|
||||
fromResolutionResult()
|
||||
}
|
||||
}
|
||||
mvnPublication.pom {
|
||||
url.set("http://www.beanit.com/")
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id.set("beanit")
|
||||
name.set("Beanit GmbH")
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection.set("none")
|
||||
url.set("none")
|
||||
}
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
val releasesRepoUrl = uri(cfgRepository ?: "")
|
||||
val snapshotsRepoUrl = uri(cfgSnapshotRepository ?: "")
|
||||
// val releasesRepoUrl = uri("$buildDir/repos/releases")
|
||||
// val snapshotsRepoUrl = uri("$buildDir/repos/snapshots")
|
||||
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
|
||||
credentials {
|
||||
username = cfgRepositoryUser
|
||||
password = cfgRepositoryPass
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cfgSignPom) {
|
||||
signing {
|
||||
sign(publishing.publications["mavenJava"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
tasks.register<Javadoc>("javadocAll") {
|
||||
|
||||
source(docProjects.map { project ->
|
||||
project.sourceSets["main"].allJava
|
||||
})
|
||||
|
||||
exclude("**/internal/**")
|
||||
exclude("**/java-gen/**")
|
||||
exclude("**/app/**")
|
||||
|
||||
setDestinationDir(File(buildDir, "docs/javadoc-all"))
|
||||
|
||||
classpath = files(distributionProjects.map { project ->
|
||||
project.sourceSets["main"].compileClasspath
|
||||
})
|
||||
|
||||
classpath += files(distributionProjects.map { project ->
|
||||
project.sourceSets["main"].output
|
||||
})
|
||||
|
||||
//linking Javadoc in version prior 9 does not work well because Javadoc uses html frames.
|
||||
if (cfgJavaVersion.isJava9Compatible) {
|
||||
if (cfgJavaVersion.isJava11Compatible) {
|
||||
(options as StandardJavadocDocletOptions).links?.add("https://docs.oracle.com/en/java/javase/${cfgJavaVersion.majorVersion}/docs/api/")
|
||||
} else {
|
||||
(options as StandardJavadocDocletOptions).links?.add("https://docs.oracle.com/javase/${cfgJavaVersion.majorVersion}/docs/api/")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tasks.named<Tar>("tar") {
|
||||
archiveFileName.set(project.name + "-" + project.version + ".tgz")
|
||||
|
||||
dependsOn(distributionProjects.map { "${it.path}:build" })
|
||||
distributionProjects.forEach {
|
||||
println("project: "
|
||||
+ it.path)
|
||||
}
|
||||
dependsOn(tasks.named("javadocAll"))
|
||||
|
||||
compression = Compression.GZIP
|
||||
|
||||
destinationDirectory.set(File("build/distributions/"))
|
||||
}
|
@ -1,125 +0,0 @@
|
||||
|
||||
project.ext {
|
||||
|
||||
cfgVersion = "1.4.1"
|
||||
|
||||
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'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
# IEC61850bean User Guide
|
||||
|
||||
* unnumbered toc
|
||||
{:toc}
|
||||
|
||||
## Intro
|
||||
|
||||
IEC61850bean (previously known as 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. IEC61850bean includes a console client and server as well as a GUI client.
|
||||
|
||||
### Distribution
|
||||
|
||||
After extracting the distribution tar file, the IEC61850bean library can be found in the folder *build/libs-all*.
|
||||
|
||||
#### Dependencies
|
||||
|
||||
Besides the IEC61850bean library the folder *build/libs-all/* contains the following external libraries:
|
||||
|
||||
* *asn1bean* - the ASN.1 BER encoding/decoding library by beanit, license: Apache 2.0, https://www.beanit.com
|
||||
|
||||
* *slf4j-api* - a popular logging API. It is only needed if iec61850bean 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
|
||||
|
||||
|
||||
|
||||
### Console & GUI Applications
|
||||
|
||||
You can execute the console client and server through the scripts found in the *bin* folder. Executing the scripts without any parameters will print help information to the screen. Note that under Unix/Linux you need root privileges if you want the server to listen on any port lower than 1000.
|
||||
|
||||
### OSI Stack
|
||||
|
||||
The IEC61850bean 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 IEC61850bean
|
||||
|
||||
The easiest way to learn how IEC61850bean 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 is called "server". In IEC61850bean 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 IEC61850bean 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 IEC61850bean 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 from the server device or through SclParser.parse from an SCL file. When using the second approach, the model has to be set in the client association using ClientAssociation.setServerModel. 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 IEC61850bean
|
||||
|
||||
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.
|
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
#Tue Jun 30 15:11:36 CEST 2020
|
||||
tselLocal=0,0
|
||||
serverAddress=127.0.0.1
|
||||
tselRemote=0,1
|
||||
serverPort=10002
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
@ -1,20 +0,0 @@
|
||||
#!/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
|
@ -1,6 +0,0 @@
|
||||
::BATCH file for windows
|
||||
|
||||
set BATDIR=%~dp0
|
||||
set LIBDIR=%BATDIR%..\..\build\libs-all
|
||||
|
||||
java -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.app.ConsoleClient %*
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!-- encoders are assigned the type
|
||||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="debug">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
@ -1,6 +0,0 @@
|
||||
::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 %*
|
@ -1,39 +0,0 @@
|
||||
#!/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
|
||||
|
@ -1,6 +0,0 @@
|
||||
::BATCH file to windows
|
||||
|
||||
set BATDIR=%~dp0
|
||||
set LIBDIR=%BATDIR%..\..\build\libs-all
|
||||
|
||||
java -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.clientgui.ClientGui %*
|
@ -1,5 +0,0 @@
|
||||
#!/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
|
@ -1,272 +0,0 @@
|
||||
-- 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
|
@ -1,5 +0,0 @@
|
||||
#!/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
|
@ -1,143 +0,0 @@
|
||||
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
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -r ../../src/main/java-gen/*
|
||||
|
||||
jasn1-compiler -o "../../src/main/java-gen" -p "org.openmuc.openiec61850.internal.mms" -f mms.asn
|
@ -1,723 +0,0 @@
|
||||
--
|
||||
-- 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
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,318 +0,0 @@
|
||||
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
|
File diff suppressed because it is too large
Load Diff
@ -1,297 +0,0 @@
|
||||
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"
|
||||
}
|
@ -1,125 +0,0 @@
|
||||
|
||||
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'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,242 +0,0 @@
|
||||
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
|
@ -1,33 +0,0 @@
|
||||
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::[]
|
Binary file not shown.
Before Width: | Height: | Size: 73 KiB |
@ -1,438 +0,0 @@
|
||||
= 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
|
@ -1,398 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -1,54 +0,0 @@
|
||||
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
|
||||
|
Binary file not shown.
@ -1,6 +0,0 @@
|
||||
#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
|
@ -1,172 +0,0 @@
|
||||
#!/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" "$@"
|
@ -1,84 +0,0 @@
|
||||
@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
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
@ -1,202 +0,0 @@
|
||||
|
||||
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.
|
@ -0,0 +1,136 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AccessResult implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private DataAccessError failure = null;
|
||||
private Data success = null;
|
||||
|
||||
public AccessResult() {}
|
||||
|
||||
public AccessResult(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataAccessError getFailure() {
|
||||
return failure;
|
||||
}
|
||||
|
||||
public void setFailure(DataAccessError failure) {
|
||||
this.failure = failure;
|
||||
}
|
||||
|
||||
public Data getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(Data success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (success != null) {
|
||||
codeLength += success.encode(reverseOS);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (failure != null) {
|
||||
codeLength += failure.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
int numDecodedBytes;
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
failure = new DataAccessError();
|
||||
tlvByteCount += failure.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
success = new Data();
|
||||
numDecodedBytes = success.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
return tlvByteCount + numDecodedBytes;
|
||||
} else {
|
||||
success = null;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.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("<none>");
|
||||
}
|
||||
}
|
@ -0,0 +1,250 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class AlternateAccess implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private List<CHOICE> seqOf = null;
|
||||
|
||||
public AlternateAccess() {
|
||||
seqOf = new ArrayList<CHOICE>();
|
||||
}
|
||||
|
||||
public AlternateAccess(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<CHOICE> getCHOICE() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<CHOICE>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
CHOICE element = new CHOICE();
|
||||
numDecodedBytes = element.decode(is, berTag);
|
||||
if (numDecodedBytes == 0) {
|
||||
throw new IOException("Tag did not match");
|
||||
}
|
||||
vByteCount += numDecodedBytes;
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException(
|
||||
"Decoded SequenceOf or SetOf has wrong length. Expected "
|
||||
+ lengthVal
|
||||
+ " but has "
|
||||
+ vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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<CHOICE> 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 CHOICE implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private AlternateAccessSelection unnamed = null;
|
||||
|
||||
public CHOICE() {}
|
||||
|
||||
public CHOICE(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public AlternateAccessSelection getUnnamed() {
|
||||
return unnamed;
|
||||
}
|
||||
|
||||
public void setUnnamed(AlternateAccessSelection unnamed) {
|
||||
this.unnamed = unnamed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (unnamed != null) {
|
||||
codeLength += unnamed.encode(reverseOS);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
int numDecodedBytes;
|
||||
|
||||
unnamed = new AlternateAccessSelection();
|
||||
numDecodedBytes = unnamed.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
return tlvByteCount + numDecodedBytes;
|
||||
} else {
|
||||
unnamed = null;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.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("<none>");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.types.string.BerVisibleString;
|
||||
|
||||
public class BasicIdentifier extends BerVisibleString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public BasicIdentifier() {}
|
||||
|
||||
public BasicIdentifier(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.types.BerNull;
|
||||
|
||||
public class ConcludeRequestPDU extends BerNull {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ConcludeRequestPDU() {}
|
||||
|
||||
public ConcludeRequestPDU(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
}
|
@ -0,0 +1,204 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ConfirmedErrorPDU implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private 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 Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public Unsigned32 getModifierPosition() {
|
||||
return modifierPosition;
|
||||
}
|
||||
|
||||
public void setModifierPosition(Unsigned32 modifierPosition) {
|
||||
this.modifierPosition = modifierPosition;
|
||||
}
|
||||
|
||||
public ServiceError getServiceError() {
|
||||
return serviceError;
|
||||
}
|
||||
|
||||
public void setServiceError(ServiceError serviceError) {
|
||||
this.serviceError = serviceError;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += serviceError.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
reverseOS.write(0xA2);
|
||||
codeLength += 1;
|
||||
|
||||
if (modifierPosition != null) {
|
||||
codeLength += modifierPosition.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += invokeID.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
invokeID = new Unsigned32();
|
||||
vByteCount += invokeID.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
modifierPosition = new Unsigned32();
|
||||
vByteCount += modifierPosition.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
serviceError = new ServiceError();
|
||||
vByteCount += serviceError.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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: <empty-required-field>");
|
||||
}
|
||||
|
||||
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: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ConfirmedRequestPDU implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private Unsigned32 invokeID = null;
|
||||
private ConfirmedServiceRequest service = null;
|
||||
|
||||
public ConfirmedRequestPDU() {}
|
||||
|
||||
public ConfirmedRequestPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public ConfirmedServiceRequest getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public void setService(ConfirmedServiceRequest service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += service.encode(reverseOS);
|
||||
|
||||
codeLength += invokeID.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(Unsigned32.tag)) {
|
||||
invokeID = new Unsigned32();
|
||||
vByteCount += invokeID.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
service = new ConfirmedServiceRequest();
|
||||
numDecodedBytes = service.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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: <empty-required-field>");
|
||||
}
|
||||
|
||||
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: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ConfirmedResponsePDU implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private Unsigned32 invokeID = null;
|
||||
private ConfirmedServiceResponse service = null;
|
||||
|
||||
public ConfirmedResponsePDU() {}
|
||||
|
||||
public ConfirmedResponsePDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public ConfirmedServiceResponse getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public void setService(ConfirmedServiceResponse service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += service.encode(reverseOS);
|
||||
|
||||
codeLength += invokeID.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(Unsigned32.tag)) {
|
||||
invokeID = new Unsigned32();
|
||||
vByteCount += invokeID.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
service = new ConfirmedServiceResponse();
|
||||
numDecodedBytes = service.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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: <empty-required-field>");
|
||||
}
|
||||
|
||||
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: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,444 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ConfirmedServiceRequest implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private 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;
|
||||
private FileOpenRequest fileOpen = null;
|
||||
private FileReadRequest fileRead = null;
|
||||
private FileCloseRequest fileClose = null;
|
||||
private FileDeleteRequest fileDelete = null;
|
||||
private FileDirectoryRequest fileDirectory = null;
|
||||
|
||||
public ConfirmedServiceRequest() {}
|
||||
|
||||
public ConfirmedServiceRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public GetNameListRequest getGetNameList() {
|
||||
return getNameList;
|
||||
}
|
||||
|
||||
public void setGetNameList(GetNameListRequest getNameList) {
|
||||
this.getNameList = getNameList;
|
||||
}
|
||||
|
||||
public ReadRequest getRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setRead(ReadRequest read) {
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public WriteRequest getWrite() {
|
||||
return write;
|
||||
}
|
||||
|
||||
public void setWrite(WriteRequest write) {
|
||||
this.write = write;
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesRequest getGetVariableAccessAttributes() {
|
||||
return getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public void setGetVariableAccessAttributes(
|
||||
GetVariableAccessAttributesRequest getVariableAccessAttributes) {
|
||||
this.getVariableAccessAttributes = getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public DefineNamedVariableListRequest getDefineNamedVariableList() {
|
||||
return defineNamedVariableList;
|
||||
}
|
||||
|
||||
public void setDefineNamedVariableList(DefineNamedVariableListRequest defineNamedVariableList) {
|
||||
this.defineNamedVariableList = defineNamedVariableList;
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesRequest getGetNamedVariableListAttributes() {
|
||||
return getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public void setGetNamedVariableListAttributes(
|
||||
GetNamedVariableListAttributesRequest getNamedVariableListAttributes) {
|
||||
this.getNamedVariableListAttributes = getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListRequest getDeleteNamedVariableList() {
|
||||
return deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public void setDeleteNamedVariableList(DeleteNamedVariableListRequest deleteNamedVariableList) {
|
||||
this.deleteNamedVariableList = deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public FileOpenRequest getFileOpen() {
|
||||
return fileOpen;
|
||||
}
|
||||
|
||||
public void setFileOpen(FileOpenRequest fileOpen) {
|
||||
this.fileOpen = fileOpen;
|
||||
}
|
||||
|
||||
public FileReadRequest getFileRead() {
|
||||
return fileRead;
|
||||
}
|
||||
|
||||
public void setFileRead(FileReadRequest fileRead) {
|
||||
this.fileRead = fileRead;
|
||||
}
|
||||
|
||||
public FileCloseRequest getFileClose() {
|
||||
return fileClose;
|
||||
}
|
||||
|
||||
public void setFileClose(FileCloseRequest fileClose) {
|
||||
this.fileClose = fileClose;
|
||||
}
|
||||
|
||||
public FileDeleteRequest getFileDelete() {
|
||||
return fileDelete;
|
||||
}
|
||||
|
||||
public void setFileDelete(FileDeleteRequest fileDelete) {
|
||||
this.fileDelete = fileDelete;
|
||||
}
|
||||
|
||||
public FileDirectoryRequest getFileDirectory() {
|
||||
return fileDirectory;
|
||||
}
|
||||
|
||||
public void setFileDirectory(FileDirectoryRequest fileDirectory) {
|
||||
this.fileDirectory = fileDirectory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (fileDirectory != null) {
|
||||
codeLength += fileDirectory.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 77
|
||||
reverseOS.write(0x4D);
|
||||
reverseOS.write(0xBF);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fileDelete != null) {
|
||||
codeLength += fileDelete.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 76
|
||||
reverseOS.write(0x4C);
|
||||
reverseOS.write(0xBF);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fileClose != null) {
|
||||
codeLength += fileClose.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 74
|
||||
reverseOS.write(0x4A);
|
||||
reverseOS.write(0x9F);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fileRead != null) {
|
||||
codeLength += fileRead.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 73
|
||||
reverseOS.write(0x49);
|
||||
reverseOS.write(0x9F);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fileOpen != null) {
|
||||
codeLength += fileOpen.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 72
|
||||
reverseOS.write(0x48);
|
||||
reverseOS.write(0xBF);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
codeLength += deleteNamedVariableList.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
|
||||
reverseOS.write(0xAD);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
sublength = getNamedVariableListAttributes.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
|
||||
reverseOS.write(0xAC);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
codeLength += defineNamedVariableList.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 11
|
||||
reverseOS.write(0xAB);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
sublength = getVariableAccessAttributes.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
|
||||
reverseOS.write(0xA6);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
codeLength += write.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
reverseOS.write(0xA5);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
codeLength += read.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
reverseOS.write(0xA4);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNameList != null) {
|
||||
codeLength += getNameList.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
getNameList = new GetNameListRequest();
|
||||
tlvByteCount += getNameList.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
read = new ReadRequest();
|
||||
tlvByteCount += read.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
write = new WriteRequest();
|
||||
tlvByteCount += write.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
|
||||
BerLength length = new BerLength();
|
||||
tlvByteCount += length.decode(is);
|
||||
getVariableAccessAttributes = new GetVariableAccessAttributesRequest();
|
||||
tlvByteCount += getVariableAccessAttributes.decode(is, null);
|
||||
tlvByteCount += length.readEocIfIndefinite(is);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 11)) {
|
||||
defineNamedVariableList = new DefineNamedVariableListRequest();
|
||||
tlvByteCount += defineNamedVariableList.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
|
||||
BerLength length = new BerLength();
|
||||
tlvByteCount += length.decode(is);
|
||||
getNamedVariableListAttributes = new GetNamedVariableListAttributesRequest();
|
||||
tlvByteCount += getNamedVariableListAttributes.decode(is, null);
|
||||
tlvByteCount += length.readEocIfIndefinite(is);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
|
||||
deleteNamedVariableList = new DeleteNamedVariableListRequest();
|
||||
tlvByteCount += deleteNamedVariableList.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 72)) {
|
||||
fileOpen = new FileOpenRequest();
|
||||
tlvByteCount += fileOpen.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 73)) {
|
||||
fileRead = new FileReadRequest();
|
||||
tlvByteCount += fileRead.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 74)) {
|
||||
fileClose = new FileCloseRequest();
|
||||
tlvByteCount += fileClose.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 76)) {
|
||||
fileDelete = new FileDeleteRequest();
|
||||
tlvByteCount += fileDelete.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 77)) {
|
||||
fileDirectory = new FileDirectoryRequest();
|
||||
tlvByteCount += fileDirectory.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.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;
|
||||
}
|
||||
|
||||
if (fileOpen != null) {
|
||||
sb.append("fileOpen: ");
|
||||
fileOpen.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileRead != null) {
|
||||
sb.append("fileRead: ").append(fileRead);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileClose != null) {
|
||||
sb.append("fileClose: ").append(fileClose);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileDelete != null) {
|
||||
sb.append("fileDelete: ");
|
||||
fileDelete.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileDirectory != null) {
|
||||
sb.append("fileDirectory: ");
|
||||
fileDirectory.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
}
|
@ -0,0 +1,430 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ConfirmedServiceResponse implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private 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;
|
||||
private FileOpenResponse fileOpen = null;
|
||||
private FileReadResponse fileRead = null;
|
||||
private FileCloseResponse fileClose = null;
|
||||
private FileDeleteResponse fileDelete = null;
|
||||
private FileDirectoryResponse fileDirectory = null;
|
||||
|
||||
public ConfirmedServiceResponse() {}
|
||||
|
||||
public ConfirmedServiceResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public GetNameListResponse getGetNameList() {
|
||||
return getNameList;
|
||||
}
|
||||
|
||||
public void setGetNameList(GetNameListResponse getNameList) {
|
||||
this.getNameList = getNameList;
|
||||
}
|
||||
|
||||
public ReadResponse getRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setRead(ReadResponse read) {
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public WriteResponse getWrite() {
|
||||
return write;
|
||||
}
|
||||
|
||||
public void setWrite(WriteResponse write) {
|
||||
this.write = write;
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesResponse getGetVariableAccessAttributes() {
|
||||
return getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public void setGetVariableAccessAttributes(
|
||||
GetVariableAccessAttributesResponse getVariableAccessAttributes) {
|
||||
this.getVariableAccessAttributes = getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public DefineNamedVariableListResponse getDefineNamedVariableList() {
|
||||
return defineNamedVariableList;
|
||||
}
|
||||
|
||||
public void setDefineNamedVariableList(DefineNamedVariableListResponse defineNamedVariableList) {
|
||||
this.defineNamedVariableList = defineNamedVariableList;
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesResponse getGetNamedVariableListAttributes() {
|
||||
return getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public void setGetNamedVariableListAttributes(
|
||||
GetNamedVariableListAttributesResponse getNamedVariableListAttributes) {
|
||||
this.getNamedVariableListAttributes = getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListResponse getDeleteNamedVariableList() {
|
||||
return deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public void setDeleteNamedVariableList(DeleteNamedVariableListResponse deleteNamedVariableList) {
|
||||
this.deleteNamedVariableList = deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public FileOpenResponse getFileOpen() {
|
||||
return fileOpen;
|
||||
}
|
||||
|
||||
public void setFileOpen(FileOpenResponse fileOpen) {
|
||||
this.fileOpen = fileOpen;
|
||||
}
|
||||
|
||||
public FileReadResponse getFileRead() {
|
||||
return fileRead;
|
||||
}
|
||||
|
||||
public void setFileRead(FileReadResponse fileRead) {
|
||||
this.fileRead = fileRead;
|
||||
}
|
||||
|
||||
public FileCloseResponse getFileClose() {
|
||||
return fileClose;
|
||||
}
|
||||
|
||||
public void setFileClose(FileCloseResponse fileClose) {
|
||||
this.fileClose = fileClose;
|
||||
}
|
||||
|
||||
public FileDeleteResponse getFileDelete() {
|
||||
return fileDelete;
|
||||
}
|
||||
|
||||
public void setFileDelete(FileDeleteResponse fileDelete) {
|
||||
this.fileDelete = fileDelete;
|
||||
}
|
||||
|
||||
public FileDirectoryResponse getFileDirectory() {
|
||||
return fileDirectory;
|
||||
}
|
||||
|
||||
public void setFileDirectory(FileDirectoryResponse fileDirectory) {
|
||||
this.fileDirectory = fileDirectory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (fileDirectory != null) {
|
||||
codeLength += fileDirectory.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 77
|
||||
reverseOS.write(0x4D);
|
||||
reverseOS.write(0xBF);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fileDelete != null) {
|
||||
codeLength += fileDelete.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 76
|
||||
reverseOS.write(0x4C);
|
||||
reverseOS.write(0x9F);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fileClose != null) {
|
||||
codeLength += fileClose.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 74
|
||||
reverseOS.write(0x4A);
|
||||
reverseOS.write(0x9F);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fileRead != null) {
|
||||
codeLength += fileRead.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 73
|
||||
reverseOS.write(0x49);
|
||||
reverseOS.write(0xBF);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fileOpen != null) {
|
||||
codeLength += fileOpen.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 72
|
||||
reverseOS.write(0x48);
|
||||
reverseOS.write(0xBF);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
codeLength += deleteNamedVariableList.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
|
||||
reverseOS.write(0xAD);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
codeLength += getNamedVariableListAttributes.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
|
||||
reverseOS.write(0xAC);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
codeLength += defineNamedVariableList.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
|
||||
reverseOS.write(0x8B);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
codeLength += getVariableAccessAttributes.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
|
||||
reverseOS.write(0xA6);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
codeLength += write.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
reverseOS.write(0xA5);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
codeLength += read.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
reverseOS.write(0xA4);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNameList != null) {
|
||||
codeLength += getNameList.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
getNameList = new GetNameListResponse();
|
||||
tlvByteCount += getNameList.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
read = new ReadResponse();
|
||||
tlvByteCount += read.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
write = new WriteResponse();
|
||||
tlvByteCount += write.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
|
||||
getVariableAccessAttributes = new GetVariableAccessAttributesResponse();
|
||||
tlvByteCount += getVariableAccessAttributes.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
|
||||
defineNamedVariableList = new DefineNamedVariableListResponse();
|
||||
tlvByteCount += defineNamedVariableList.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
|
||||
getNamedVariableListAttributes = new GetNamedVariableListAttributesResponse();
|
||||
tlvByteCount += getNamedVariableListAttributes.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
|
||||
deleteNamedVariableList = new DeleteNamedVariableListResponse();
|
||||
tlvByteCount += deleteNamedVariableList.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 72)) {
|
||||
fileOpen = new FileOpenResponse();
|
||||
tlvByteCount += fileOpen.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 73)) {
|
||||
fileRead = new FileReadResponse();
|
||||
tlvByteCount += fileRead.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 74)) {
|
||||
fileClose = new FileCloseResponse();
|
||||
tlvByteCount += fileClose.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 76)) {
|
||||
fileDelete = new FileDeleteResponse();
|
||||
tlvByteCount += fileDelete.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 77)) {
|
||||
fileDirectory = new FileDirectoryResponse();
|
||||
tlvByteCount += fileDirectory.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.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;
|
||||
}
|
||||
|
||||
if (fileOpen != null) {
|
||||
sb.append("fileOpen: ");
|
||||
fileOpen.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileRead != null) {
|
||||
sb.append("fileRead: ");
|
||||
fileRead.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileClose != null) {
|
||||
sb.append("fileClose: ").append(fileClose);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileDelete != null) {
|
||||
sb.append("fileDelete: ").append(fileDelete);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileDirectory != null) {
|
||||
sb.append("fileDirectory: ");
|
||||
fileDirectory.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
}
|
@ -0,0 +1,701 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerBitString;
|
||||
import com.beanit.asn1bean.ber.types.BerInteger;
|
||||
import com.beanit.asn1bean.ber.types.BerOctetString;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import com.beanit.asn1bean.ber.types.string.BerVisibleString;
|
||||
import com.beanit.iec61850bean.internal.BerBoolean;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class Data implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
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 Array getArray() {
|
||||
return array;
|
||||
}
|
||||
|
||||
public void setArray(Array array) {
|
||||
this.array = array;
|
||||
}
|
||||
|
||||
public Structure getStructure() {
|
||||
return structure;
|
||||
}
|
||||
|
||||
public void setStructure(Structure structure) {
|
||||
this.structure = structure;
|
||||
}
|
||||
|
||||
public BerBoolean getBool() {
|
||||
return bool;
|
||||
}
|
||||
|
||||
public void setBool(BerBoolean bool) {
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
public BerBitString getBitString() {
|
||||
return bitString;
|
||||
}
|
||||
|
||||
public void setBitString(BerBitString bitString) {
|
||||
this.bitString = bitString;
|
||||
}
|
||||
|
||||
public BerInteger getInteger() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
public void setInteger(BerInteger integer) {
|
||||
this.integer = integer;
|
||||
}
|
||||
|
||||
public BerInteger getUnsigned() {
|
||||
return unsigned;
|
||||
}
|
||||
|
||||
public void setUnsigned(BerInteger unsigned) {
|
||||
this.unsigned = unsigned;
|
||||
}
|
||||
|
||||
public FloatingPoint getFloatingPoint() {
|
||||
return floatingPoint;
|
||||
}
|
||||
|
||||
public void setFloatingPoint(FloatingPoint floatingPoint) {
|
||||
this.floatingPoint = floatingPoint;
|
||||
}
|
||||
|
||||
public BerOctetString getOctetString() {
|
||||
return octetString;
|
||||
}
|
||||
|
||||
public void setOctetString(BerOctetString octetString) {
|
||||
this.octetString = octetString;
|
||||
}
|
||||
|
||||
public BerVisibleString getVisibleString() {
|
||||
return visibleString;
|
||||
}
|
||||
|
||||
public void setVisibleString(BerVisibleString visibleString) {
|
||||
this.visibleString = visibleString;
|
||||
}
|
||||
|
||||
public TimeOfDay getBinaryTime() {
|
||||
return binaryTime;
|
||||
}
|
||||
|
||||
public void setBinaryTime(TimeOfDay binaryTime) {
|
||||
this.binaryTime = binaryTime;
|
||||
}
|
||||
|
||||
public MMSString getMMSString() {
|
||||
return mMSString;
|
||||
}
|
||||
|
||||
public void setMMSString(MMSString mMSString) {
|
||||
this.mMSString = mMSString;
|
||||
}
|
||||
|
||||
public UtcTime getUtcTime() {
|
||||
return utcTime;
|
||||
}
|
||||
|
||||
public void setUtcTime(UtcTime utcTime) {
|
||||
this.utcTime = utcTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (utcTime != null) {
|
||||
codeLength += utcTime.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 17
|
||||
reverseOS.write(0x91);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (mMSString != null) {
|
||||
codeLength += mMSString.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 16
|
||||
reverseOS.write(0x90);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (binaryTime != null) {
|
||||
codeLength += binaryTime.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 12
|
||||
reverseOS.write(0x8C);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (visibleString != null) {
|
||||
codeLength += visibleString.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 10
|
||||
reverseOS.write(0x8A);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (octetString != null) {
|
||||
codeLength += octetString.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 9
|
||||
reverseOS.write(0x89);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (floatingPoint != null) {
|
||||
codeLength += floatingPoint.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 7
|
||||
reverseOS.write(0x87);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (unsigned != null) {
|
||||
codeLength += unsigned.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 6
|
||||
reverseOS.write(0x86);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (integer != null) {
|
||||
codeLength += integer.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 5
|
||||
reverseOS.write(0x85);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (bitString != null) {
|
||||
codeLength += bitString.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 4
|
||||
reverseOS.write(0x84);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (bool != null) {
|
||||
codeLength += bool.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
|
||||
reverseOS.write(0x83);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (structure != null) {
|
||||
codeLength += structure.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
reverseOS.write(0xA2);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (array != null) {
|
||||
codeLength += array.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
array = new Array();
|
||||
tlvByteCount += array.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
structure = new Structure();
|
||||
tlvByteCount += structure.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
|
||||
bool = new BerBoolean();
|
||||
tlvByteCount += bool.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) {
|
||||
bitString = new BerBitString();
|
||||
tlvByteCount += bitString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) {
|
||||
integer = new BerInteger();
|
||||
tlvByteCount += integer.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) {
|
||||
unsigned = new BerInteger();
|
||||
tlvByteCount += unsigned.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 7)) {
|
||||
floatingPoint = new FloatingPoint();
|
||||
tlvByteCount += floatingPoint.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) {
|
||||
octetString = new BerOctetString();
|
||||
tlvByteCount += octetString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) {
|
||||
visibleString = new BerVisibleString();
|
||||
tlvByteCount += visibleString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 12)) {
|
||||
binaryTime = new TimeOfDay();
|
||||
tlvByteCount += binaryTime.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 16)) {
|
||||
mMSString = new MMSString();
|
||||
tlvByteCount += mMSString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 17)) {
|
||||
utcTime = new UtcTime();
|
||||
tlvByteCount += utcTime.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.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("<none>");
|
||||
}
|
||||
|
||||
public static class Array implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private List<Data> seqOf = null;
|
||||
|
||||
public Array() {
|
||||
seqOf = new ArrayList<Data>();
|
||||
}
|
||||
|
||||
public Array(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<Data> getData() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<Data>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
Data element = new Data();
|
||||
numDecodedBytes = element.decode(is, berTag);
|
||||
if (numDecodedBytes == 0) {
|
||||
throw new IOException("Tag did not match");
|
||||
}
|
||||
vByteCount += numDecodedBytes;
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException(
|
||||
"Decoded SequenceOf or SetOf has wrong length. Expected "
|
||||
+ lengthVal
|
||||
+ " but has "
|
||||
+ vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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<Data> 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 BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private List<Data> seqOf = null;
|
||||
|
||||
public Structure() {
|
||||
seqOf = new ArrayList<Data>();
|
||||
}
|
||||
|
||||
public Structure(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<Data> getData() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<Data>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
Data element = new Data();
|
||||
numDecodedBytes = element.decode(is, berTag);
|
||||
if (numDecodedBytes == 0) {
|
||||
throw new IOException("Tag did not match");
|
||||
}
|
||||
vByteCount += numDecodedBytes;
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException(
|
||||
"Decoded SequenceOf or SetOf has wrong length. Expected "
|
||||
+ lengthVal
|
||||
+ " but has "
|
||||
+ vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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<Data> 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("}");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.types.BerInteger;
|
||||
import java.math.BigInteger;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,173 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class DefineNamedVariableListRequest implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private ObjectName variableListName = null;
|
||||
private VariableDefs listOfVariable = null;
|
||||
|
||||
public DefineNamedVariableListRequest() {}
|
||||
|
||||
public DefineNamedVariableListRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ObjectName getVariableListName() {
|
||||
return variableListName;
|
||||
}
|
||||
|
||||
public void setVariableListName(ObjectName variableListName) {
|
||||
this.variableListName = variableListName;
|
||||
}
|
||||
|
||||
public VariableDefs getListOfVariable() {
|
||||
return listOfVariable;
|
||||
}
|
||||
|
||||
public void setListOfVariable(VariableDefs listOfVariable) {
|
||||
this.listOfVariable = listOfVariable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfVariable.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += variableListName.encode(reverseOS);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
variableListName = new ObjectName();
|
||||
numDecodedBytes = variableListName.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfVariable = new VariableDefs();
|
||||
vByteCount += listOfVariable.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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: <empty-required-field>");
|
||||
}
|
||||
|
||||
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: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.types.BerNull;
|
||||
|
||||
public class DefineNamedVariableListResponse extends BerNull {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public DefineNamedVariableListResponse() {}
|
||||
|
||||
public DefineNamedVariableListResponse(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
}
|
@ -0,0 +1,456 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerInteger;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class DeleteNamedVariableListRequest implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private 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 BerInteger getScopeOfDelete() {
|
||||
return scopeOfDelete;
|
||||
}
|
||||
|
||||
public void setScopeOfDelete(BerInteger scopeOfDelete) {
|
||||
this.scopeOfDelete = scopeOfDelete;
|
||||
}
|
||||
|
||||
public ListOfVariableListName getListOfVariableListName() {
|
||||
return listOfVariableListName;
|
||||
}
|
||||
|
||||
public void setListOfVariableListName(ListOfVariableListName listOfVariableListName) {
|
||||
this.listOfVariableListName = listOfVariableListName;
|
||||
}
|
||||
|
||||
public DomainName getDomainName() {
|
||||
return domainName;
|
||||
}
|
||||
|
||||
public void setDomainName(DomainName domainName) {
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (domainName != null) {
|
||||
sublength = domainName.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
reverseOS.write(0xA2);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (listOfVariableListName != null) {
|
||||
codeLength += listOfVariableListName.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (scopeOfDelete != null) {
|
||||
codeLength += scopeOfDelete.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
if (lengthVal == 0) {
|
||||
return tlByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
scopeOfDelete = new BerInteger();
|
||||
vByteCount += scopeOfDelete.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
listOfVariableListName = new ListOfVariableListName();
|
||||
vByteCount += listOfVariableListName.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
vByteCount += length.decode(is);
|
||||
domainName = new DomainName();
|
||||
vByteCount += domainName.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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("}");
|
||||
}
|
||||
|
||||
public static class ListOfVariableListName implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private List<ObjectName> seqOf = null;
|
||||
|
||||
public ListOfVariableListName() {
|
||||
seqOf = new ArrayList<ObjectName>();
|
||||
}
|
||||
|
||||
public ListOfVariableListName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<ObjectName> getObjectName() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<ObjectName>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
ObjectName element = new ObjectName();
|
||||
numDecodedBytes = element.decode(is, berTag);
|
||||
if (numDecodedBytes == 0) {
|
||||
throw new IOException("Tag did not match");
|
||||
}
|
||||
vByteCount += numDecodedBytes;
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException(
|
||||
"Decoded SequenceOf or SetOf has wrong length. Expected "
|
||||
+ lengthVal
|
||||
+ " but has "
|
||||
+ vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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<ObjectName> 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 BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BasicIdentifier basic = null;
|
||||
|
||||
public DomainName() {}
|
||||
|
||||
public DomainName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public BasicIdentifier getBasic() {
|
||||
return basic;
|
||||
}
|
||||
|
||||
public void setBasic(BasicIdentifier basic) {
|
||||
this.basic = basic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (basic != null) {
|
||||
codeLength += basic.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BasicIdentifier.tag)) {
|
||||
basic = new BasicIdentifier();
|
||||
tlvByteCount += basic.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.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("<none>");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,173 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class DeleteNamedVariableListResponse implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private Unsigned32 numberMatched = null;
|
||||
private Unsigned32 numberDeleted = null;
|
||||
|
||||
public DeleteNamedVariableListResponse() {}
|
||||
|
||||
public DeleteNamedVariableListResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Unsigned32 getNumberMatched() {
|
||||
return numberMatched;
|
||||
}
|
||||
|
||||
public void setNumberMatched(Unsigned32 numberMatched) {
|
||||
this.numberMatched = numberMatched;
|
||||
}
|
||||
|
||||
public Unsigned32 getNumberDeleted() {
|
||||
return numberDeleted;
|
||||
}
|
||||
|
||||
public void setNumberDeleted(Unsigned32 numberDeleted) {
|
||||
this.numberDeleted = numberDeleted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += numberDeleted.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += numberMatched.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
numberMatched = new Unsigned32();
|
||||
vByteCount += numberMatched.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
numberDeleted = new Unsigned32();
|
||||
vByteCount += numberDeleted.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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: <empty-required-field>");
|
||||
}
|
||||
|
||||
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: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class DirectoryEntry implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private FileName fileName = null;
|
||||
private FileAttributes fileAttributes = null;
|
||||
|
||||
public DirectoryEntry() {}
|
||||
|
||||
public DirectoryEntry(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public FileName getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(FileName fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public FileAttributes getFileAttributes() {
|
||||
return fileAttributes;
|
||||
}
|
||||
|
||||
public void setFileAttributes(FileAttributes fileAttributes) {
|
||||
this.fileAttributes = fileAttributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += fileAttributes.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += fileName.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
fileName = new FileName();
|
||||
vByteCount += fileName.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
fileAttributes = new FileAttributes();
|
||||
vByteCount += fileAttributes.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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 (fileName != null) {
|
||||
sb.append("fileName: ");
|
||||
fileName.appendAsString(sb, indentLevel + 1);
|
||||
} else {
|
||||
sb.append("fileName: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (fileAttributes != null) {
|
||||
sb.append("fileAttributes: ");
|
||||
fileAttributes.appendAsString(sb, indentLevel + 1);
|
||||
} else {
|
||||
sb.append("fileAttributes: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerGeneralizedTime;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class FileAttributes implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private Unsigned32 sizeOfFile = null;
|
||||
private BerGeneralizedTime lastModified = null;
|
||||
|
||||
public FileAttributes() {}
|
||||
|
||||
public FileAttributes(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Unsigned32 getSizeOfFile() {
|
||||
return sizeOfFile;
|
||||
}
|
||||
|
||||
public void setSizeOfFile(Unsigned32 sizeOfFile) {
|
||||
this.sizeOfFile = sizeOfFile;
|
||||
}
|
||||
|
||||
public BerGeneralizedTime getLastModified() {
|
||||
return lastModified;
|
||||
}
|
||||
|
||||
public void setLastModified(BerGeneralizedTime lastModified) {
|
||||
this.lastModified = lastModified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (lastModified != null) {
|
||||
codeLength += lastModified.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += sizeOfFile.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
sizeOfFile = new Unsigned32();
|
||||
vByteCount += sizeOfFile.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
lastModified = new BerGeneralizedTime();
|
||||
vByteCount += lastModified.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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 (sizeOfFile != null) {
|
||||
sb.append("sizeOfFile: ").append(sizeOfFile);
|
||||
} else {
|
||||
sb.append("sizeOfFile: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (lastModified != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("lastModified: ").append(lastModified);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
public class FileCloseRequest extends Integer32 {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileCloseRequest() {}
|
||||
|
||||
public FileCloseRequest(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public FileCloseRequest(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public FileCloseRequest(long value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.types.BerNull;
|
||||
|
||||
public class FileCloseResponse extends BerNull {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileCloseResponse() {}
|
||||
|
||||
public FileCloseResponse(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
public class FileDeleteRequest extends FileName {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileDeleteRequest() {}
|
||||
|
||||
public FileDeleteRequest(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.types.BerNull;
|
||||
|
||||
public class FileDeleteResponse extends BerNull {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileDeleteResponse() {}
|
||||
|
||||
public FileDeleteResponse(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
}
|
@ -0,0 +1,182 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class FileDirectoryRequest implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private FileName fileSpecification = null;
|
||||
private FileName continueAfter = null;
|
||||
|
||||
public FileDirectoryRequest() {}
|
||||
|
||||
public FileDirectoryRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public FileName getFileSpecification() {
|
||||
return fileSpecification;
|
||||
}
|
||||
|
||||
public void setFileSpecification(FileName fileSpecification) {
|
||||
this.fileSpecification = fileSpecification;
|
||||
}
|
||||
|
||||
public FileName getContinueAfter() {
|
||||
return continueAfter;
|
||||
}
|
||||
|
||||
public void setContinueAfter(FileName continueAfter) {
|
||||
this.continueAfter = continueAfter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (continueAfter != null) {
|
||||
codeLength += continueAfter.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (fileSpecification != null) {
|
||||
codeLength += fileSpecification.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
if (lengthVal == 0) {
|
||||
return tlByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
fileSpecification = new FileName();
|
||||
vByteCount += fileSpecification.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
continueAfter = new FileName();
|
||||
vByteCount += continueAfter.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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 (fileSpecification != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("fileSpecification: ");
|
||||
fileSpecification.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (continueAfter != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("continueAfter: ");
|
||||
continueAfter.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,321 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import com.beanit.iec61850bean.internal.BerBoolean;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class FileDirectoryResponse implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private ListOfDirectoryEntry listOfDirectoryEntry = null;
|
||||
private BerBoolean moreFollows = null;
|
||||
|
||||
public FileDirectoryResponse() {}
|
||||
|
||||
public FileDirectoryResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ListOfDirectoryEntry getListOfDirectoryEntry() {
|
||||
return listOfDirectoryEntry;
|
||||
}
|
||||
|
||||
public void setListOfDirectoryEntry(ListOfDirectoryEntry listOfDirectoryEntry) {
|
||||
this.listOfDirectoryEntry = listOfDirectoryEntry;
|
||||
}
|
||||
|
||||
public BerBoolean getMoreFollows() {
|
||||
return moreFollows;
|
||||
}
|
||||
|
||||
public void setMoreFollows(BerBoolean moreFollows) {
|
||||
this.moreFollows = moreFollows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (moreFollows != null) {
|
||||
codeLength += moreFollows.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
sublength = listOfDirectoryEntry.encode(reverseOS, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
vByteCount += length.decode(is);
|
||||
listOfDirectoryEntry = new ListOfDirectoryEntry();
|
||||
vByteCount += listOfDirectoryEntry.decode(is, true);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
moreFollows = new BerBoolean();
|
||||
vByteCount += moreFollows.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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 (listOfDirectoryEntry != null) {
|
||||
sb.append("listOfDirectoryEntry: ");
|
||||
listOfDirectoryEntry.appendAsString(sb, indentLevel + 1);
|
||||
} else {
|
||||
sb.append("listOfDirectoryEntry: <empty-required-field>");
|
||||
}
|
||||
|
||||
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("}");
|
||||
}
|
||||
|
||||
public static class ListOfDirectoryEntry implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private List<DirectoryEntry> seqOf = null;
|
||||
|
||||
public ListOfDirectoryEntry() {
|
||||
seqOf = new ArrayList<DirectoryEntry>();
|
||||
}
|
||||
|
||||
public ListOfDirectoryEntry(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<DirectoryEntry> getDirectoryEntry() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<DirectoryEntry>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(DirectoryEntry.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
DirectoryEntry element = new DirectoryEntry();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException(
|
||||
"Decoded SequenceOf or SetOf has wrong length. Expected "
|
||||
+ lengthVal
|
||||
+ " but has "
|
||||
+ vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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<DirectoryEntry> 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("}");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import com.beanit.asn1bean.ber.types.string.BerGraphicString;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class FileName implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private List<BerGraphicString> seqOf = null;
|
||||
|
||||
public FileName() {
|
||||
seqOf = new ArrayList<BerGraphicString>();
|
||||
}
|
||||
|
||||
public FileName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<BerGraphicString> getBerGraphicString() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<BerGraphicString>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(BerGraphicString.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
BerGraphicString element = new BerGraphicString();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException(
|
||||
"Decoded SequenceOf or SetOf has wrong length. Expected "
|
||||
+ lengthVal
|
||||
+ " but has "
|
||||
+ vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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<BerGraphicString> 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("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class FileOpenRequest implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private FileName fileName = null;
|
||||
private Unsigned32 initialPosition = null;
|
||||
|
||||
public FileOpenRequest() {}
|
||||
|
||||
public FileOpenRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public FileName getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(FileName fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public Unsigned32 getInitialPosition() {
|
||||
return initialPosition;
|
||||
}
|
||||
|
||||
public void setInitialPosition(Unsigned32 initialPosition) {
|
||||
this.initialPosition = initialPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += initialPosition.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += fileName.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
fileName = new FileName();
|
||||
vByteCount += fileName.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
initialPosition = new Unsigned32();
|
||||
vByteCount += initialPosition.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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 (fileName != null) {
|
||||
sb.append("fileName: ");
|
||||
fileName.appendAsString(sb, indentLevel + 1);
|
||||
} else {
|
||||
sb.append("fileName: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (initialPosition != null) {
|
||||
sb.append("initialPosition: ").append(initialPosition);
|
||||
} else {
|
||||
sb.append("initialPosition: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class FileOpenResponse implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private Integer32 frsmID = null;
|
||||
private FileAttributes fileAttributes = null;
|
||||
|
||||
public FileOpenResponse() {}
|
||||
|
||||
public FileOpenResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer32 getFrsmID() {
|
||||
return frsmID;
|
||||
}
|
||||
|
||||
public void setFrsmID(Integer32 frsmID) {
|
||||
this.frsmID = frsmID;
|
||||
}
|
||||
|
||||
public FileAttributes getFileAttributes() {
|
||||
return fileAttributes;
|
||||
}
|
||||
|
||||
public void setFileAttributes(FileAttributes fileAttributes) {
|
||||
this.fileAttributes = fileAttributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += fileAttributes.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += frsmID.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
frsmID = new Integer32();
|
||||
vByteCount += frsmID.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
fileAttributes = new FileAttributes();
|
||||
vByteCount += fileAttributes.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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 (frsmID != null) {
|
||||
sb.append("frsmID: ").append(frsmID);
|
||||
} else {
|
||||
sb.append("frsmID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (fileAttributes != null) {
|
||||
sb.append("fileAttributes: ");
|
||||
fileAttributes.appendAsString(sb, indentLevel + 1);
|
||||
} else {
|
||||
sb.append("fileAttributes: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
public class FileReadRequest extends Integer32 {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileReadRequest() {}
|
||||
|
||||
public FileReadRequest(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public FileReadRequest(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public FileReadRequest(long value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerOctetString;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import com.beanit.iec61850bean.internal.BerBoolean;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class FileReadResponse implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private byte[] code = null;
|
||||
private BerOctetString fileData = null;
|
||||
private BerBoolean moreFollows = null;
|
||||
|
||||
public FileReadResponse() {}
|
||||
|
||||
public FileReadResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public BerOctetString getFileData() {
|
||||
return fileData;
|
||||
}
|
||||
|
||||
public void setFileData(BerOctetString fileData) {
|
||||
this.fileData = fileData;
|
||||
}
|
||||
|
||||
public BerBoolean getMoreFollows() {
|
||||
return moreFollows;
|
||||
}
|
||||
|
||||
public void setMoreFollows(BerBoolean moreFollows) {
|
||||
this.moreFollows = moreFollows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (moreFollows != null) {
|
||||
codeLength += moreFollows.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += fileData.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
fileData = new BerOctetString();
|
||||
vByteCount += fileData.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
moreFollows = new BerBoolean();
|
||||
vByteCount += moreFollows.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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 (fileData != null) {
|
||||
sb.append("fileData: ").append(fileData);
|
||||
} else {
|
||||
sb.append("fileData: <empty-required-field>");
|
||||
}
|
||||
|
||||
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("}");
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.types.BerOctetString;
|
||||
|
||||
public class FloatingPoint extends BerOctetString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FloatingPoint() {}
|
||||
|
||||
public FloatingPoint(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
@ -0,0 +1,368 @@
|
||||
/*
|
||||
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.beanit.iec61850bean.internal.mms.asn1;
|
||||
|
||||
import com.beanit.asn1bean.ber.BerLength;
|
||||
import com.beanit.asn1bean.ber.BerTag;
|
||||
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
|
||||
import com.beanit.asn1bean.ber.types.BerNull;
|
||||
import com.beanit.asn1bean.ber.types.BerType;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class GetNameListRequest implements BerType, Serializable {
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private static final long serialVersionUID = 1L;
|
||||
private 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 ObjectClass getObjectClass() {
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
public void setObjectClass(ObjectClass objectClass) {
|
||||
this.objectClass = objectClass;
|
||||
}
|
||||
|
||||
public ObjectScope getObjectScope() {
|
||||
return objectScope;
|
||||
}
|
||||
|
||||
public void setObjectScope(ObjectScope objectScope) {
|
||||
this.objectScope = objectScope;
|
||||
}
|
||||
|
||||
public Identifier getContinueAfter() {
|
||||
return continueAfter;
|
||||
}
|
||||
|
||||
public void setContinueAfter(Identifier continueAfter) {
|
||||
this.continueAfter = continueAfter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (continueAfter != null) {
|
||||
codeLength += continueAfter.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
reverseOS.write(0x82);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
sublength = objectScope.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
sublength = objectClass.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
vByteCount += length.decode(is);
|
||||
objectClass = new ObjectClass();
|
||||
vByteCount += objectClass.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
vByteCount += length.decode(is);
|
||||
objectScope = new ObjectScope();
|
||||
vByteCount += objectScope.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
} else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
continueAfter = new Identifier();
|
||||
vByteCount += continueAfter.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException(
|
||||
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.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: <empty-required-field>");
|
||||
}
|
||||
|
||||
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: <empty-required-field>");
|
||||
}
|
||||
|
||||
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("}");
|
||||
}
|
||||
|
||||
public static class ObjectScope implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private 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 BerNull getVmdSpecific() {
|
||||
return vmdSpecific;
|
||||
}
|
||||
|
||||
public void setVmdSpecific(BerNull vmdSpecific) {
|
||||
this.vmdSpecific = vmdSpecific;
|
||||
}
|
||||
|
||||
public Identifier getDomainSpecific() {
|
||||
return domainSpecific;
|
||||
}
|
||||
|
||||
public void setDomainSpecific(Identifier domainSpecific) {
|
||||
this.domainSpecific = domainSpecific;
|
||||
}
|
||||
|
||||
public BerNull getAaSpecific() {
|
||||
return aaSpecific;
|
||||
}
|
||||
|
||||
public void setAaSpecific(BerNull aaSpecific) {
|
||||
this.aaSpecific = aaSpecific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (aaSpecific != null) {
|
||||
codeLength += aaSpecific.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
reverseOS.write(0x82);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
codeLength += domainSpecific.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
codeLength += vmdSpecific.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
vmdSpecific = new BerNull();
|
||||
tlvByteCount += vmdSpecific.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
domainSpecific = new Identifier();
|
||||
tlvByteCount += domainSpecific.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
aaSpecific = new BerNull();
|
||||
tlvByteCount += aaSpecific.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.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("<none>");
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue