Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 2744 → Rev 2745

/branches/AMB/AdapterFramework/javasrc/tool/org/etsi/tool/spirent/codec/TTWBCodecSupport.java
File deleted
Property changes:
Deleted: svn:keywords
## -1 +0,0 ##
-URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/spirent/codec/TciCDWrapper.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/spirent/codec/TciCDWrapper.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/spirent/codec/TciCDWrapper.java (nonexistent)
@@ -1,148 +0,0 @@
-/**
- * @author STF 424_ITS_Test_Platform
- * @version $id$
- */
-package org.etsi.tool.spirent.codec;
-
-import java.math.BigInteger;
-
-import org.etsi.ttcn.codec.core.ITciCDWrapper;
-import org.etsi.ttcn.tci.BooleanValue;
-import org.etsi.ttcn.tci.CharstringValue;
-import org.etsi.ttcn.tci.EnumeratedValue;
-import org.etsi.ttcn.tci.FloatValue;
-import org.etsi.ttcn.tci.IntegerValue;
-import org.etsi.ttcn.tci.OctetstringValue;
-import org.etsi.ttcn.tci.RecordOfValue;
-import org.etsi.ttcn.tci.RecordValue;
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-
-import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
-
-/** This class implements the ITciCDWrapper interface
- *
- * Note that the TCI Codec Interface (TCI-CD) describes the operations a TTCN-3 Executable is required to implement and the operations a codec implementation for a certain encoding scheme shall provide to the TE
- *
- * See ETSI ES 201 873-6 V4.2.1 - Clause 7.3.2.1 TCI-CD required
- */
-public class TciCDWrapper implements ITciCDWrapper {
-
- /**
- * RuntimeBehavior instance reference
- */
- private RB _rb;
-
- /**
- * Specialized ctor
- * @param rb TTCN-3 runtime reference
- */
- public TciCDWrapper(final RB rb) {
- _rb = rb;
- }
-
- @Override
- public IntegerValue setInteger(Integer value) {
- IntegerValue iv = (IntegerValue)_rb.getTciCDRequired().getInteger().newInstance();
- iv.setInt(value);
- return iv;
- }
-
- @Override
- public IntegerValue setInteger(BigInteger value) {
- IntegerValue iv = (IntegerValue)_rb.getTciCDRequired().getInteger().newInstance();
- iv.setBigInt(value);
- return iv;
- }
-
- @Override
- public void setInteger(IntegerValue intValue, final Integer value) {
- intValue.setInt(value);
- }
-
- @Override
- public void setInteger(BigInteger value, IntegerValue setInt) {
- setInt.setBigInt(value);
- }
-
- /** Constructs and returns a basic TTCN-3 integer type
- *
- * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.1.2 getInteger
- * @return An instance of Type representing a TTCN-3 integer type
- */
-// @Override
-// public IntegerValue getInteger() {
-// return (IntegerValue)_rb.getTciCDRequired().getInteger().newInstance();
-// }
-//
- @Override
- public int getInteger(IntegerValue iv) {
- return iv.getInt();
- }
-
- @Override
- public long getBigInteger(IntegerValue iv) {
- return iv.getBigInt().longValue();
- }
-
- /** Constructs and returns a basic TTCN-3 float type
- *
- * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.1.3 getFloat
- * @return An instance of Type representing a TTCN-3 float type
- */
- @Override
- public FloatValue getFloat() {
- return (FloatValue)_rb.getTciCDRequired().getFloat().newInstance();
- }
-
- /** Constructs and returns a basic TTCN-3 octet string type
- *
- * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.1.2 getOctetstring
- * @return An instance of Type representing a TTCN-3 octet string type
- */
- @Override
- public OctetstringValue getOctetstring() {
- return (OctetstringValue)_rb.getTciCDRequired().getOctetstring().newInstance();
- }
-
- /** Constructs and returns a basic TTCN-3 string type
- *
- * @return An instance of Type representing a TTCN-3 string type
- */
- @Override
- public CharstringValue getCharstringValue() {
- return (CharstringValue)_rb.getTciCDRequired().getCharstring().newInstance();
- }
-
- @Override
- public Value getUnionValue(Type decodingHypothesis, String variantName) {
- System.err.println("Unknown variant: " + variantName);
- throw new RuntimeException("Not implemented for TTWB");
- }
-
- @Override
- public Type getTypeForName(String type) {
- return _rb.getTciCDRequired().getTypeForName(type);
- }
-
- @Override
- public BooleanValue getBoolean() {
- return (BooleanValue)_rb.getTciCDRequired().getBoolean().newInstance();
- }
-
- @Override
- public RecordValue getRecordValue(String typeName) {
- return (RecordValue) _rb.getTciCDRequired().getTypeForName(typeName);
- }
-
- @Override
- public RecordOfValue getRecordOfValue(String typeName) {
- return (RecordOfValue) _rb.getTciCDRequired().getTypeForName(typeName);
- }
-
- @Override
- public EnumeratedValue getEnumValue(String typeName) {
- return (EnumeratedValue) _rb.getTciCDRequired().getTypeForName(typeName);
- }
-
-} // End of class TciCDWrapper
/AdapterFramework/javasrc/tool/org/etsi/tool/spirent/codec/TciCDWrapper.java
Property changes:
Deleted: svn:keywords
## -1 +0,0 ##
-URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/spirent/codec/Its_CodecProvider.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/spirent/codec/Its_CodecProvider.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/spirent/codec/Its_CodecProvider.java (nonexistent)
@@ -1,85 +0,0 @@
-/**
- * @author ETSI / STF462 / Alexandre Berge
- * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/javasrc/tool/org/etsi/its/tool/testingtech/Its_CodecProvider.java $
- * $Id: Its_CodecProvider.java 141 2016-10-17 14:55:22Z berge $
- */
-package org.etsi.tool.spirent.codec;
-
-import org.etsi.ttcn.codec.core.ITciCDWrapper;
-import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
-import org.etsi.ttcn.codec.core.CodecFactory;
-import org.etsi.ttcn.codec.core.MainCodec;
-import org.etsi.ttcn.tci.TciCDProvided;
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-import com.testingtech.ttcn.extension.CodecProvider;
-import com.testingtech.util.plugin.PluginInitException;
-
-import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
-
-/** This is the main entry point for Its codec
- */
-public class Its_CodecProvider implements CodecProvider {
-
- /**
- * This method provides the codec associated to the specified encoding identifier
- *
- * @param rb TTwb Runtime reference
- * @param encodingName The name of the encoding, specified by the TTCN-3 key words 'with/encode'
- * @return The codec associated to the specified encoding identifier
- */
- @Override
- public TciCDProvided getCodec(RB rb, String encodingName) throws PluginInitException {
-
- // Register External codecs
- CodecFactory cf = CodecFactory.getInstance();
- TTWBCodecSupport cs = new TTWBCodecSupport(rb);
-
- //cf.setExternalCodec("LibItsCam_asn1", cs.getCodec("LibItsCam_asn1"));
- //cf.setExternalCodec("LibItsDenm_asn1", cs.getCodec("LibItsDenm_asn1"));
- //cf.setExternalCodec("LibItsMapSpat_asn1", cs.getCodec("LibItsMapSpat_asn1"));
-
- //TciCDProvided xmlCodec = cs.getCodec("CDT_accessControlPolicy_v1_0_0");
- //((com.testingtech.ttcn.tri.ICDPlugin)xmlCodec).setUp(); // Bug in TTWBCodecSupport
- //cf.setExternalCodec("CDT_accessControlPolicy_v1_0_0", xmlCodec);
-
- //TODO: add V2G external codecs (xsd)
- //TODO: Yann add CALM external codecs (ASN.1)
- return new Codec(rb);
- }
-
- private class Codec implements TciCDProvided {
-
- public Codec(RB rb) {
- TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper(rb));
- }
-
- @Override
- public Value decode(TriMessage message, Type decodingHypothesis) {
- MainCodec codec = new MainCodec((ITciCDWrapper) TciCDWrapperFactory.getTciCDInstance());
- Value v = null;
- try {
- v = codec.triDecode(message, decodingHypothesis);
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- return v;
- }
-
- @Override
- public TriMessage encode(Value value) {
- MainCodec codec = new MainCodec((ITciCDWrapper) TciCDWrapperFactory.getTciCDInstance());
- TriMessage m = null;
- try {
- m = codec.triEncode(value);
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- return m;
- }
- }
-}
Index: AdapterFramework/javasrc/tool/org/etsi/tool/spirent/xf/ExternalFunctionsPluginProvider.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/spirent/xf/ExternalFunctionsPluginProvider.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/spirent/xf/ExternalFunctionsPluginProvider.java (nonexistent)
@@ -1,361 +0,0 @@
-/**
- * @author STF 424_ITS_Test_Platform
- * @version $id$
- */
-package org.etsi.tool.spirent.xf;
-
-import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
-import org.etsi.its.extfunc.IItsExternalFunctionsProvider;
-import org.etsi.its.extfunc.ItsExternalFunctionsProvider;
-import org.etsi.tool.spirent.codec.TciCDWrapper; // FIXME investigate this
-import org.etsi.ttcn.tci.BooleanValue;
-import org.etsi.ttcn.tci.CharstringValue;
-import org.etsi.ttcn.tci.FloatValue;
-import org.etsi.ttcn.tci.IntegerValue;
-import org.etsi.ttcn.tci.OctetstringValue;
-import org.etsi.ttcn.tci.RecordOfValue;
-import org.etsi.ttcn.tci.RecordValue;
-
-import com.testingtech.ttcn.extension.ExternalFunctionsProvider;
-import com.testingtech.ttcn.tri.ExternalFunctionsDefinition;
-
-import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
-
-/**
- * This class provides access to the implementation of TTCN-3 external function
- * @see IItsExternalFunctionsProvider
- */
-public class ExternalFunctionsPluginProvider implements ExternalFunctionsProvider, ExternalFunctionsDefinition, IItsExternalFunctionsProvider {
-
- /**
- * Reference to the
- */
- private IItsExternalFunctionsProvider _externalFunctionsPluginProvider;
-
-
- /**
- * Constructor
- */
- public ExternalFunctionsPluginProvider() {
- _externalFunctionsPluginProvider = null;
-
- }
-
- /**
- * Constructor
- *
- * @param rb TTwb runtime reference
- */
- public ExternalFunctionsPluginProvider(RB rb) {
- TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper(rb)); // FIXME investigate this
- _externalFunctionsPluginProvider = (IItsExternalFunctionsProvider)new ItsExternalFunctionsProvider();
-
- }
-
- /**
- * Refer to TTwb developer's guide
- */
- @Override
- public ExternalFunctionsDefinition getExternalFunctions(RB rb) {
- return new ExternalFunctionsPluginProvider(rb);
- }
-
- /**
- * This external function gets the current time
- * @param pLatitudeA Latitude of node A
- * @param pLongitudeA Longitude of node A
- * @param pLatitudeB Latitude of node B
- * @param pLongitudeB Longitude of node B
- * @return The current time in Epoch format
- *
- * TTCN-3 signature:
- * external function fx_computeDistance(in UInt32 p_latitudeA, in UInt32 p_longitudeA, in UInt32 p_latitudeB, in UInt32 p_longitudeB) return float;
- */
- @Override
- public FloatValue fx_computeDistance(IntegerValue pLatitudeA,
- IntegerValue pLongitudeA, IntegerValue pLatitudeB,
- IntegerValue pLongitudeB) {
- return _externalFunctionsPluginProvider.fx_computeDistance(pLatitudeA, pLongitudeA, pLatitudeB, pLongitudeB);
- }
-
- /**
- * External function to compute a position using a reference position, a distance and an orientation
- * @param pIutLongPosVector Reference position
- * @param pDistance Distance to the reference position (in meter)
- * @param pOrientation Direction of the computed position (0 to 359; 0 means North)
- * @param pLatitude Computed position's latitude
- * @param pLongitude Computed position's longitude
- *
- * TTCN-3 signature:
- * external function fx_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in integer p_distance, in integer p_orientation, out UInt32 p_latitude, out UInt32 p_longitude);
- */
- @Override
- public void fx_computePositionUsingDistance(
- IntegerValue p_refLatitude, IntegerValue p_refLongitude,
- FloatValue pDistance, IntegerValue pOrientation,
- IntegerValue pLatitude, IntegerValue pLongitude) {
- _externalFunctionsPluginProvider.fx_computePositionUsingDistance(p_refLatitude, p_refLongitude, pDistance, pOrientation, pLatitude, pLongitude);
- }
-
- /**
- * External function to compute a position using a reference position, a distance and an orientation
- * @param pIutLongPosVector Reference position
- * @param pCenLongPosVector Central reference position
- * @param p_rotation Rotation value (in degrees)
- * @param pLatitude Computed position's latitude
- * @param pLongitude Computed position's longitude
- *
- * TTCN-3 signature:
- * external function fx_computePositionFromRotation(in LongPosVector p_iutLongPosVector, in Int32 p_rotation, out Int32 p_latitude, out Int32 p_longitude);
- */
- @Override
- public void fx_computePositionFromRotation(
- IntegerValue p_refLatitude, IntegerValue p_refLongitude,
- IntegerValue p_cenLatitude, IntegerValue p_cenLongitude,
- IntegerValue pRotation,
- IntegerValue pLatitude, IntegerValue pLongitude) {
- _externalFunctionsPluginProvider.fx_computePositionFromRotation(p_refLatitude, p_refLongitude, p_cenLatitude, p_cenLongitude, pRotation, pLatitude, pLongitude);
- }
-
- @Override
- public FloatValue fx_computeRadiusFromCircularArea(FloatValue p_squareMeters) {
- return _externalFunctionsPluginProvider.fx_computeRadiusFromCircularArea(p_squareMeters);
- }
-
- /**
- * This external function gets the current time
- * @return The current time in Epoch format
- *
- * TTCN-3 signature:
- * external function fx_getCurrentTime() return TimeStamp;
- */
- @Override
- public IntegerValue fx_getCurrentTime() {
- return _externalFunctionsPluginProvider.fx_getCurrentTime();
- }
-
- /**
- * This external function gets the current time
- * @return The current time in tenths of a second in the current or next hour in units of 1/10th second from UTC time
- *
- * TTCN-3 signature:
- * external function fx_getCurrentTimeMark() return TimeMark;
- */
- @Override
- public IntegerValue fx_getCurrentTimeMark() {
- return _externalFunctionsPluginProvider.fx_getCurrentTimeMark();
- }
-
- /**
- * This external function gets the current time
- * @return The current time in tenths of a second in the current or next hour in units of 1/10th second from UTC time
- *
- * TTCN-3 signature:
- * external function fx_getMinuteOfTheYear() return MinuteOfTheYear;
- */
- @Override
- public IntegerValue fx_getMinuteOfTheYear() {
- return _externalFunctionsPluginProvider.fx_getMinuteOfTheYear();
- }
-
- /**
- * This external function gets the milliseconds point in the current UTC minute
- * @return The milliseconds point in the current UTC minute (0..60000)
- *
- * TTCN-3 signature:
- * external function fx_getDSecond() return DSecond;
- */
- public IntegerValue fx_getDSecond() {
- return _externalFunctionsPluginProvider.fx_getDSecond();
- }
-
- /**
- * External function to compute timestamp based on current time
- * @return Unix-Epoch-Time mod 2^32
- *
- * TTCN-3 signature:
- * external function fx_computeGnTimestamp() return UInt32;
- */
- @Override
- public IntegerValue fx_computeGnTimestamp() {
- return _externalFunctionsPluginProvider.fx_computeGnTimestamp();
-
- }
-
- /**
- * @desc Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3
- * @param p_sourceAddress Source address,
- * @param p_destinationAddress Destination address
- * @param p_payloadLength Upper-Layer Packet Length
- * @param p_payload Upper-Layer payload
- * @param p_nextHdr Next header value (e.g. 0x3a for ICMPv6)
- * @return The checksum value
- * @see RFC 2460 IPv6 Specification
- *
- * TTCN-3 signature:
- * external function fx_computeIPv6CheckSum(
- * in template (value) Ipv6Address p_sourceAddress,
- * in template (value) Ipv6Address p_destinationAddress,
- * in template (value) integer p_payloadLength,
- * in template (value) octetstring p_payload,
- * in template (value) integer p_nextHdr
- * ) return Oct2;
- * <pre>
- * Pseudo header is defined by RFC 2460 - Clause 8.1
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | |
- * + +
- * | |
- * + Source Address +
- * | |
- * + +
- * | |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | |
- * + +
- * | |
- * + Destination Address +
- * | |
- * + +
- * | |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Upper-Layer Packet Length |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | zero | Next Header |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * </pre>
- */
- @Override
- public OctetstringValue fx_computeIPv6CheckSum(
- OctetstringValue p_sourceAddress,
- OctetstringValue p_destinationAddress,
- IntegerValue p_payloadLength,
- OctetstringValue p_payload,
- IntegerValue p_nextHdr
- ) {
- return _externalFunctionsPluginProvider.fx_computeIPv6CheckSum(p_sourceAddress, p_destinationAddress, p_payloadLength, p_payload, p_nextHdr);
- }
-
- @Override
- public OctetstringValue xf_parseIpv6Address(final CharstringValue p_textIpv6Address) {
- return _externalFunctionsPluginProvider.xf_parseIpv6Address(p_textIpv6Address);
- }
-
- /**
- * @desc Produces a 256-bit (32-byte) hash value
- * @param p_toBeHashedData Data to be used to calculate the hash value
- * @return The hash value
- */
- @Override
- public OctetstringValue fx_hashWithSha256(final OctetstringValue p_toBeHashedData) {
- return _externalFunctionsPluginProvider.fx_hashWithSha256(p_toBeHashedData);
- }
-
- /**
- * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee
- * @param p_toBeSignedData The data to be signed
- * @param p_privateKey The private key
- * @return The signature value
- */
- @Override
- public OctetstringValue fx_signWithEcdsaNistp256WithSha256(final OctetstringValue p_toBeSignedData, final OctetstringValue p_privateKey) {
- return _externalFunctionsPluginProvider.fx_signWithEcdsaNistp256WithSha256(p_toBeSignedData, p_privateKey);
- }
-
- /**
- * @desc Verify the signature of the specified data
- * @param p_toBeVerifiedData The data to be verified
- * @param p_signature The signature
- * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate)
- * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate)
- * @return true on success, false otherwise
- */
- @Override
- public BooleanValue fx_verifyWithEcdsaNistp256WithSha256(final OctetstringValue p_toBeVerifiedData, final OctetstringValue p_signature, final OctetstringValue p_ecdsaNistp256PublicKeyX, final OctetstringValue p_ecdsaNistp256PublicKeyY) {
- return _externalFunctionsPluginProvider.fx_verifyWithEcdsaNistp256WithSha256(p_toBeVerifiedData, p_signature, p_ecdsaNistp256PublicKeyX, p_ecdsaNistp256PublicKeyY);
- }
-
- /**
- * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm
- * @param p_privateKey The new private key value
- * @param p_publicKeyX The new public key value (x coordinate)
- * @param p_publicKeyX The new public key value (y coordinate)
- * @return true on success, false otherwise
- */
- @Override
- public BooleanValue fx_generateKeyPair(OctetstringValue p_privateKey, OctetstringValue p_publicKeyX, OctetstringValue p_publicKeyY) {
- return _externalFunctionsPluginProvider.fx_generateKeyPair(p_privateKey, p_publicKeyX, p_publicKeyY);
- }
-
- /**
- * @desc Check that given polygon doesn't have neither self-intersections nor holes.
- * @param p_region Polygonal Region
- * @return true on success, false otherwise
- */
- @Override
- public BooleanValue fx_isValidPolygonalRegion(RecordOfValue p_region) {
- return _externalFunctionsPluginProvider.fx_isValidPolygonalRegion(p_region);
- }
-
- @Override
- public BooleanValue fx_isPolygonalRegionInside(RecordOfValue p_parent, RecordOfValue p_region) {
- return _externalFunctionsPluginProvider.fx_isPolygonalRegionInside(p_parent, p_region);
- }
-
- @Override
- public BooleanValue fx_isLocationInsideCircularRegion(RecordValue p_region, RecordValue p_location) {
- return _externalFunctionsPluginProvider.fx_isLocationInsideCircularRegion(p_region, p_location);
- }
-
- @Override
- public BooleanValue fx_isLocationInsideRectangularRegion(RecordOfValue p_region, RecordValue p_location) {
- return _externalFunctionsPluginProvider.fx_isLocationInsideRectangularRegion(p_region, p_location);
- }
-
- @Override
- public BooleanValue fx_isLocationInsidePolygonalRegion(final RecordOfValue p_region, final RecordValue p_location) {
- return _externalFunctionsPluginProvider.fx_isLocationInsidePolygonalRegion(p_region, p_location);
- }
-
- @Override
- public BooleanValue fx_isLocationInsideIdentifiedRegion(RecordValue p_region, RecordValue p_location) {
- return _externalFunctionsPluginProvider.fx_isLocationInsideIdentifiedRegion(p_region, p_location);
- }
-
- @Override
- public FloatValue fx_dms2dd(IntegerValue p_degrees, IntegerValue p_minutes, FloatValue p_seconds, OctetstringValue p_latlon) {
- return _externalFunctionsPluginProvider.fx_dms2dd(p_degrees, p_minutes, p_seconds, p_latlon);
- }
-
- @Override
- public BooleanValue fx_loadCertificates(CharstringValue p_rootDirectory, CharstringValue p_configId) {
- return _externalFunctionsPluginProvider.fx_loadCertificates(p_rootDirectory, p_configId);
- }
-
- @Override
- public BooleanValue fx_unloadCertificates() {
- return _externalFunctionsPluginProvider.fx_unloadCertificates();
- }
-
- @Override
- public BooleanValue fx_readCertificate(CharstringValue p_certificateName, OctetstringValue p_certificate) {
- return _externalFunctionsPluginProvider.fx_readCertificate(p_certificateName, p_certificate);
- }
-
- @Override
- public BooleanValue fx_readCertificateDigest(CharstringValue p_certificateName, OctetstringValue p_digest) {
- return _externalFunctionsPluginProvider.fx_readCertificateDigest(p_certificateName, p_digest);
- }
-
- @Override
- public BooleanValue fx_readSigningKey(CharstringValue p_certificateName, OctetstringValue p_privateKey) {
- return _externalFunctionsPluginProvider.fx_readSigningKey(p_certificateName, p_privateKey);
- }
-
- @Override
- public BooleanValue fx_readEncryptingKey(CharstringValue p_certificateName, OctetstringValue p_privateKey) {
- return _externalFunctionsPluginProvider.fx_readEncryptingKey(p_certificateName, p_privateKey);
- }
-
-}
/AdapterFramework/javasrc/tool/org/etsi/tool/spirent/xf/ExternalFunctionsPluginProvider.java
Property changes:
Deleted: svn:keywords
## -1 +0,0 ##
-URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/PluginAdapter.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/PluginAdapter.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/PluginAdapter.java (nonexistent)
@@ -1,209 +0,0 @@
-package org.etsi.tool.spirent.adapter;
-
-import org.etsi.ttcn.adapter.core.TERFactory;
-import org.etsi.ttcn.tri.TriActionTemplate;
-import org.etsi.ttcn.tri.TriAddress;
-import org.etsi.ttcn.tri.TriAddressList;
-import org.etsi.ttcn.tri.TriComponentId;
-import org.etsi.ttcn.tri.TriException;
-import org.etsi.ttcn.tri.TriMessage;
-import org.etsi.ttcn.tri.TriParameter;
-import org.etsi.ttcn.tri.TriParameterList;
-import org.etsi.ttcn.tri.TriPortId;
-import org.etsi.ttcn.tri.TriPortIdList;
-import org.etsi.ttcn.tri.TriSignatureId;
-import org.etsi.ttcn.tri.TriStatus;
-import org.etsi.ttcn.tri.TriTestCaseId;
-
-import com.testingtech.ttcn.tri.ISAPlugin;
-import com.testingtech.ttcn.tri.PluginIdentifier;
-import com.testingtech.ttcn.tri.PluginIdentifierContainer;
-import com.testingtech.ttcn.tri.TriStatusImpl;
-import com.testingtech.ttcn.tri.extension.PortPluginProvider;
-
-import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
-
[email protected]("deprecation")
-public class PluginAdapter implements ISAPlugin, PortPluginProvider, PluginIdentifierContainer {
-
- /**
- *
- */
- private static final long serialVersionUID = 3032642487407372318L;
-
- /**
- * Instance of tool independent test adapter implementation
- */
- protected TestAdapter ta;
-
- /**
- * TTwb runtime reference
- */
- protected RB rb;
-
- /**
- * TTwb plugin identifier
- */
- protected PluginIdentifier pluginId = new PluginIdentifier("org.etsi.ttcn.tool.spirent.port");
-
- @Override
- public ISAPlugin getPortPlugin() {
- return this;
- }
-
- @Override
- public void setPluginIdentifier(PluginIdentifier pluginId) {
- this.pluginId = pluginId;
- }
-
- @Override
- public void setRB(RB rb) {
- this.rb = rb;
- TERFactory.setImpl(new TeRequiredImpl(this.rb));
- ta = new TestAdapter();
- }
-
- @Override
- public TriStatus setUp() {
- return new TriStatusImpl();
- }
-
- @Override
- public TriStatus tearDown() {
- return new TriStatusImpl();
- }
-
- @Override
- public TriStatus triCall(TriComponentId componentId, TriPortId tsiPortId,
- TriAddress sutAddress, TriSignatureId signatureId,
- TriParameterList parameterList) {
- return ta.triCall(componentId, tsiPortId, sutAddress, signatureId, parameterList);
- }
-
- @Override
- public TriStatus triCallBC(TriComponentId componentId, TriPortId tsiPortId,
- TriSignatureId signatureId, TriParameterList parameterList) {
- return ta.triCallBC(componentId, tsiPortId, signatureId, parameterList);
- }
-
- @Override
- public TriStatus triCallMC(TriComponentId componentId, TriPortId tsiPortId,
- TriAddressList sutAddresses, TriSignatureId signatureId,
- TriParameterList parameterList) {
- return ta.triCallMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList);
- }
-
- @Override
- public TriStatus triEndTestCase() {
- return ta.triEndTestCase();
- }
-
- @Override
- public TriStatus triExecuteTestcase(TriTestCaseId testCaseId,
- TriPortIdList tsiPorts) {
- return ta.triExecuteTestcase(testCaseId, tsiPorts);
- }
-
- @Override
- public TriStatus triMap(TriPortId compPortId, TriPortId tsiPortId) {
- return ta.triMap(compPortId, tsiPortId);
- }
-
- @Override
- public TriStatus triMapParam(TriPortId compPortId, TriPortId tsiPortId,
- TriParameterList paramList) {
- return ta.triMapParam(compPortId, tsiPortId, paramList);
- }
-
- @Override
- public TriStatus triRaise(TriComponentId componentId, TriPortId tsiPortId,
- TriAddress sutAddress, TriSignatureId signatureId,
- TriException exception) {
- return ta.triRaise(componentId, tsiPortId, sutAddress, signatureId, exception);
- }
-
- @Override
- public TriStatus triRaiseBC(TriComponentId componentId,
- TriPortId tsitPortId, TriSignatureId signatureId, TriException exc) {
- return ta.triRaiseBC(componentId, tsitPortId, signatureId, exc);
- }
-
- @Override
- public TriStatus triRaiseMC(TriComponentId componentId,
- TriPortId tsitPortId, TriAddressList sutAddresses,
- TriSignatureId signatureId, TriException exc) {
- return ta.triRaiseMC(componentId, tsitPortId, sutAddresses, signatureId, exc);
- }
-
- @Override
- public TriStatus triReply(TriComponentId componentId, TriPortId tsiPortId,
- TriAddress sutAddress, TriSignatureId signatureId,
- TriParameterList parameterList, TriParameter returnValue) {
- return ta.triReply(componentId, tsiPortId, sutAddress, signatureId, parameterList, returnValue);
- }
-
- @Override
- public TriStatus triReplyBC(TriComponentId componentId,
- TriPortId tsiPortId, TriSignatureId signatureId,
- TriParameterList parameterList, TriParameter returnValue) {
- return ta.triReplyBC(componentId, tsiPortId, signatureId, parameterList, returnValue);
- }
-
- @Override
- public TriStatus triReplyMC(TriComponentId componentId,
- TriPortId tsiPortId, TriAddressList sutAddresses,
- TriSignatureId signatureId, TriParameterList parameterList,
- TriParameter returnValue) {
- return ta.triReplyMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList, returnValue);
- }
-
- @Override
- public TriStatus triSAReset() {
- return ta.triSAReset();
- }
-
- @Override
- public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId,
- TriAddress address, TriMessage sendMessage) {
- return ta.triSend(componentId, tsiPortId, address, sendMessage);
- }
-
- @Override
- public TriStatus triSendBC(TriComponentId componentId, TriPortId tsiPortId,
- TriMessage sendMessage) {
- return ta.triSendBC(componentId, tsiPortId, sendMessage);
- }
-
- @Override
- public TriStatus triSendMC(TriComponentId componentId, TriPortId tsiPortId,
- TriAddressList addresses, TriMessage sendMessage) {
- return ta.triSendMC(componentId, tsiPortId, addresses, sendMessage);
- }
-
- @Override
- public TriStatus triSutActionInformal(String description) {
- return ta.triSutActionInformal(description);
- }
-
- @Override
- public TriStatus triSutActionTemplate(TriActionTemplate templateValue) {
- return ta.triSutActionTemplate(templateValue);
- }
-
- @Override
- public TriStatus triUnmap(TriPortId compPortId, TriPortId tsiPortId) {
- return ta.triUnmap(compPortId, tsiPortId);
- }
-
- @Override
- public TriStatus triUnmapParam(TriPortId compPortId, TriPortId tsiPortId,
- TriParameterList paramList) {
- return ta.triUnmapParam(compPortId, tsiPortId, paramList);
- }
-
- @Override
- public TriStatus reInit() {
- return tearDown();
- }
-
-}
/AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/PluginAdapter.java
Property changes:
Deleted: svn:keywords
## -1 +0,0 ##
-URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/TestAdapter.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/TestAdapter.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/TestAdapter.java (nonexistent)
@@ -1,28 +0,0 @@
-package org.etsi.tool.spirent.adapter;
-
-import org.etsi.ttcn.tri.TriActionTemplate;
-import org.etsi.ttcn.tri.TriPortIdList;
-import org.etsi.ttcn.tri.TriStatus;
-import org.etsi.ttcn.tri.TriTestCaseId;
-
-
[email protected]({ "deprecation", "serial" })
-public class TestAdapter extends org.etsi.ttcn.adapter.core.TestAdapter {
-
- /* (non-Javadoc)
- * @see org.etsi.ttcn.tri.TriCommunicationSA#triExecuteTestcase(org.etsi.ttcn.tri.TriTestCaseId, org.etsi.ttcn.tri.TriPortIdList)
- */
- @Override
- public TriStatus triExecuteTestcase(final TriTestCaseId tcId, final TriPortIdList portList) {
- return required.getTriStatus(TriStatus.TRI_OK);
- }
-
- /**
- * triSutActionTemplate not implemented
- * @see org.etsi.ttcn.tri.TriCommunicationSA#triSutActionTemplate(org.etsi.ttcn.tri.TriActionTemplate)
- */
- @Override
- public TriStatus triSutActionTemplate(TriActionTemplate templateValue) {
- return required.getTriStatus(TriStatus.TRI_ERROR, "triSutActionTemplate not implemented");
- }
-}
/AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/TestAdapter.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/TeRequiredImpl.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/TeRequiredImpl.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/TeRequiredImpl.java (nonexistent)
@@ -1,84 +0,0 @@
-package org.etsi.tool.spirent.adapter;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-
-import org.etsi.ttcn.adapter.core.ITERequired;
-import org.etsi.ttcn.tri.TriAddress;
-import org.etsi.ttcn.tri.TriCommunicationTE;
-import org.etsi.ttcn.tri.TriMessage;
-import org.etsi.ttcn.tri.TriStatus;
-
-import com.testingtech.ttcn.logging.RTLoggingConstants;
-import com.testingtech.ttcn.tri.TriAddressImpl;
-import com.testingtech.ttcn.tri.TriMessageImpl;
-import com.testingtech.ttcn.tri.TriStatusImpl;
-
-import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
-
-public class TeRequiredImpl implements ITERequired {
-
- private RB rb;
- private Properties properties = new Properties();
-
- public TeRequiredImpl(RB rb) {
- this.rb = rb;
- try {
- properties.load(new FileInputStream("./etc/ta.properties"));
- } catch (IOException e) {
- System.err.println("Unable to load TA properties");
- e.printStackTrace();
- }
- }
-
- @Override
- public TriCommunicationTE getCommunicationTE() {
- return rb.getTriCommunicationTE();
- }
-
- @Override
- public String getTaParameter(String param) {
- return properties.getProperty(param, "");
- }
-
- @Override
- public TriAddress getTriAddress(byte[] message) {
- return new TriAddressImpl(message);
- }
-
- @Override
- public TriMessage getTriMessage(byte[] message) {
- return new TriMessageImpl(message);
- }
-
- @Override
- public TriStatus getTriStatus(int statusCode) {
- return new TriStatusImpl(statusCode);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public TriStatus getTriStatus(int statusCode, String message) {
- switch(statusCode) {
- case TriStatus.TRI_OK:
- rb.getTciTLProvidedV321TT().tliRT("", System.nanoTime(), "", -1, null, RTLoggingConstants.RT_LOG_INFO, message);
- return new TriStatusImpl();
- default:
- return new TriStatusImpl(message);
- }
-
- }
-
- @Override
- public void logDebug(String debugMessage) {
- // TODO Auto-generated method stub
- System.err.println(debugMessage);
- }
-
- @Override
- public void logError(String errorMessage) {
- // TODO Auto-generated method stub
- System.err.println(errorMessage);
- }
-}
/AdapterFramework/javasrc/tool/org/etsi/tool/spirent/adapter/TeRequiredImpl.java
Property changes:
Deleted: svn:keywords
## -1 +0,0 ##
-URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsIicp_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsIicp_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsIicp_asn1.java (nonexistent)
@@ -1,30 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-
-public class LibItsIicp_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsIicp_asn1() {
- _encodingName = "CALMiitsscu";
- }
-
- protected Type getTypeForName(final String type) {
-
- String type_ = type;
- if (type.endsWith("msg_req")) {
- type_ = String.format("%s.%s", _encodingName, "IIC_Request");
- } else if (type.endsWith("msg_resp")) {
- type_ = String.format("%s.%s", _encodingName, "IIC_Response");
- } else if (type.endsWith("mcmdRq")) {
- type_ = String.format("%s.%s", _encodingName, "McmdRq");
- }
-
- Type asnOriginalType = super.getTypeForName(type_);
-
- return asnOriginalType;
- } // End of method getTypeForName
-
-} // End of class LibItsIicp_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsIicp_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsFsap_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsFsap_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsFsap_asn1.java (nonexistent)
@@ -1,12 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-public class LibItsFsap_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsFsap_asn1() {
- _encodingName = "CALMfsap";
- }
-
-} // End of class LibItsFsap_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsFsap_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/CodecMain.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/CodecMain.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/CodecMain.java (nonexistent)
@@ -1,18 +0,0 @@
-/**
- * @author STF 424_ITS_Test_Platform
- * @version $id$
- */
-package org.etsi.tool.elvior.codec;
-
-public class CodecMain {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Its_CodecProvider app = new Its_CodecProvider();
- app.run();
- System.exit(0);
- }
-
-} // End of class MainCodec
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCALMmsap_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCALMmsap_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCALMmsap_asn1.java (nonexistent)
@@ -1,38 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-
-public class LibItsCALMmsap_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsCALMmsap_asn1() {
- _encodingName = "CALMmsap";
- }
-
- protected Type getTypeForName(final String type) {
-
- String type_ = type;
- if (type.endsWith("mfRequestRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MF_Request_request");
- } else if (type.endsWith("mnRequestRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MN_Request_request");
- } else if (type.endsWith("miRequestRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Request_request");
- } else if (type.endsWith("mf_Command_request")) {
- type_ = String.format("%s.%s", _encodingName, "MF_Command_request");
- } else if (type.endsWith("mn_Command_request")) {
- type_ = String.format("%s.%s", _encodingName, "MN_Command_request");
- } else if (type.endsWith("mi_Command_request")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Command_request");
- } else if (type.endsWith("faSapPrimitivesUp")) {
- type_ = String.format("%s.%s", _encodingName, "FAsapPrimitivesUp");
- }
-
- Type asnOriginalType = super.getTypeForName(type_);
-
- return asnOriginalType;
- } // End of method getTypeForName
-
-} // End of class LibItsCALMmsap_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCALMmsap_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsSremSsem_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsSremSsem_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsSremSsem_asn1.java (nonexistent)
@@ -1,51 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class LibItsSremSsem_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsSremSsem_asn1() {
- _encodingName = "SREM_SSEM_ETSI";
- }
-
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- if (decodingHypothesis.getName().endsWith("SREM")) {
- Type type = getTypeForName("SREM_PDU_Descriptions.SREM");
- return super.decode(message, type);
- } else {
- Type type = getTypeForName("SSEM_PDU_Descriptions.SSEM");
- return super.decode(message, type);
- }
- }
-
- @Override
- public TriMessage encode(final Value template) {
-
- TriMessage result;
- String type = String.format("%s.%s", _encodingName, template.getType().getName());
- if (template.getType().getName().endsWith("SREM")) {
- _encodingName = "SREM_PDU_Descriptions";
- result = super.encode(template);
- } else {
- _encodingName = "SREM_PDU_Descriptions";
- result = super.encode(template);
- }
- _encodingName = "SREM_SSEM_ETSI";
-
- return result;
- }
-
-} // End of class LibItsSremSsem_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsSremSsem_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/TciCDWrapper.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/TciCDWrapper.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/TciCDWrapper.java (nonexistent)
@@ -1,176 +0,0 @@
-/**
- * @author STF 424_ITS_Test_Platform
- * @version $id$
- */
-package org.etsi.tool.elvior.codec;
-
-import java.math.BigInteger;
-import java.util.logging.Logger;
-
-import org.elvior.ttcn.tritci.IntegerValueEx;
-import org.elvior.ttcn.tritci.TciProvider;
-import org.etsi.ttcn.adapter.core.TERFactory;
-import org.etsi.ttcn.codec.core.ITciCDWrapper;
-import org.etsi.ttcn.tci.BooleanValue;
-import org.etsi.ttcn.tci.CharstringValue;
-import org.etsi.ttcn.tci.EnumeratedValue;
-import org.etsi.ttcn.tci.FloatValue;
-import org.etsi.ttcn.tci.IntegerValue;
-import org.etsi.ttcn.tci.OctetstringValue;
-import org.etsi.ttcn.tci.RecordOfValue;
-import org.etsi.ttcn.tci.RecordValue;
-import org.etsi.ttcn.tci.TciCDRequired;
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-
-/** This class implements the ITciCDWrapper interface
- *
- * Note that the TCI Codec Interface (TCI-CD) describes the operations a TTCN-3 Executable is required to implement and the operations a codec implementation for a certain encoding scheme shall provide to the TE
- *
- * See ETSI ES 201 873-6 V4.2.1 - Clause 7.3.2.1 TCI-CD required
- */
-public class TciCDWrapper implements ITciCDWrapper {
-
- private TciCDRequired _tciFactory = TciProvider.getInstance().getTciCDRequired();
-
- private Logger _logger;
-
- public TciCDWrapper() {
- _logger = Logger.getLogger("org.etsi.its");
- }
-
- @Override
- public IntegerValue setInteger(final Integer value) {
- IntegerValue iv = (IntegerValue)_tciFactory.getInteger().newInstance();
- iv.setInteger(value);
- return iv;
- }
-
- @Override
- public int getInteger(final IntegerValue iv) {
- return iv.getInteger();
- }
-
- @Override
- public IntegerValue setInteger(final BigInteger value) {
- IntegerValueEx bi = (IntegerValueEx) _tciFactory.getInteger().newInstance(); //_tciFactory.getTypeForName("org.elvior.ttcn.tritci.IntegerValueEx");
- if (bi != null) {
- bi.setInt64(value.longValue());
- return (IntegerValue)bi;
- } else {
- IntegerValue i = (IntegerValue) _tciFactory.getInteger().newInstance();
- i.setInteger(value.intValue());
- return i;
- }
- }
-
- @Override
- public void setInteger(BigInteger value, IntegerValue setInt) {
- ((IntegerValueEx)setInt).setInt64(value.longValue());
- }
-
- @Override
- public long getBigInteger(final IntegerValue iv) {
- return ((IntegerValueEx)iv).getInt64();
- }
-
- @Override
- public OctetstringValue getOctetstring() {
- return (OctetstringValue)_tciFactory.getOctetstring().newInstance();
- }
-
- /** Constructs and returns a basic TTCN-3 string type
- *
- * @return An instance of Type representing a TTCN-3 string type
- */
- @Override
- public CharstringValue getCharstringValue() {
- return (CharstringValue)_tciFactory.getCharstring().newInstance();
- }
-
- @Override
- public FloatValue getFloat() {
- return (FloatValue)_tciFactory.getFloat().newInstance();
- }
-
- @Override
- public Value getUnionValue(final Type decodingHypothesis, final String variantName) {
-
- String variantTypeName = decodingHypothesis.getDefiningModule().getModuleName() + "." + decodingHypothesis.getName() + "." + variantName;
- Type variantType = getTypeForName(variantTypeName);
- if(variantType != null) {
- Value testVal = variantType.newInstance();
- if(testVal != null) {
- return testVal;
- }
- }
-
- return null;
- }
-
- @Override
- public Type getTypeForName(final String type) {
- Type originalType;
- if (type.indexOf("DecodedBtpPayload") != -1) {
- if (type.endsWith("camPacket")) {
- originalType = _tciFactory.getTypeForName("CAM_PDU_Descriptions.CAM");
- } else if (type.endsWith("denmPacket")) {
- originalType = _tciFactory.getTypeForName("DENM_PDU_Descriptions.DENM");
- } else if (type.endsWith("mapemPacket")) {
- originalType = _tciFactory.getTypeForName("MAPEM_PDU_Descriptions.MAPEM");
- } else if (type.endsWith("spatemPacket")) {
- originalType = _tciFactory.getTypeForName("MAPEM_PDU_Descriptions.SPATEM");
- } else if (type.endsWith("ivimPacket")) {
- originalType = _tciFactory.getTypeForName("IVIM_PDU_Descriptions.IVIM");
- } else if (type.endsWith("evcsnPacket")) {
- originalType = _tciFactory.getTypeForName("EVCSN_PDU_Descriptions.EvcsnPdu");
- } else if (type.endsWith("sremPacket")) {
- originalType = _tciFactory.getTypeForName("SREM_PDU_Descriptions.SREM");
- } else if (type.endsWith("ssemPacket")) {
- originalType = _tciFactory.getTypeForName("SSEM_PDU_Descriptions.SSEM");
- } else {
- originalType = _tciFactory.getTypeForName(type);
- }
- } else {
- originalType = _tciFactory.getTypeForName(type);
- }
-
- return originalType;
- } // End of method getTypeForName
-
- @Override
- public BooleanValue getBoolean() {
- return (BooleanValue)_tciFactory.getBoolean().newInstance();
- }
-
- @Override
- public EnumeratedValue getEnumValue(String typeName) {
- return (EnumeratedValue)_tciFactory.getTypeForName(typeName).newInstance();
- }
-
- @Override
- public RecordValue getRecordValue(final String typeName) {
- return (RecordValue)_tciFactory.getTypeForName(typeName).newInstance();
- }
-
- @Override
- public RecordOfValue getRecordOfValue(final String typeName) {
- return (RecordOfValue)_tciFactory.getTypeForName(typeName).newInstance();
- }
-
- @Override
- public void setInteger(IntegerValue intValue, final Integer value) {
- intValue.setInteger(value);
- }
-
-// @Override
-// public void logDebug(String debugMessage) {
-// _logger.info(debugMessage);
-// }
-//
-// @Override
-// public void logError(String errorMessage) {
-// _logger.severe(errorMessage);
-// }
-//
-} // End of class TciCDWrapper
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCam_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCam_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCam_asn1.java (nonexistent)
@@ -1,33 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class LibItsCam_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsCam_asn1() {
- _encodingName = "CAM_PDU_Descriptions";
- }
-
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- if (decodingHypothesis.getName().endsWith("camPacket")) {
- Type type = getTypeForName("CAM_PDU_Descriptions.CAM");
- return super.decode(message, type);
- }
-
- return super.decode(message, decodingHypothesis);
- }
-
-} // End of class LibItsCam_asn1
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/GetValueStructure.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/GetValueStructure.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/GetValueStructure.java (nonexistent)
@@ -1,120 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.elvior.ttcn.tritci.IntegerValueEx;
-import org.etsi.ttcn.tci.BitstringValue;
-import org.etsi.ttcn.tci.BooleanValue;
-import org.etsi.ttcn.tci.CharstringValue;
-import org.etsi.ttcn.tci.EnumeratedValue;
-import org.etsi.ttcn.tci.FloatValue;
-import org.etsi.ttcn.tci.HexstringValue;
-import org.etsi.ttcn.tci.OctetstringValue;
-import org.etsi.ttcn.tci.RecordOfValue;
-import org.etsi.ttcn.tci.RecordValue;
-import org.etsi.ttcn.tci.TciTypeClass;
-import org.etsi.ttcn.tci.UnionValue;
-import org.etsi.ttcn.tci.Value;
-
-public class GetValueStructure {
-
- static String indent = null;
- static StringBuilder buffer = null;
-
- static public void displayValueStructure(final Value value) {
- buffer = new StringBuilder();
- indent = "";
- LogValueDataStructure(value);
- }
-
- static public String getValueStructure(final Value value) {
- buffer = new StringBuilder();
- indent = "";
- LogValueDataStructure(value);
- return buffer.toString();
- }
-
- static private void LogValueDataStructure(final Value value) {
- if (value.notPresent()) {
- buffer.append(indent + value.getClass().getName() + " : omitted" + "\n");
- return;
- }
- switch (value.getType().getTypeClass()) {
- case TciTypeClass.BOOLEAN: {
- BooleanValue bv = (BooleanValue)value;
- buffer.append(indent + bv.getClass().getName() + " : " + new java.lang.Boolean(bv.getBoolean()) + " - encode : " + bv.getValueEncoding() + " - variant : " + bv.getValueEncodingVariant() + "\n");
- }
- break;
- case TciTypeClass.INTEGER: {
- IntegerValueEx iv = (IntegerValueEx)value;
- buffer.append(indent + iv.getClass().getName() + " : " + iv.getInt64() + " - encode : " + iv.getValueEncoding() + " - variant : " + iv.getValueEncodingVariant() + "\n");
- }
- break;
- case TciTypeClass.FLOAT: {
- FloatValue fv = (FloatValue)value;
- buffer.append(indent + fv.getClass().getName() + " : " + fv.getFloat() + " - encode : " + fv.getValueEncoding() + " - variant : " + fv.getValueEncodingVariant() + "\n");
- }
- break;
- case TciTypeClass.CHARSTRING: {
- CharstringValue csv = (CharstringValue)value;
- buffer.append(indent + csv.getClass().getName() + " : " + csv.getString() + " - encode : " + csv.getValueEncoding() + " - variant : " + csv.getValueEncodingVariant() + "\n");
- }
- break;
- case TciTypeClass.BITSTRING: {
- BitstringValue bv = (BitstringValue)value;
- buffer.append(indent + bv.getClass().getName() + " : " + bv.getString() + " - encode : " + bv.getValueEncoding() + " - variant : " + bv.getValueEncodingVariant() + "\n");
- }
- break;
- case TciTypeClass.OCTETSTRING: {
- OctetstringValue ov = (OctetstringValue)value;
- buffer.append(indent + ov.getClass().getName() + " : " + ov.getString() + " - encode : " + ov.getValueEncoding() + " - variant : " + ov.getValueEncodingVariant() + "\n");
- }
- break;
- case TciTypeClass.HEXSTRING: {
- HexstringValue hv = (HexstringValue)value;
- buffer.append(indent + hv.getClass().getName() + " : " + hv.getString() + " - encode : " + hv.getValueEncoding() + " - variant : " + hv.getValueEncodingVariant() + "\n");
- }
- break;
- case TciTypeClass.ENUMERATED: {
- EnumeratedValue ev = (EnumeratedValue)value;
- buffer.append(indent + ev.getClass().getName() + " : " + ev.getEnum() + " - encode : " + ev.getValueEncoding() + " - variant : " + ev.getValueEncodingVariant() + "\n");
- }
- break;
- case TciTypeClass.SET:
- // No break;
- case TciTypeClass.RECORD: {
- RecordValue rv = (RecordValue)value;
- buffer.append(indent + rv.getClass().getName() + " - encode : " + rv.getValueEncoding() + " - variant : " + rv.getValueEncodingVariant() + "\n");
- indent += "\t";
- for (String key : rv.getFieldNames()) {
- LogValueDataStructure(rv.getField(key));
- } // End of 'for'statement
- indent = indent.substring(0, indent.length() -1);
- }
- break;
- case TciTypeClass.ANYTYPE:
- // No break;
- case TciTypeClass.UNION: {
- UnionValue uv = (UnionValue)value;
- buffer.append(indent + uv.getClass().getName() + " - encode : " + uv.getValueEncoding() + " - variant : " + uv.getValueEncodingVariant() + "\n");
- indent += "\t";
- LogValueDataStructure(uv.getVariant(uv.getPresentVariantName()));
- indent = indent.substring(0, indent.length() -1);
- }
- break;
- case TciTypeClass.RECORD_OF:
- // No break;
- case TciTypeClass.SET_OF: {
- RecordOfValue rofv = (RecordOfValue)value;
- buffer.append(indent + rofv.getClass().getName() + " - encode : " + rofv.getValueEncoding() + " : " + rofv.getLength() + " - variant : " + rofv.getValueEncodingVariant() + "\n");
- indent += "\t";
- for (int key = 0; key < rofv.getLength(); key++) {
- LogValueDataStructure(rofv.getField(key));
- } // End of 'for'statement
- indent = indent.substring(0, indent.length() -1);
- }
- break;
- default:
- throw new RuntimeException("Unimplemented class type: " + value.getType().getTypeClass());
- } // End of 'switch' value
- }
-
-}
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/GetValueStructure.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsIvim_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsIvim_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsIvim_asn1.java (nonexistent)
@@ -1,33 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class LibItsIvim_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsIvim_asn1() {
- _encodingName = "IVIM_PDU_Descriptions";
- }
-
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- if (decodingHypothesis.getName().endsWith("ivimPacket")) {
- Type type = getTypeForName("IVIM_PDU_Descriptions.IVIM");
- return super.decode(message, type);
- }
-
- return super.decode(message, decodingHypothesis);
- }
-
-} // End of class LibItsIvim_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsIvim_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsFntp_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsFntp_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsFntp_asn1.java (nonexistent)
@@ -1,30 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-
-public class LibItsFntp_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsFntp_asn1() {
- _encodingName = "CALMfntp";
- }
-
- protected Type getTypeForName(final String type) {
-
- String type_ = type;
- if (type.endsWith("nfSapPrimitivesUp")) {
- type_ = String.format("%s.%s", _encodingName, "NFsapPrimitivesUp");
- } else if (type.endsWith("mnRequestRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MN_Request_request");
- } else if (type.endsWith("msgIn_nf")) {
- type_ = String.format("%s.%s", _encodingName, "NFsapPrimitivesDown");
- }
-
- Type asnOriginalType = super.getTypeForName(type_);
-
- return asnOriginalType;
- } // End of method getTypeForName
-
-} // End of class LibItsFntp_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsFntp_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCALMllsap_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCALMllsap_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCALMllsap_asn1.java (nonexistent)
@@ -1,28 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-
-public class LibItsCALMllsap_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsCALMllsap_asn1() {
- _encodingName = "CALMllsap";
- }
-
- protected Type getTypeForName(final String type) {
-
- String type_ = type;
- if (type.endsWith("mnRequestRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MN_Request_request");
- } else if (type.endsWith("msgIn_in")) {
- type_ = String.format("%s.%s", _encodingName, "INsapPrimitivesDown");
- }
-
- Type asnOriginalType = super.getTypeForName(type_);
-
- return asnOriginalType;
- } // End of method getTypeForName
-
-} // End of class LibItsCALMllsap_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsCALMllsap_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsMapemSpatem_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsMapemSpatem_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsMapemSpatem_asn1.java (nonexistent)
@@ -1,57 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class LibItsMapemSpatem_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsMapemSpatem_asn1() {
- _encodingName = "MAPEM_SPATEM_ETSI";
- }
-
- @Override
- public TriMessage encode(final Value template) {
-
- TriMessage result;
- String type = String.format("%s.%s", _encodingName, template.getType().getName());
- if (template.getType().getName().endsWith("MAPEM")) {
- _encodingName = "MAPEM_PDU_Descriptions";
- result = super.encode(template);
- } else {
- _encodingName = "SPATEM_PDU_Descriptions";
- result = super.encode(template);
- }
- _encodingName = "MAPEM_SPATEM_ETSI";
-
- return result;
- }
-
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- Value result;
- if (decodingHypothesis.getName().endsWith("MAPEM")) {
- Type type = getTypeForName("MAPEM_PDU_Descriptions.MAPEM");
- _encodingName = "MAPEM_PDU_Descriptions";
- result = super.decode(message, type);
- } else {
- Type type = getTypeForName("SPATEM_PDU_Descriptions.SPATEM");
- _encodingName = "SPATEM_PDU_Descriptions";
- result = super.decode(message, type);
- }
- _encodingName = "MAPEM_SPATEM_ETSI";
-
- return result;
- }
-
-} // End of class LibItsMapemSpatem_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsMapemSpatem_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/BuiltInCodec.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/BuiltInCodec.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/BuiltInCodec.java (nonexistent)
@@ -1,154 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.elvior.ttcn.tritci.TciProvider;
-import org.elvior.ttcn.tritci.TriMessageEx;
-import org.elvior.ttcn.tritci.TriProvider;
-import org.etsi.common.ByteHelper;
-import org.etsi.ttcn.tci.RecordValue;
-import org.etsi.ttcn.tci.TciCDProvided;
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class BuiltInCodec implements TciCDProvided {
-
- /**
- * Logger instance
- */
- protected final static Logger _logger = Logger.getLogger("org.etsi.its");
-
- private String _encodingName;
-
- /**
- * Constructor
- */
- public BuiltInCodec(final String encodingName) {
-
- if (encodingName.equals("LibItsDenm_asn1")) {
- _encodingName = "DENM_PDU_Descriptions";
- } else if (encodingName.equals("LibItsCam_asn1")) {
- _encodingName = "CAM_PDU_Descriptions";
- } else if (encodingName.equals("LibItsMapemSpatem_asn1")) {
- _encodingName = "MAPEM_SPATEM_ETSI";
- } else if (encodingName.equals("LibItsIvim_asn1")) {
- _encodingName = "IVIM_PDU_Descriptions";
- } else if (encodingName.equals("LibItsEvcsn_asn1")) {
- _encodingName = "EVCSN_PDU_Descriptions";
- } else if (encodingName.equals("LibItsSremSsem_asn1")) {
- _encodingName = "SREM_SSEM_ETSI";
- } else if (encodingName.equals("LibItsCALMmsap_asn1")) {
- _encodingName = "CALMmsap";
- } else if (encodingName.equals("LibItsCALMllsap_asn1")) {
- _encodingName = "CALMllsap";
- } else if (encodingName.equals("LibItsFntp_asn1")) {
- _encodingName = "CALMfntp";
- } else if (encodingName.equals("LibItsFsap_asn1")) {
- _encodingName = "CALMfsap";
- } else if (encodingName.equals("LibItsIicp_asn1")) {
- _encodingName = "CALMiitsscu";
- } else {
- _encodingName = "";
- }
- }
-
- /**
- * This operation decodes message according to the encoding rules and returns a TTCN-3 value.
- * The decodingHypothesis shall be used to determine whether the encoded value can be decoded.
- * If an encoding rule is not self-sufficient, i.e. if the encoded message does not inherently
- * contain its type decodingHypothesis shall be used. If the encoded value can be decoded without
- * the decoding hypothesis, the distinct null value shall be returned if the type determined from
- * the encoded message is not compatible with the decoding hypothesis
- *
- * @param message The encoded message to be decoded
- * @param decodingHypothesis The hypothesis the decoding can be based on
- * @return Returns the decoded value, if the value is of a compatible type as the decodingHypothesis, else the distinct value null
- *
- * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.2.1 decode
- */
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- TriMessageEx msg = TriProvider.getInstance().getTriFactory().createMessageEx();
- msg.setEncodedMessage(message.getEncodedMessage());
-
- String type = String.format("%s.%s", _encodingName, decodingHypothesis.getName());
- Type asnOriginalType = getTypeForName(type);
- // Check which type class the decoding hypothesis is of
- Value value = TciProvider.getInstance().getSystemInterface().internalDecode(msg, asnOriginalType);
-
- return value;
- }
-
- @Override
- public TriMessage encode(final Value template) {
-
- RecordValue asn1Value = (RecordValue)template;
- String type = String.format("%s.%s", _encodingName, template.getType().getName());
- Type asnOriginalType = getTypeForName(type);
- if (asnOriginalType != null) {
- RecordValue internalASNEncodecValue = (RecordValue)asnOriginalType.newInstance();
- String[] fields = internalASNEncodecValue.getFieldNames();
- for(String field: fields) {
- Value fieldValue = asn1Value.getField(field);
- if(fieldValue.notPresent()) {
- internalASNEncodecValue.setFieldOmitted(field);
- } else {
- internalASNEncodecValue.setField(field, fieldValue);
- }
- } // End of 'for' statement
- TriMessage msg = TciProvider.getInstance().getSystemInterface().internalEncode(internalASNEncodecValue);
- ByteHelper.dump("BuiltInCodec.encode: ", msg.getEncodedMessage());
- return msg;
- }
-
- return null;
- }
-
- private Type getTypeForName(final String type) {
-
- Type asnOriginalType = TciProvider.getInstance().getTciCDRequired().getTypeForName(type);
- if (asnOriginalType == null) { // Failed with default mechanism, try with External Attributes mechanism
-// type = decodingHypothesis.getName(); //FIXME External Attributes mechanism does not work
- String type_ = "";
- if (type.endsWith("nfSapPrimitivesUp")) {
- type_ = String.format("%s.%s", _encodingName, "NFsapPrimitivesUp");
- } else if (type.endsWith("faSapPrimitivesUp")) {
- type_ = String.format("%s.%s", _encodingName, "FAsapPrimitivesUp");
- } else if (type.endsWith("mnRequestRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MN_Request_request");
- } else if (type.endsWith("mfCommandRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MF_Command_request");
- } else if (type.endsWith("miCommandRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Command_request");
- } else if (type.endsWith("miCommandConfirm")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Command_confirm");
- } else if (type.endsWith("miRequestRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Request_request");
- } else if (type.endsWith("miRequestConfirm")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Request_confirm");
- } else if (type.endsWith("miSetRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Set_request");
- } else if (type.endsWith("miSetConfirm")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Set_confirm");
- } else if (type.endsWith("miGetRequest")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Get_request");
- } else if (type.endsWith("miGetConfirm")) {
- type_ = String.format("%s.%s", _encodingName, "MI_Get_confirm");
- } if (type.endsWith("fntpNPDU")) {
- type_ = String.format("%s.%s", _encodingName, "INsapPrimitivesUp");
- }
- asnOriginalType = TciProvider.getInstance().getTciCDRequired().getTypeForName(type_);
- }
-
- return asnOriginalType;
- } // End of method getTypeForName
-
-} // End of class BuiltInCodec
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/BuiltInCodec.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsEvcsn_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsEvcsn_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsEvcsn_asn1.java (nonexistent)
@@ -1,33 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class LibItsEvcsn_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsEvcsn_asn1() {
- _encodingName = "EVCSN_PDU_Descriptions";
- }
-
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- if (decodingHypothesis.getName().endsWith("evcsnPacket")) {
- Type type = getTypeForName("EVCSN_PDU_Descriptions.EvcsnPdu");
- return super.decode(message, type);
- }
-
- return super.decode(message, decodingHypothesis);
- }
-
-} // End of class LibItsEvcsn_asn1
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsEvcsn_asn1.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/Its_CodecProvider.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/Its_CodecProvider.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/Its_CodecProvider.java (nonexistent)
@@ -1,180 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import org.elvior.ttcn.tritci.ChannelEventHandler;
-import org.elvior.ttcn.tritci.TciProvider;
-import org.elvior.ttcn.tritci.TriTciChannel;
-import org.etsi.ttcn.codec.core.ITCIRequired;
-import org.etsi.ttcn.codec.core.ITciCDWrapper;
-import org.etsi.ttcn.codec.core.MainCodec;
-import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
-import org.etsi.ttcn.codec.core.CodecFactory;
-import org.etsi.ttcn.tci.TciCDProvided;
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, ITCIRequired {
-
- private static Properties _properties = new Properties();
-
- private ITciCDWrapper _cdReq;
-
- private CodecFactory _cf;
-
- public Its_CodecProvider() {
-
- // Load Codec settings
- _cdReq = null;
- _cf = null;
- try {
- _properties.load(CodecMain.class.getResourceAsStream("./codec.properties"));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- // Register this object as the instance implementing the TCI-CD Provided interface
- TciProvider.getInstance().setTciCDProvided(this);
- TriTciChannel channel = TriTciChannel.getInstance();
- // Set application name that will be displayed in the TestCast log
- channel.setApplicationName("ItsCodec");
- // Register this object as the receiver of events generated by TestCast framework
- channel.setEventHandler(this);
-
- initializeCodecs();
- }
-
- private void initializeCodecs() {
- TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper());
- _cdReq = TciCDWrapperFactory.getTciCDInstance();
-
- // Register External codecs
- _cf = CodecFactory.getInstance();
- // TODO Reuse Build-in codec here
-
- String[] asn1Codecs = _properties.getProperty("ASN.1Codecs", "").split(",");
- for (String codec : asn1Codecs) {
- String[] paths = _properties.getProperty(codec, "").split(",");
- try {
- _cf.setExternalCodec(paths[0], (TciCDProvided) Class.forName(paths[1]).newInstance());
- } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
- e.printStackTrace();
- }
- } // End of 'for' loop
- try { // This comes with 'with encode () "UpperTester"' for all UtxxxTrigger/UtxxxUpdate messages
- _cf.setExternalCodec("per-basic-unaligned:1997", LibIts_asn1.class.newInstance());
- } catch (InstantiationException | IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- public void run() {
-
- // Attempt to connect to TestCast
- if (TriTciChannel.getInstance().open()) {
- try {
- synchronized(this) {
- wait();
- }
- } catch (InterruptedException e) {
- }
- }
-
- }
-
- @Override
- public void onConnectionClosed() {
- synchronized(this) {
- notify();
- }
- }
-
- @Override
- public void onConnectionEstablished() {
- }
-
- @Override
- public void onError(String error) {
- }
-
- @Override
- public Value decode(TriMessage message, Type decodingHypothesis) {
- String encodingName = decodingHypothesis.getTypeEncoding();
- if (encodingName != null) {
- encodingName = decodingHypothesis.getDefiningModule().getModuleName();
- } else { // Use basic codec
- encodingName = "";
- }
- TciCDProvided codec = getCodec(encodingName);
- if (codec == null) {
- return null;
- }
- Value value = codec.decode(message, decodingHypothesis);
- return value;
- }
-
- @Override
- public TriMessage encode(Value value) {
- String encodingName = value.getType().getTypeEncoding();
- if ((encodingName != null) && !encodingName.startsWith("Lib")) {
- encodingName = value.getType().getDefiningModule().getModuleName();
- } else if (encodingName == null) { // Use basic codec
- encodingName = "";
- }
- TciCDProvided codec = getCodec(encodingName);
- if (codec == null) {
- return null;
- }
- TriMessage res = codec.encode(value);
- return res;
- }
-
- /**
- * This method provides the codec associated to the specified encoding identifier
- *
- * @param rb TTwb Runtime reference
- * @param encodingName The name of the encoding, specified by the TTCN-3 key words 'with/encode'
- * @return The codec associated to the specified encoding identifier
- */
- @Override
- public TciCDProvided getCodec(final String encodingName) {
- // FIXME Remove argument here and in the interface ITCIRequired
- return new Codec();
- }
-
- private class Codec implements TciCDProvided {
-
- @Override
- public Value decode(TriMessage message, Type decodingHypothesis) {
-
- MainCodec codec = new MainCodec(_cdReq);
- Value v = null;
- try {
- v = codec.triDecode(message, decodingHypothesis);
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- return v;
- }
-
- @Override
- public TriMessage encode(Value value) {
-
- MainCodec codec = new MainCodec(_cdReq);
- TriMessage m = null;
- try {
- m = codec.triEncode(value);
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- return m;
- }
- }
-
-} // End of class Its_CodecProvider
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibIts_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibIts_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibIts_asn1.java (nonexistent)
@@ -1,160 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.elvior.ttcn.tritci.IntegerValueEx;
-import org.elvior.ttcn.tritci.TciProvider;
-import org.elvior.ttcn.tritci.TriMessageEx;
-import org.elvior.ttcn.tritci.TriProvider;
-import org.etsi.common.ByteHelper;
-import org.etsi.ttcn.tci.RecordValue;
-import org.etsi.ttcn.tci.TciCDProvided;
-import org.etsi.ttcn.tci.TciTypeClass;
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class LibIts_asn1 implements TciCDProvided {
-
- /**
- * Logger instance
- */
- protected final static Logger _logger = Logger.getLogger("org.etsi.its");
-
- protected String _encodingName;
-
- /**
- * Constructor
- */
- public LibIts_asn1() {
- _encodingName = "";
- }
-
- /**
- * This operation decodes message according to the encoding rules and returns a TTCN-3 value.
- * The decodingHypothesis shall be used to determine whether the encoded value can be decoded.
- * If an encoding rule is not self-sufficient, i.e. if the encoded message does not inherently
- * contain its type decodingHypothesis shall be used. If the encoded value can be decoded without
- * the decoding hypothesis, the distinct null value shall be returned if the type determined from
- * the encoded message is not compatible with the decoding hypothesis
- *
- * @param message The encoded message to be decoded
- * @param decodingHypothesis The hypothesis the decoding can be based on
- * @return Returns the decoded value, if the value is of a compatible type as the decodingHypothesis, else the distinct value null
- *
- * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.2.1 decode
- */
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- TriMessageEx msg = TriProvider.getInstance().getTriFactory().createMessageEx();
- msg.setEncodedMessage(message.getEncodedMessage());
- String type = "";
- System.out.println("decode: " + String.format("%s.%s: %02x", decodingHypothesis.getTypeEncoding(), decodingHypothesis.getName(), message.getEncodedMessage()[1]));
- if (decodingHypothesis.getTypeEncoding().equals("per-basic-unaligned:1997")) {
- switch (message.getEncodedMessage()[1]) { // messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11) } (0..255), -- Mantis #7209, #7005
- case (byte)0x01:
- if (decodingHypothesis.getName().equals("DENM")) {
- type = "DENM_PDU_Descriptions.DENM";
- }
- break;
- case (byte)0x02:
- if (decodingHypothesis.getName().equals("CAM")) {
- type = "CAM_PDU_Descriptions.CAM";
- }
- break;
- case (byte)0x05:
- if (decodingHypothesis.getName().equals("MAPEM")) {
- type = "MAPEM_PDU_Descriptions.MAPEM";
- }
- break;
- case (byte)0x04:
- if (decodingHypothesis.getName().equals("SPATEM")) {
- type = "SPATEM_PDU_Descriptions.SPATEM";
- }
- break;
- case (byte)0x06:
- if (decodingHypothesis.getName().equals("IVIM")) {
- type = "IVIM_PDU_Descriptions.IVIM";
- }
- break;
- case (byte)0x07:
- if (decodingHypothesis.getName().equals("EvcsnPdu")) {
- type = "EVCSN_PDU_Descriptions.EvcsnPdu";
- }
- break;
- case (byte)0x09:
- if (decodingHypothesis.getName().equals("SREM")) {
- type = "SREM_PDU_Descriptions.SREM";
- }
- break;
- case (byte)0x0a:
- if (decodingHypothesis.getName().equals("SSEM")) {
- type = "SSEM_PDU_Descriptions.SSEM";
- }
- break;
- default:
- // Nothing to do
- System.out.println("Default: " + String.format("%s.%s", decodingHypothesis.getTypeEncoding(), decodingHypothesis.getName()));
- } // End of 'switch' statement
- } else {
- type = String.format("%s.%s", _encodingName, decodingHypothesis.getName());
- }
- if (type.isEmpty()) {
- return null; // Abort decoding
- }
- Type asnOriginalType = getTypeForName(type);
- // Check which type class the decoding hypothesis is of
- Value value = TciProvider.getInstance().getSystemInterface().internalDecode(msg, asnOriginalType);
- return value;
- }
-
- @Override
- public TriMessage encode(final Value template) {
-
- String type = String.format("%s.%s", _encodingName, template.getType().getName());
- Type asnOriginalType = getTypeForName(type);
- if (asnOriginalType != null) {
- Value internalASNEncodecValue = null;
- switch (template.getType().getTypeClass()) {
- case TciTypeClass.RECORD:
- internalASNEncodecValue = (RecordValue)asnOriginalType.newInstance();
- String[] fields = ((RecordValue)internalASNEncodecValue).getFieldNames();
- RecordValue asn1Value = (RecordValue)template;
- for(String field: fields) {
- Value fieldValue = asn1Value.getField(field);
- if(fieldValue.notPresent()) {
- ((RecordValue)internalASNEncodecValue).setFieldOmitted(field);
- } else {
- ((RecordValue)internalASNEncodecValue).setField(field, fieldValue);
- }
- } // End of 'for' statement
- break;
- case TciTypeClass.INTEGER:
- internalASNEncodecValue = (IntegerValueEx)asnOriginalType.newInstance();
- ((IntegerValueEx)internalASNEncodecValue).setInt64(((IntegerValueEx)template).getInt64());
- break;
- default:
- throw new RuntimeException("Unimplemented type " + template.getType().getTypeClass());
- } // End of 'switch' statement
- TriMessage msg = TciProvider.getInstance().getSystemInterface().internalEncode(internalASNEncodecValue);
- return msg;
- }
-
- return null;
- }
-
- protected Type getTypeForName(final String type) {
-
- Type asnOriginalType = TciProvider.getInstance().getTciCDRequired().getTypeForName(type);
-
- return asnOriginalType;
- } // End of method getTypeForName
-
-} // End of class LibIts_asn1
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsContainer_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsContainer_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsContainer_asn1.java (nonexistent)
@@ -1,44 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.elvior.ttcn.tritci.TriProvider;
-import org.etsi.common.ByteHelper;
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class LibItsContainer_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsContainer_asn1() {
- _encodingName = "ITS_Container";
- }
-
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- Value value = null;
- if (decodingHypothesis.getName().equals("TimestampIts")) {
- int ival = ByteHelper.byteArrayToInt(message.getEncodedMessage());
- long lval = ((long)ival) << 6;
- TriMessage msg = TriProvider.getInstance().getTriFactory().createMessage();
- msg.setEncodedMessage(ByteHelper.longToByteArray(lval, 6));
- value = super.decode(msg, decodingHypothesis);
- } else if (decodingHypothesis.getName().equals("TimeMark")) {
- TriMessage msg1 = TriProvider.getInstance().getTriFactory().createMessage();
- msg1.setEncodedMessage(message.getEncodedMessage());
- value = super.decode(msg1, decodingHypothesis);
- } else {
- value = super.decode(message, decodingHypothesis);
- }
-
- return value;
- }
-
-} // End of class LibItsContainer_asn1
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsDenm_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsDenm_asn1.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/codec/LibItsDenm_asn1.java (nonexistent)
@@ -1,32 +0,0 @@
-package org.etsi.tool.elvior.codec;
-
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriMessage;
-
-/**
- *
- * Note that "Enable Internal Codec" field shall be set to true
- *
- */
-public class LibItsDenm_asn1 extends LibIts_asn1 {
-
- /**
- * Constructor
- */
- public LibItsDenm_asn1() {
- _encodingName = "DENM_PDU_Descriptions";
- }
-
- @Override
- public Value decode(final TriMessage message, final Type decodingHypothesis) {
-
- if (decodingHypothesis.getName().endsWith("denmPacket")) {
- Type type = getTypeForName("DENM_PDU_Descriptions.DENM");
- return super.decode(message, type);
- }
-
- return super.decode(message, decodingHypothesis);
- }
-
-} // End of class LibItsDenm_asn1
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TeRequiredImpl.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TeRequiredImpl.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TeRequiredImpl.java (nonexistent)
@@ -1,148 +0,0 @@
-/**
- * @author STF 424_ITS_Test_Platform
- * @version $id$
- */
-package org.etsi.tool.elvior.adapter;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-import java.util.logging.Logger;
-
-import org.elvior.ttcn.tritci.TriFactory;
-import org.elvior.ttcn.tritci.TriProvider;
-import org.etsi.ttcn.adapter.core.ITERequired;
-import org.etsi.ttcn.tci.CharstringValue;
-import org.etsi.ttcn.tci.Type;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriAddress;
-import org.etsi.ttcn.tri.TriCommunicationTE;
-import org.etsi.ttcn.tri.TriMessage;
-import org.etsi.ttcn.tri.TriStatus;
-
-public class TeRequiredImpl implements ITERequired {
-
- TriFactory _factory = TriProvider.getInstance().getTriFactory();
-
-// private TriTciChannel _tciFactory = TriTciChannel.getInstance();
-
- private final PluginAdapter _ta;
-
- private static Properties _properties = new Properties();
-
- protected final static Logger _logger = Logger.getLogger("org.etsi.its");
-
- public TeRequiredImpl(PluginAdapter ta) {
- _ta = ta;
- // Load TA settings
- try {
- _properties.load(new FileInputStream("./etc/ta.properties"));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public TriCommunicationTE getCommunicationTE() {
- return (TriCommunicationTE)_ta;
- }
-
- /**
- * @desc Retrieve TA settings from external file
- * It does not work with TestcatT3 because of TCI is only available during test case execution (from triExecuteTestCase method call till triEndTestCase method call)
- */
- @Override
- public Value getTaParameter(String param) {
- CharstringValue string = new CharstringValue() {
- private String _value = "";
- @Override
- public boolean notPresent() {
- return _value.isEmpty();
- }
-
- @Override
- public String getValueEncodingVariant() {
- return null;
- }
-
- @Override
- public String getValueEncoding() {
- return null;
- }
-
- @Override
- public Type getType() {
- return null;
- }
-
- @Override
- public void setString(String value) {
- _value = value;
- }
-
- @Override
- public void setLength(int length) {
- }
-
- @Override
- public void setChar(int index, char arg1) {
- }
-
- @Override
- public String getString() {
- return _value;
- }
-
- @Override
- public int getLength() {
- return _value.length();
- }
-
- @Override
- public char getChar(int index) {
- return _value.charAt(index);
- }
- };
- string.setString(_properties.getProperty(param, ""));
-
- return string;
- }
-
- @Override
- public TriAddress getTriAddress(byte[] message) {
- TriAddress address = _factory.createAddress();
- address.setEncodedAddress(message);
- return address;
- }
-
- @Override
- public TriMessage getTriMessage(byte[] message) {
- TriMessage msg = _factory.createMessage();
- msg.setEncodedMessage(message);
- msg.setNumberOfBits(message.length * Byte.SIZE);
- return msg;
- }
-
- @Override
- public TriStatus getTriStatus(int statusCode) {
- TriStatus status = _factory.createErrorStatus();
- status.setStatus(statusCode);
- return status;
- }
-
- @Override
- public TriStatus getTriStatus(int statusCode, String message) {
- return getTriStatus(statusCode);
- }
-
- @Override
- public void logDebug(String debugMessage) {
- _logger.info(debugMessage);
- }
-
- @Override
- public void logError(String errorMessage) {
- _logger.severe(errorMessage);
- }
-
-} // End of class TeRequiredImpl
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/PluginAdapter.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/PluginAdapter.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/PluginAdapter.java (nonexistent)
@@ -1,1272 +0,0 @@
-/**
- * @author STF 424_ITS_Test_Platform
- * @version $id$
- */
-package org.etsi.tool.elvior.adapter;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.util.Properties;
-
-import org.elvior.ttcn.tritci.ChannelEventHandler;
-import org.elvior.ttcn.tritci.IntegerValueEx;
-import org.elvior.ttcn.tritci.TciProvider;
-import org.elvior.ttcn.tritci.TriFactory;
-import org.elvior.ttcn.tritci.TriProvider;
-import org.elvior.ttcn.tritci.TriTciChannel;
-import org.etsi.ttcn.adapter.core.TERFactory;
-import org.etsi.ttcn.codec.core.ITciCDWrapper;
-import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
-import org.etsi.common.ByteHelper;
-import org.etsi.its.extfunc.IItsExternalFunctionsProvider;
-import org.etsi.its.extfunc.ItsExternalFunctionsProvider;
-import org.etsi.tool.elvior.codec.TciCDWrapper;
-import org.etsi.ttcn.tci.BooleanValue;
-import org.etsi.ttcn.tci.CharstringValue;
-import org.etsi.ttcn.tci.EnumeratedValue;
-import org.etsi.ttcn.tci.FloatValue;
-import org.etsi.ttcn.tci.IntegerValue;
-import org.etsi.ttcn.tci.OctetstringValue;
-import org.etsi.ttcn.tci.RecordOfValue;
-import org.etsi.ttcn.tci.RecordValue;
-import org.etsi.ttcn.tci.TciParameterList;
-import org.etsi.ttcn.tci.TciValueList;
-import org.etsi.ttcn.tci.Value;
-import org.etsi.ttcn.tri.TriAddress;
-import org.etsi.ttcn.tri.TriAddressList;
-import org.etsi.ttcn.tri.TriBoolean;
-import org.etsi.ttcn.tri.TriCommunicationSA;
-import org.etsi.ttcn.tri.TriCommunicationTE;
-import org.etsi.ttcn.tri.TriComponentId;
-import org.etsi.ttcn.tri.TriException;
-import org.etsi.ttcn.tri.TriFunctionId;
-import org.etsi.ttcn.tri.TriLong;
-import org.etsi.ttcn.tri.TriMessage;
-import org.etsi.ttcn.tri.TriParameter;
-import org.etsi.ttcn.tri.TriParameterList;
-import org.etsi.ttcn.tri.TriParameterPassingMode;
-import org.etsi.ttcn.tri.TriPlatformPA;
-import org.etsi.ttcn.tri.TriPortId;
-import org.etsi.ttcn.tri.TriPortIdList;
-import org.etsi.ttcn.tri.TriSignatureId;
-import org.etsi.ttcn.tri.TriStatus;
-import org.etsi.ttcn.tri.TriTestCaseId;
-import org.etsi.ttcn.tri.TriTimerDuration;
-import org.etsi.ttcn.tri.TriTimerId;
-import org.etsi.ttcn.xtri.xTriCommunicationSA;
-
-public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xTriCommunicationSA, TriPlatformPA, ChannelEventHandler {
- /**
- * This is the main PluginAdapter class
- */
- private TestAdapter _itsTestAdapter;
-
- private static Properties _properties = new Properties();
-
- private TriStatus m_triOK;
-
- private TriStatus m_triKO;
-
- private IItsExternalFunctionsProvider _extfuncsImpl;
-
- public PluginAdapter() {
-
- // Load TA settings
- try {
- _properties.load(TestAdapterMain.class.getResourceAsStream("./ta.properties"));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- // Register this object as the instance implementing the TRI-SA interface
- TriProvider.getInstance().setTriCommunicationSA(this);
- // Register this object as the instance implementing the TRI-PA interface
- TriProvider.getInstance().setTriPlatformPA(this);
- TriTciChannel channel = TriTciChannel.getInstance();
- // Set application name that will be displayed in the TestCast log
- channel.setApplicationName("ItsPlatform");
- // Register this object as the receiver of events generated by TestCast framework
- channel.setEventHandler(this);
- TriFactory factory = TriProvider.getInstance().getTriFactory();
- m_triOK = factory.createOkStatus();
- m_triKO = factory.createErrorStatus();
- TERFactory.setImpl(new TeRequiredImpl(this));
- // External functions
- TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper());
- _extfuncsImpl = new ItsExternalFunctionsProvider();
- }
-
- public void run() {
-
- // Attempt to connect to TestCast
- if (TriTciChannel.getInstance().open()) {
- _itsTestAdapter = new TestAdapter();
- try {
- synchronized(this) {
- wait();
- }
- } catch (InterruptedException e) {
- }
- }
- }
-
- public TriStatus triCall(TriComponentId componentId, TriPortId tsiPortId,
- TriAddress sutAddress, TriSignatureId signatureId,
- TriParameterList parameterList) {
- return _itsTestAdapter.triCall(componentId, tsiPortId, sutAddress, signatureId, parameterList);
- }
-
- public TriStatus triCallBC(TriComponentId componentId, TriPortId tsiPortId,
- TriSignatureId signatureId, TriParameterList parameterList) {
- return _itsTestAdapter.triCallBC(componentId, tsiPortId, signatureId, parameterList);
- }
-
- public TriStatus triCallMC(TriComponentId componentId, TriPortId tsiPortId,
- TriAddressList sutAddresses, TriSignatureId signatureId,
- TriParameterList parameterList) {
- return _itsTestAdapter.triCallMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList);
- }
-
- public TriStatus triEndTestCase() {
- return _itsTestAdapter.triEndTestCase();
- }
-
- public TriStatus triExecuteTestCase(TriTestCaseId testCaseId, TriPortIdList tsiPorts) {
- // Disable XTRI functionality for all ports, so that existing SA implementation can be reused
- for(int i = 0; i < tsiPorts.size(); i++) {
- TriTciChannel.getInstance().enableXTriForPort(tsiPorts.get(i), false);
- }
- return _itsTestAdapter.triExecuteTestcase(testCaseId, tsiPorts);
- }
-
- public TriStatus triMap(TriPortId compPortId, TriPortId tsiPortId) {
- return _itsTestAdapter.triMap(compPortId, tsiPortId);
- }
-
- public TriStatus triRaise(TriComponentId componentId, TriPortId tsiPortId,
- TriAddress sutAddress, TriSignatureId signatureId, TriException exception) {
- return _itsTestAdapter.triRaise(componentId, tsiPortId, sutAddress, signatureId, exception);
- }
-
- public TriStatus triRaiseBC(TriComponentId componentId,
- TriPortId tsiPortId, TriSignatureId signatureId, TriException exc) {
- return _itsTestAdapter.triRaiseBC(componentId, tsiPortId, signatureId, exc);
- }
-
- public TriStatus triRaiseMC(TriComponentId componentId,
- TriPortId tsiPortId, TriAddressList sutAddresses,
- TriSignatureId signatureId, TriException exc) {
- return _itsTestAdapter.triRaiseMC(componentId, tsiPortId, sutAddresses, signatureId, exc);
- }
-
- public TriStatus triReply(TriComponentId componentId, TriPortId tsiPortId,
- TriAddress sutAddress, TriSignatureId signatureId,
- TriParameterList parameterList, TriParameter returnValue) {
- return _itsTestAdapter.triReply(componentId, tsiPortId, sutAddress, signatureId, parameterList, returnValue);
- }
-
- public TriStatus triReplyBC(TriComponentId componentId,
- TriPortId tsiPortId, TriSignatureId signatureId,
- TriParameterList parameterList, TriParameter returnValue) {
- return _itsTestAdapter.triReplyBC(componentId, tsiPortId, signatureId, parameterList, returnValue);
- }
-
- public TriStatus triReplyMC(TriComponentId componentId,
- TriPortId tsiPortId, TriAddressList sutAddresses,
- TriSignatureId signatureId, TriParameterList parameterList,
- TriParameter returnValue) {
- return _itsTestAdapter.triReplyMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList, returnValue);
- }
-
- public TriStatus triSAReset() {
- return _itsTestAdapter.triSAReset();
- }
-
- public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId,
- TriAddress address, TriMessage sendMessage) {
- return _itsTestAdapter.triSend(componentId, tsiPortId, address, sendMessage);
- }
-
- public TriStatus triSendBC(TriComponentId componentId, TriPortId tsiPortId,
- TriMessage sendMessage) {
- return _itsTestAdapter.triSendBC(componentId, tsiPortId, sendMessage);
- }
-
- public TriStatus triSendMC(TriComponentId componentId, TriPortId tsiPortId,
- TriAddressList addresses, TriMessage sendMessage) {
- return _itsTestAdapter.triSendMC(componentId, tsiPortId, addresses, sendMessage);
- }
-
- public TriStatus triSutActionInformal(String description) {
- return _itsTestAdapter.triSutActionInformal(description);
- }
-
- public TriStatus triUnmap(TriPortId compPortId, TriPortId tsiPortId) {
- return _itsTestAdapter.triUnmap(compPortId, tsiPortId);
- }
-
- public TriStatus triExternalFunction(TriFunctionId functionId, TriParameterList parameterList, TriParameter returnValue) {
-
- TriStatus result = m_triOK;
- if (
- functionId.getFunctionName().endsWith("fx_computeIPv6CheckSum") &&
- (parameterList.size() == 5)
- ) {
- // Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3
- exec_computeIPv6CheckSum(parameterList, returnValue);
- } else if (
- functionId.getFunctionName().endsWith("fx_computeDistance") &&
- (parameterList.size() == 4)
- ) {
- // Compute a distance between two points
- exec_computeDistance(parameterList, returnValue);
- } else if (
- functionId.getFunctionName().endsWith("fx_computePositionUsingDistance") &&
- (parameterList.size() == 6)
- ) {
- // Compute a position using a reference position, a distance and an orientation
- exec_computePositionUsingDistance(parameterList, returnValue);
- } else if (
- functionId.getFunctionName().endsWith("fx_computePositionFromRotation") &&
- (parameterList.size() == 7)
- ) {
- // Compute a reference position rotation
- exec_computePositionFromRotation(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_computeGnTimestamp")) {
- // Compute timestamp based on current time
- exec_computeGnTimestamp(returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_getCurrentTime")) {
- // Gets the current time
- exec_getCurrentTime(returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_getCurrentTimeMark")) {
- // Gets the tenths of a second in the current or next hour in units of 1/10th second from UTC time
- exec_getCurrentTimeMark(returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_getMinuteOfTheYear")) {
- // Gets the the minutes of current UTC year
- exec_getMinuteOfTheYear(returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_getDSecond")) {
- // Gets the milliseconds point in the current UTC minute
- exec_getDSecond(returnValue);
- } else if (functionId.getFunctionName().endsWith("xf_parseIpv6Address")) {
- exec_parseIpv6Address(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_hashWithSha256") && (parameterList.size() == 1)) {
- exec_hashWithSha256(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_signWithEcdsaNistp256WithSha256") && (parameterList.size() == 2)) {
- exec_signWithEcdsaNistp256WithSha256(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_verifyWithEcdsaNistp256WithSha256") && (parameterList.size() == 4)) {
- exec_verifyWithEcdsaNistp256WithSha256(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_generateKeyPair") && (parameterList.size() == 3)) {
- exec_generateKeyPair(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_dms2dd") && (parameterList.size() == 4)) {
- exec_dms2dd(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_isValidPolygonalRegion") && (parameterList.size() == 1)) {
- exec_isValidPolygonalRegion(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_isPolygonalRegionInside") && (parameterList.size() == 2)) {
- exec_isPolygonalRegionInside(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_isLocationInsideCircularRegion") && (parameterList.size() == 2)) {
- exec_isLocationInsideCircularRegion(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_isLocationInsideRectangularRegion") && (parameterList.size() == 2)) {
- exec_isLocationInsideRectangularRegion(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_isLocationInsidePolygonalRegion") && (parameterList.size() == 2)) {
- exec_isLocationInsidePolygonalRegion(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_isLocationInsideIdentifiedRegion") && (parameterList.size() == 2)) {
- exec_isLocationInsideIdentifiedRegion(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_loadCertificates") && (parameterList.size() == 2)) {
- exec_loadCertificates(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_unloadCertificates") && (parameterList.size() == 0)) {
- exec_unloadCertificates(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_readCertificate") && (parameterList.size() == 2)) {
- exec_readCertificate(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_readCertificateDigest") && (parameterList.size() == 2)) {
- exec_readCertificateDigest(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_readSigningKey") && (parameterList.size() == 2)) {
- exec_readSigningKey(parameterList, returnValue);
- } else if (functionId.getFunctionName().endsWith("fx_readEncryptingKey") && (parameterList.size() == 2)) {
- exec_readEncryptingKey(parameterList, returnValue);
- } else {
- System.err.println("Unprocessed external function");
- result = m_triKO;
- }
-
- return result;
- }
-
- public void onConnectionClosed() {
- synchronized(this) {
- notify();
- }
- }
-
- public void onConnectionEstablished() {
- }
-
- public void onError(String error) {
- }
-
- @Override
- public TriStatus triPAReset() {
- return m_triOK;
- }
-
- @Override
- public TriStatus triReadTimer(TriTimerId timerId, TriTimerDuration elapsedTime) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triStartTimer(TriTimerId timerId, TriTimerDuration timerDuration) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triStopTimer(TriTimerId timerId) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triTimerRunning(TriTimerId timerId, TriBoolean running) {
- throw new RuntimeException();
- }
-
- @Override
- public void triEnqueueCall(TriPortId tsiPortId, TriAddress SUTaddress, TriComponentId componentId, TriSignatureId signatureId, TriParameterList parameterList) {
- throw new RuntimeException();
- }
-
- @Override
- public void triEnqueueException(TriPortId tsiPortId, TriAddress sutAddress, TriComponentId componentId, TriSignatureId signatureId,
- TriException exception) {
- throw new RuntimeException();
- }
-
- @Override
- public void triEnqueueMsg(TriPortId tsiPortId, TriAddress sutAddress, TriComponentId componentId, TriMessage receivedMessage) {
- TriProvider.getInstance().getTriCommunicationTE().triEnqueueMsg(
- tsiPortId,
- null,
- componentId,
- receivedMessage);
- }
-
- @Override
- public void triEnqueueReply(TriPortId tsiPortId, TriAddress address, TriComponentId componentId, TriSignatureId signatureId, TriParameterList parameterList, TriParameter returnValue) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triMapParam(TriPortId arg0, TriPortId arg1, TriParameterList arg2) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triUnmapParam(TriPortId arg0, TriPortId arg1, TriParameterList arg2) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriCall(TriComponentId arg0, TriPortId arg1, Value arg2, TriSignatureId arg3, TciParameterList arg4) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriCallBC(TriComponentId arg0, TriPortId arg1, TriSignatureId arg2, TciParameterList arg3) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriCallMC(TriComponentId arg0, TriPortId arg1, TciValueList arg2, TriSignatureId arg3, TciParameterList arg4) {
- throw new RuntimeException();
- }
-
- @Override
- public Value xtriConvert(Object arg0, org.etsi.ttcn.tci.Type arg1) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriMapParam(TriPortId arg0, TriPortId arg1, TciParameterList arg2) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriRaise(TriComponentId arg0, TriPortId arg1, Value arg2, TriSignatureId arg3, Value arg4) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriRaiseBC(TriComponentId arg0, TriPortId arg1, TriSignatureId arg2, Value arg3) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriRaiseMC(TriComponentId arg0, TriPortId arg1, TciValueList arg2, TriSignatureId arg3, Value arg4) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriReply(TriComponentId arg0, TriPortId arg1, Value arg2, TriSignatureId arg3, TciParameterList arg4, Value arg5) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriReplyBC(TriComponentId arg0, TriPortId arg1, TriSignatureId arg2, TciParameterList arg3, Value arg4) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriReplyMC(TriComponentId arg0, TriPortId arg1, TciValueList arg2, TriSignatureId arg3, TciParameterList arg4, Value arg5) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriSend(TriComponentId compPortId, TriPortId tsiPortId, Value arg2, Value arg3) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriSendBC(TriComponentId arg0, TriPortId arg1, Value arg2) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriSendMC(TriComponentId arg0, TriPortId arg1, TciValueList arg2, Value arg3) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus xtriUnmapParam(TriPortId arg0, TriPortId arg1, TciParameterList arg2) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triStaticMap(TriPortId arg0, TriPortId arg1) {
- throw new RuntimeException();
- }
-
- private void exec_computeIPv6CheckSum(TriParameterList parameterList, TriParameter returnValue) {
-
- // Source address (128 bits)
- byte[] value = parameterList.get(0).getEncodedParameter();
- OctetstringValue sourceAddress = (OctetstringValue)TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- sourceAddress.setLength(value.length);
- for (int i = 0; i < value.length; i++) {
- sourceAddress.setOctet(i, value[i]);
- }
- // Destination address (128 bits)
- value = parameterList.get(1).getEncodedParameter();
- OctetstringValue destinationAddress = (OctetstringValue)TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- destinationAddress.setLength(value.length);
- for (int i = 0; i < value.length; i++) {
- destinationAddress.setOctet(i, value[i]);
- }
- // Upper-Layer Packet Length (32 bits)
- value = parameterList.get(2).getEncodedParameter();
- IntegerValue payloadLength = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- payloadLength.setInteger(ByteHelper.byteArrayToInt(value));
- // Upper-Layer payload
- value = parameterList.get(3).getEncodedParameter();
- OctetstringValue payload = (OctetstringValue)TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- payload.setLength(value.length);
- for (int i = 0; i < value.length; i++) {
- payload.setOctet(i, value[i]);
- }
- // Next header value (e.g. 0x3a for ICMPv6) (8bits)
- value = parameterList.get(4).getEncodedParameter();
- IntegerValue nextHdr = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- nextHdr.setInteger(ByteHelper.byteArrayToInt(value));
- // Execute the function
- OctetstringValue checksum = _extfuncsImpl.fx_computeIPv6CheckSum(
- sourceAddress,
- destinationAddress,
- payloadLength,
- payload,
- nextHdr
- );
- value = new byte[checksum.getLength()];
- for (int i = 0; i < value.length; i++) {
- value[i] = (byte)checksum.getOctet(i);
- }
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(value.length * Byte.SIZE);
- returnValue.setEncodedParameter(value);
-
- } // End of method exec_computeIPv6CheckSum
-
- private void exec_computeDistance(TriParameterList parameterList, TriParameter returnValue) {
-
- byte[] value = parameterList.get(0).getEncodedParameter();
- IntegerValue latitudeA = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- latitudeA.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(1).getEncodedParameter();
- IntegerValue longitudeA = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- longitudeA.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(2).getEncodedParameter();
- IntegerValue latitudeB = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- latitudeB.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(3).getEncodedParameter();
- IntegerValue longitudeB = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- longitudeB.setInteger(ByteHelper.byteArrayToInt(value));
-
- // Execute the function
- FloatValue distance = _extfuncsImpl.fx_computeDistance(
- latitudeA,
- longitudeA,
- latitudeB,
- longitudeB
- );
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- byte[] convert = ByteHelper.floatToByteArray(distance.getFloat());
- returnValue.setNumberOfBits(convert.length * Byte.SIZE);
- returnValue.setEncodedParameter(convert);
-
- } // End of method exec_computeDistance
-
- private void exec_computePositionUsingDistance(TriParameterList parameterList, TriParameter returnValue) {
-
- byte[] value = parameterList.get(0).getEncodedParameter();
- IntegerValue refLatitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- refLatitude.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(1).getEncodedParameter();
- IntegerValue refLongitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- refLongitude.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(2).getEncodedParameter();
- FloatValue distance = (FloatValue)TciProvider.getInstance().getTciCDRequired().getFloat().newInstance();
- distance.setFloat(ByteHelper.byteArrayToInt(value)); // FIXME Should be byteArrayToFloat???
-
- value = parameterList.get(3).getEncodedParameter();
- IntegerValue orientation = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- orientation.setInteger(ByteHelper.byteArrayToInt(value));
-
- IntegerValue latitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- IntegerValue longitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- _extfuncsImpl.fx_computePositionUsingDistance(refLatitude, refLongitude, distance, orientation, latitude, longitude);
-
- TriParameter param = parameterList.get(4);
- param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- param.setNumberOfBits(Integer.SIZE);
- param.setEncodedParameter(ByteHelper.intToByteArray(latitude.getInteger(), Integer.SIZE / Byte.SIZE));
-
- param = parameterList.get(5);
- param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- param.setNumberOfBits(Integer.SIZE);
- param.setEncodedParameter(ByteHelper.intToByteArray(longitude.getInteger(), Integer.SIZE / Byte.SIZE));
-
- } // End of method exec_computePositionUsingDistance
-
- private void exec_computePositionFromRotation(TriParameterList parameterList, TriParameter returnValue) {
-
- byte[] value = parameterList.get(0).getEncodedParameter();
- IntegerValue refLatitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- refLatitude.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(1).getEncodedParameter();
- IntegerValue refLongitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- refLongitude.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(2).getEncodedParameter();
- IntegerValue cenLatitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- cenLatitude.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(3).getEncodedParameter();
- IntegerValue cenLongitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- cenLongitude.setInteger(ByteHelper.byteArrayToInt(value));
-
- value = parameterList.get(4).getEncodedParameter();
- IntegerValue rotation = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- rotation.setInteger(ByteHelper.byteArrayToInt(value));
-
- IntegerValue latitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- IntegerValue longitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
- _extfuncsImpl.fx_computePositionFromRotation(refLatitude, refLongitude, cenLatitude, cenLongitude, rotation, latitude, longitude);
-
- TriParameter param = parameterList.get(5);
- param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- param.setNumberOfBits(Integer.SIZE);
- param.setEncodedParameter(ByteHelper.intToByteArray(latitude.getInteger(), Integer.SIZE / Byte.SIZE));
-
- param = parameterList.get(6);
- param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- param.setNumberOfBits(Integer.SIZE);
- param.setEncodedParameter(ByteHelper.intToByteArray(longitude.getInteger(), Integer.SIZE / Byte.SIZE));
-
- }
-
- private void exec_computeGnTimestamp(TriParameter returnValue) {
-
- // Execute the function
- IntegerValue timestamp = _extfuncsImpl.fx_computeGnTimestamp();
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Integer.SIZE);
- returnValue.setEncodedParameter(
- ByteHelper.intToByteArray(
- timestamp.getInteger(),
- Integer.SIZE / Byte.SIZE
- ));
-
- } // End of method exec_computeGnTimestamp
-
- private void exec_getCurrentTime(TriParameter returnValue) {
-
- // Execute the function
- IntegerValue time = _extfuncsImpl.fx_getCurrentTime();
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Long.SIZE);
- returnValue.setEncodedParameter(
- ByteHelper.longToByteArray(
-// ((IntegerValueEx)time).getInt64() << 6, // Decoding starts from bit 0, byte 0, so we have to shift the value 6 bits to the left
- // 6/*Long.SIZE / Byte.SIZE*/ // Encoding on 48 bits
- ((IntegerValueEx)time).getInt64(),
- Long.SIZE / Byte.SIZE
- ));
-
- } // End of method exec_getCurrentTime
-
- private void exec_getCurrentTimeMark(TriParameter returnValue) {
-
- // Execute the function
- IntegerValue time = _extfuncsImpl.fx_getCurrentTimeMark();
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Long.SIZE);
- returnValue.setEncodedParameter(
- ByteHelper.longToByteArray(
- ((IntegerValueEx)time).getInt64(),
- 4/*Integer.SIZE / Byte.SIZE*/ // Encoding on 32 bits
- ));
-
- } // End of method exec_getCurrentTimeMark
-
- private void exec_getMinuteOfTheYear(TriParameter returnValue) {
-
- // Execute the function
- IntegerValue time = _extfuncsImpl.fx_getMinuteOfTheYear();
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Long.SIZE);
- returnValue.setEncodedParameter(
- ByteHelper.longToByteArray(
- ((IntegerValueEx)time).getInt64(),
- 2/*Short.SIZE / Byte.SIZE*/ // Encoding on 16 bits
- ));
-
- } // End of method exec_getMinuteOfTheYear
-
- private void exec_getDSecond(TriParameter returnValue) {
-
- // Execute the function
- IntegerValue time = _extfuncsImpl.fx_getDSecond();
- //_logger.info(String.format("exec_getDSecond returns %d", ((IntegerValueEx)time).getInt64()));
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Long.SIZE);
- returnValue.setEncodedParameter(
- ByteHelper.longToByteArray(
- ((IntegerValueEx)time).getInt64(),
- 2/*Short.SIZE / Byte.SIZE*/ // Encoding on 16 bits
- ));
-
- } // End of method exec_getDSecond
-
- private void exec_generateKeyPair(TriParameterList parameterList, TriParameter returnValue) {
-
- // Execute the function
- OctetstringValue privateKey = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- OctetstringValue publicKeyX = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- OctetstringValue publicKeyY = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- BooleanValue result = _extfuncsImpl.fx_generateKeyPair(privateKey, publicKeyX, publicKeyY);
- // privateKey
- TriParameter Key = parameterList.get(0);
- Key.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- byte[] ref = new byte[privateKey.getLength()];
- for (int i = 0; i < ref.length; i++) {
- ref[i] = (byte) privateKey.getOctet(i);
- } // End 'for' statement
- Key.setEncodedParameter(ref);
- // publicKeyX
- Key = parameterList.get(1);
- Key.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- Key.setNumberOfBits(publicKeyX.getLength() * Byte.SIZE);
- ref = new byte[publicKeyX.getLength()];
- for (int i = 0; i < ref.length; i++) {
- ref[i] = (byte) publicKeyX.getOctet(i);
- } // End 'for' statement
- Key.setEncodedParameter(ref);
- // publicKeyY
- Key = parameterList.get(2);
- Key.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- Key.setNumberOfBits(publicKeyY.getLength() * Byte.SIZE);
- ref = new byte[publicKeyY.getLength()];
- for (int i = 0; i < ref.length; i++) {
- ref[i] = (byte) publicKeyY.getOctet(i);
- } // End 'for' statement
- Key.setEncodedParameter(ref);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) } );
-
- } // End of method exec_generateKeyPair
-
- private void exec_verifyWithEcdsaNistp256WithSha256(TriParameterList parameterList, TriParameter returnValue) {
-
- // Execute the function
- byte[] value = parameterList.get(0).getEncodedParameter();
- OctetstringValue toBeVerifiedData = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- toBeVerifiedData.setLength(value.length);
- for (int i = 0; i < toBeVerifiedData.getLength(); i++) {
- toBeVerifiedData.setOctet(i, value[i]);
- } // End 'for' statement
- value = parameterList.get(1).getEncodedParameter();
- OctetstringValue signature = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- signature.setLength(value.length);
- for (int i = 0; i < signature.getLength(); i++) {
- signature.setOctet(i, value[i]);
- } // End 'for' statement
- value = parameterList.get(2).getEncodedParameter();
- OctetstringValue ecdsaNistp256PublicKeyX = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- ecdsaNistp256PublicKeyX.setLength(value.length);
- for (int i = 0; i < ecdsaNistp256PublicKeyX.getLength(); i++) {
- ecdsaNistp256PublicKeyX.setOctet(i, value[i]);
- } // End 'for' statement
- value = parameterList.get(3).getEncodedParameter();
- OctetstringValue ecdsaNistp256PublicKeyY = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- ecdsaNistp256PublicKeyY.setLength(value.length);
- for (int i = 0; i < ecdsaNistp256PublicKeyY.getLength(); i++) {
- ecdsaNistp256PublicKeyY.setOctet(i, value[i]);
- } // End 'for' statement
- BooleanValue result = _extfuncsImpl.fx_verifyWithEcdsaNistp256WithSha256(toBeVerifiedData, signature, ecdsaNistp256PublicKeyX, ecdsaNistp256PublicKeyY);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) } );
-
- } // End of method exec_fx_verifyWithEcdsaNistp256WithSha256
-
- private void exec_signWithEcdsaNistp256WithSha256(TriParameterList parameterList, TriParameter returnValue) {
-
- // Execute the function
- byte[] value = parameterList.get(0).getEncodedParameter();
- OctetstringValue toBeSignedData = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- toBeSignedData.setLength(value.length);
- for (int i = 0; i < toBeSignedData.getLength(); i++) {
- toBeSignedData.setOctet(i, value[i]);
- } // End 'for' statement
- value = parameterList.get(1).getEncodedParameter();
- OctetstringValue privateKey = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- privateKey.setLength(value.length);
- for (int i = 0; i < privateKey.getLength(); i++) {
- privateKey.setOctet(i, value[i]);
- } // End 'for' statement
-// IntegerValueEx privateKey = (IntegerValueEx) TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
-// privateKey.setInt64(ByteHelper.byteArrayToLong(value));
- OctetstringValue result = _extfuncsImpl.fx_signWithEcdsaNistp256WithSha256(toBeSignedData, privateKey);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(result.getLength() * Byte.SIZE);
- value = new byte[result.getLength()];
- for (int i = 0; i < value.length; i++) {
- value[i] = (byte) result.getOctet(i);
- } // End 'for' statement
- returnValue.setEncodedParameter(value);
-
- } // End of method exec_signWithEcdsaNistp256WithSha256
-
- private void exec_hashWithSha256(TriParameterList parameterList, TriParameter returnValue) {
-
- // Execute the function
- byte[] value = parameterList.get(0).getEncodedParameter();
- OctetstringValue toBeHashedData = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
- toBeHashedData.setLength(value.length);
- for (int i = 0; i < toBeHashedData.getLength(); i++) {
- toBeHashedData.setOctet(i, value[i]);
- } // End 'for' statement
- OctetstringValue result = _extfuncsImpl.fx_hashWithSha256(toBeHashedData);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(result.getLength() * Byte.SIZE);
- value = new byte[result.getLength()];
- for (int i = 0; i < value.length; i++) {
- value[i] = (byte) result.getOctet(i);
- } // End 'for' statement
- returnValue.setEncodedParameter(value);
-
- } // End of method exec_hashWithSha256
-
- private void exec_dms2dd(TriParameterList parameterList, TriParameter returnValue) {
-
- // Prepare arguments
- ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
- IntegerValue degrees = wrapper.setInteger(new BigInteger(parameterList.get(0).getEncodedParameter()));
- IntegerValue minutes = wrapper.setInteger(new BigInteger(parameterList.get(1).getEncodedParameter()));
- FloatValue seconds = wrapper.getFloat();
- seconds.setFloat(ByteHelper.byteArrayToFloat(parameterList.get(2).getEncodedParameter()));
- OctetstringValue latlon = wrapper.getOctetstring();
- latlon.setLength(1);
- latlon.setOctet(0, parameterList.get(3).getEncodedParameter()[0]);
- FloatValue result = _extfuncsImpl.fx_dms2dd(degrees, minutes, seconds, latlon);
-
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Float.SIZE);
- returnValue.setEncodedParameter(ByteHelper.floatToByteArray(result.getFloat()));
-
- } // End of method exec_dms2dd
-
- private void exec_isValidPolygonalRegion(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode region parameter
- ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
- RecordOfValue region = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
- byte[] value = parameterList.get(0).getEncodedParameter();
- byte length = value[0];
- int offset = 1;
- while (offset < length) { // TODO Create a method to fill PolygonRegions
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
- twoDLocation.setField("latitude", wrapper.setInteger(latitude));
- twoDLocation.setField("longitude", wrapper.setInteger(longitude));
- }
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_isValidPolygonalRegion(region);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_isValidPolygonalRegion
-
- private void exec_isPolygonalRegionInside(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode parent parameter
- // Execute the function
- ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
- RecordOfValue parent = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
- byte[] value = parameterList.get(0).getEncodedParameter();
- byte length = value[0];
- int offset = 1;
- while (offset < length) { // TODO Create a method to fill PolygonRegions
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
- twoDLocation.setField("latitude", wrapper.setInteger(latitude));
- twoDLocation.setField("longitude", wrapper.setInteger(longitude));
- parent.appendField(twoDLocation);
- } // End of 'while' statement
- // Decode region parameter
- RecordOfValue region = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
- value = ByteHelper.extract(parameterList.get(0).getEncodedParameter(), offset, parameterList.get(0).getEncodedParameter().length - offset);
- length = value[0];
- offset = 1;
- while (offset < length) { // TODO Create a method to fill PolygonRegions
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
- twoDLocation.setField("latitude", wrapper.setInteger(latitude));
- twoDLocation.setField("longitude", wrapper.setInteger(longitude));
- region.appendField(twoDLocation);
- } // End of 'while' statement
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_isPolygonalRegionInside(parent, region);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_isPolygonalRegionInside
-
- private void exec_isLocationInsideCircularRegion(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode rectangularRegions parameter
- ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
- byte[] value = parameterList.get(0).getEncodedParameter();
- int offset = 0;
- // Center
- RecordValue center = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- center.setField("latitude", wrapper.setInteger(latitude));
- center.setField("longitude", wrapper.setInteger(longitude));
-
- // Radius
- int radius = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
-
- RecordValue circularRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.CircularRegion");
- circularRegion.setField("center", center);
- circularRegion.setField("radius", wrapper.setInteger(radius));
- // Decode location parameter
- value = parameterList.get(1).getEncodedParameter();
- offset = 0;
- // WGS84 Latitude
- latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
- location.setField("latitude", wrapper.setInteger(latitude));
- location.setField("longitude", wrapper.setInteger(longitude));
- OctetstringValue elevation = wrapper.getOctetstring();
- elevation.setLength(2);
- elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
- location.setField("elevation", elevation);
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_isLocationInsideCircularRegion(circularRegion, location);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_isLocationInsideCircularRegion
-
- private void exec_isLocationInsideRectangularRegion(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode rectangularRegions parameter
- ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
- RecordOfValue rectangularRegions = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.RectangularRegions");
- byte[] value = parameterList.get(0).getEncodedParameter();
- byte length = value[0];
- int offset = 1;
- while (offset < length) { // TODO Create a method to fill RectangularRegions
- // northwest
- RecordValue northwest = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- northwest.setField("latitude", wrapper.setInteger(latitude));
- northwest.setField("longitude", wrapper.setInteger(longitude));
-
- // southeast
- RecordValue southeast = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
- // WGS84 Latitude
- latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- southeast.setField("latitude", wrapper.setInteger(latitude));
- southeast.setField("longitude", wrapper.setInteger(longitude));
-
- RecordValue rectangularRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.RectangularRegion");
- rectangularRegion.setField("northwest", northwest);
- rectangularRegion.setField("southeast", southeast);
-
- rectangularRegions.appendField(rectangularRegion);
- } // End of 'while' statement
- // Decode location parameter
-// ByteHelper.dump("exec_isLocationInsidePolygonalRegion: ", parameterList.get(1).getEncodedParameter());
- value = parameterList.get(1).getEncodedParameter();
- offset = 0;
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
- location.setField("latitude", wrapper.setInteger(latitude));
- location.setField("longitude", wrapper.setInteger(longitude));
- OctetstringValue elevation = wrapper.getOctetstring();
- elevation.setLength(2);
- elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
- location.setField("elevation", elevation);
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_isLocationInsideRectangularRegion(rectangularRegions, location);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_isLocationInsideRectangularRegion
-
- private void exec_isLocationInsidePolygonalRegion(TriParameterList parameterList, TriParameter returnValue) {
-
- // Execute the function
- ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
- RecordOfValue polygonalArea = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
- byte[] value = parameterList.get(0).getEncodedParameter();
- byte length = value[0];
- int offset = 1;
- while (offset < length) { // TODO Create a method to fill PolygonRegions
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
- twoDLocation.setField("latitude", wrapper.setInteger(latitude));
- twoDLocation.setField("longitude", wrapper.setInteger(longitude));
- polygonalArea.appendField(twoDLocation);
- } // End of 'while' statement
-// ByteHelper.dump("exec_isLocationInsidePolygonalRegion: ", parameterList.get(1).getEncodedParameter());
- value = parameterList.get(1).getEncodedParameter();
- offset = 0;
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
- location.setField("latitude", wrapper.setInteger(latitude));
- location.setField("longitude", wrapper.setInteger(longitude));
- OctetstringValue elevation = wrapper.getOctetstring();
- elevation.setLength(2);
- elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
- location.setField("elevation", elevation);
- BooleanValue result = _extfuncsImpl.fx_isLocationInsidePolygonalRegion(polygonalArea, location);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_isLocationInsidePolygonalRegion
-
- private void exec_isLocationInsideIdentifiedRegion(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode rectangularRegions parameter
- ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
- byte[] value = parameterList.get(0).getEncodedParameter();
- int offset = 0;
- // RegionDictionary
- EnumeratedValue region_dictionary = wrapper.getEnumValue("LibItsSecurity_TypesAndValues.RegionDictionary");
- region_dictionary.setInt(value[offset++]);
- // region_identifier
- int region_identifier = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
- offset += Short.SIZE / Byte.SIZE;
- // local_region
- int local_region;
- if ((value[offset] & 0x80) == 0x00) { // One byte length
- local_region = value[offset];
- } else {
- // TODO Process it as IntX, not as 4 bytes integer
- value[offset] &= 0x7f;
- local_region = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
- }
- RecordValue identifiedRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.IdentifiedRegion");
- identifiedRegion.setField("region_dictionary", region_dictionary);
- identifiedRegion.setField("region_identifier", wrapper.setInteger(region_identifier));
- identifiedRegion.setField("local_region", wrapper.setInteger(local_region));
-
- // Decode location parameter
- value = parameterList.get(1).getEncodedParameter();
- offset = 0;
- // WGS84 Latitude
- int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- // WGS84 Longitude
- int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
- offset += Integer.SIZE / Byte.SIZE;
- RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
- location.setField("latitude", wrapper.setInteger(latitude));
- location.setField("longitude", wrapper.setInteger(longitude));
- OctetstringValue elevation = wrapper.getOctetstring();
- elevation.setLength(2);
- elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
- location.setField("elevation", elevation);
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_isLocationInsideIdentifiedRegion(identifiedRegion, location);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_isLocationInsideIdentifiedRegion
-
- private void exec_loadCertificates(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode parameter
- CharstringValue rootDirectory = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
- String str = new String(parameterList.get(0).getEncodedParameter());
- rootDirectory.setString(str);
-
- CharstringValue configId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
- str = new String(parameterList.get(1).getEncodedParameter());
- configId.setString(str);
-
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_loadCertificates(rootDirectory, configId);
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_parseIpv6Address
-
- private void exec_unloadCertificates(TriParameterList parameterList, TriParameter returnValue) {
-
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_unloadCertificates();
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_parseIpv6Address
-
- private void exec_readCertificate(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode parameter
- CharstringValue certificateId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
- String str = new String(parameterList.get(0).getEncodedParameter());
- certificateId.setString(str);
-
- OctetstringValue certificate = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
-
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_readCertificate(certificateId, certificate);
-
- parameterList.get(1).setNumberOfBits(certificate.getLength() * Byte.SIZE);
- byte[] value = new byte[certificate.getLength()];
- for (int i = 0; i < value.length; i++) {
- value[i] = (byte) certificate.getOctet(i);
- }// End of 'for'statement
- parameterList.get(1).setEncodedParameter(value);
-
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_parseIpv6Address
-
- private void exec_readCertificateDigest(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode parameter
- CharstringValue certificateId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
- String str = new String(parameterList.get(0).getEncodedParameter());
- certificateId.setString(str);
-
- OctetstringValue digest = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
-
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_readCertificateDigest(certificateId, digest);
-
- parameterList.get(1).setNumberOfBits(digest.getLength() * Byte.SIZE);
- byte[] value = new byte[digest.getLength()];
- for (int i = 0; i < value.length; i++) {
- value[i] = (byte) digest.getOctet(i);
- }// End of 'for'statement
- parameterList.get(1).setEncodedParameter(value);
-
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_readCertificateDigest
-
- private void exec_readSigningKey(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode parameter
- CharstringValue keysId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
- String str = new String(parameterList.get(0).getEncodedParameter());
- keysId.setString(str);
-
- OctetstringValue privateKey = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
-
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_readSigningKey(keysId, privateKey);
-
- parameterList.get(1).setNumberOfBits(privateKey.getLength() * Byte.SIZE);
- byte[] value = new byte[privateKey.getLength()];
- for (int i = 0; i < value.length; i++) {
- value[i] = (byte) privateKey.getOctet(i);
- }// End of 'for'statement
- parameterList.get(1).setEncodedParameter(value);
-
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_readSigningKeys
-
- private void exec_readEncryptingKey(TriParameterList parameterList, TriParameter returnValue) {
-
- // Decode parameter
- CharstringValue keysId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
- String str = new String(parameterList.get(0).getEncodedParameter());
- keysId.setString(str);
-
- OctetstringValue privateKey = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
-
- // Execute the function
- BooleanValue result = _extfuncsImpl.fx_readEncryptingKey(keysId, privateKey);
-
- parameterList.get(1).setNumberOfBits(privateKey.getLength() * Byte.SIZE);
- byte[] value = new byte[privateKey.getLength()];
- for (int i = 0; i < value.length; i++) {
- value[i] = (byte) privateKey.getOctet(i);
- }// End of 'for'statement
- parameterList.get(1).setEncodedParameter(value);
-
- // Return code
- returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
- returnValue.setNumberOfBits(Byte.SIZE);
- returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
-
- } // End of method exec_readSigningKeys
-
- private void exec_parseIpv6Address(TriParameterList parameterList, TriParameter returnValue) {
-
- } // End of method exec_parseIpv6Address
-
- @Override
- public TriStatus triBeginWait(long arg0, TriComponentId arg1) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triNextSampling(long arg0, TriPortId arg1) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triReadClock(TriLong arg0) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triStartClock(long arg0) {
- throw new RuntimeException();
- }
-
- @Override
- public void triSAErrorReq(String arg0) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triGetStreamValue(TriComponentId arg0, TriPortId arg1, TriAddress arg2, TriMessage arg3) {
- throw new RuntimeException();
- }
-
- @Override
- public TriStatus triSetStreamValue(TriComponentId arg0, TriPortId arg1, TriAddress arg2, TriMessage arg3) {
- throw new RuntimeException();
- }
-
-} // End of class PluginAdapter
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TestAdapter.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TestAdapter.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TestAdapter.java (nonexistent)
@@ -1,28 +0,0 @@
-package org.etsi.tool.elvior.adapter;
-
-import org.etsi.ttcn.tri.TriActionTemplate;
-import org.etsi.ttcn.tri.TriPortIdList;
-import org.etsi.ttcn.tri.TriStatus;
-import org.etsi.ttcn.tri.TriTestCaseId;
-
-
[email protected]({ "deprecation", "serial" })
-public class TestAdapter extends org.etsi.ttcn.adapter.core.TestAdapter {
-
- /* (non-Javadoc)
- * @see org.etsi.ttcn.tri.TriCommunicationSA#triExecuteTestcase(org.etsi.ttcn.tri.TriTestCaseId, org.etsi.ttcn.tri.TriPortIdList)
- */
- @Override
- public TriStatus triExecuteTestcase(final TriTestCaseId tcId, final TriPortIdList portList) {
- return required.getTriStatus(TriStatus.TRI_OK);
- }
-
- /**
- * triSutActionTemplate not implemented
- * @see org.etsi.ttcn.tri.TriCommunicationSA#triSutActionTemplate(org.etsi.ttcn.tri.TriActionTemplate)
- */
- @Override
- public TriStatus triSutActionTemplate(TriActionTemplate templateValue) {
- return required.getTriStatus(TriStatus.TRI_ERROR, "triSutActionTemplate not implemented");
- }
-}
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TestAdapter.java
Property changes:
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-URL Id
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TestAdapterMain.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TestAdapterMain.java (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior/adapter/TestAdapterMain.java (nonexistent)
@@ -1,18 +0,0 @@
-/**
- * @author STF 424_ITS_Test_Platform
- * @version $id$
- */
-package org.etsi.tool.elvior.adapter;
-
-public class TestAdapterMain {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- PluginAdapter adapter = new PluginAdapter();
- adapter.run();
- System.exit(0);
- }
-
-} //End of class Main
Index: AdapterFramework/javasrc/tool/org/etsi/tool/elvior
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/tool/elvior (revision 2744)
+++ AdapterFramework/javasrc/tool/org/etsi/tool/elvior (nonexistent)
/AdapterFramework/javasrc/tool/org/etsi/tool/elvior
Property changes:
Deleted: tsvn:logminsize
## -1 +0,0 ##
-5
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/PluginAdapter.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/PluginAdapter.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/PluginAdapter.java (revision 2745)
@@ -0,0 +1,1272 @@
+/**
+ * @author STF 424_ITS_Test_Platform
+ * @version $id$
+ */
+package org.etsi.ttcn.tool.elvior.adapter;
+
+import java.io.IOException;
+import java.math.BigInteger;
+import java.util.Properties;
+
+import org.elvior.ttcn.tritci.ChannelEventHandler;
+import org.elvior.ttcn.tritci.IntegerValueEx;
+import org.elvior.ttcn.tritci.TciProvider;
+import org.elvior.ttcn.tritci.TriFactory;
+import org.elvior.ttcn.tritci.TriProvider;
+import org.elvior.ttcn.tritci.TriTciChannel;
+import org.etsi.ttcn.adapter.core.TERFactory;
+import org.etsi.ttcn.codec.core.ITciCDWrapper;
+import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
+import org.etsi.common.ByteHelper;
+import org.etsi.its.extfunc.IItsExternalFunctionsProvider;
+import org.etsi.its.extfunc.ItsExternalFunctionsProvider;
+import org.etsi.ttcn.tool.elvior.codec.TciCDWrapper;
+import org.etsi.ttcn.tci.BooleanValue;
+import org.etsi.ttcn.tci.CharstringValue;
+import org.etsi.ttcn.tci.EnumeratedValue;
+import org.etsi.ttcn.tci.FloatValue;
+import org.etsi.ttcn.tci.IntegerValue;
+import org.etsi.ttcn.tci.OctetstringValue;
+import org.etsi.ttcn.tci.RecordOfValue;
+import org.etsi.ttcn.tci.RecordValue;
+import org.etsi.ttcn.tci.TciParameterList;
+import org.etsi.ttcn.tci.TciValueList;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriAddress;
+import org.etsi.ttcn.tri.TriAddressList;
+import org.etsi.ttcn.tri.TriBoolean;
+import org.etsi.ttcn.tri.TriCommunicationSA;
+import org.etsi.ttcn.tri.TriCommunicationTE;
+import org.etsi.ttcn.tri.TriComponentId;
+import org.etsi.ttcn.tri.TriException;
+import org.etsi.ttcn.tri.TriFunctionId;
+import org.etsi.ttcn.tri.TriLong;
+import org.etsi.ttcn.tri.TriMessage;
+import org.etsi.ttcn.tri.TriParameter;
+import org.etsi.ttcn.tri.TriParameterList;
+import org.etsi.ttcn.tri.TriParameterPassingMode;
+import org.etsi.ttcn.tri.TriPlatformPA;
+import org.etsi.ttcn.tri.TriPortId;
+import org.etsi.ttcn.tri.TriPortIdList;
+import org.etsi.ttcn.tri.TriSignatureId;
+import org.etsi.ttcn.tri.TriStatus;
+import org.etsi.ttcn.tri.TriTestCaseId;
+import org.etsi.ttcn.tri.TriTimerDuration;
+import org.etsi.ttcn.tri.TriTimerId;
+import org.etsi.ttcn.xtri.xTriCommunicationSA;
+
+public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xTriCommunicationSA, TriPlatformPA, ChannelEventHandler {
+ /**
+ * This is the main PluginAdapter class
+ */
+ private TestAdapter _itsTestAdapter;
+
+ private static Properties _properties = new Properties();
+
+ private TriStatus m_triOK;
+
+ private TriStatus m_triKO;
+
+ private IItsExternalFunctionsProvider _extfuncsImpl;
+
+ public PluginAdapter() {
+
+ // Load TA settings
+ try {
+ _properties.load(TestAdapterMain.class.getResourceAsStream("./ta.properties"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ // Register this object as the instance implementing the TRI-SA interface
+ TriProvider.getInstance().setTriCommunicationSA(this);
+ // Register this object as the instance implementing the TRI-PA interface
+ TriProvider.getInstance().setTriPlatformPA(this);
+ TriTciChannel channel = TriTciChannel.getInstance();
+ // Set application name that will be displayed in the TestCast log
+ channel.setApplicationName("ItsPlatform");
+ // Register this object as the receiver of events generated by TestCast framework
+ channel.setEventHandler(this);
+ TriFactory factory = TriProvider.getInstance().getTriFactory();
+ m_triOK = factory.createOkStatus();
+ m_triKO = factory.createErrorStatus();
+ TERFactory.setImpl(new TeRequiredImpl(this));
+ // External functions
+ TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper());
+ _extfuncsImpl = new ItsExternalFunctionsProvider();
+ }
+
+ public void run() {
+
+ // Attempt to connect to TestCast
+ if (TriTciChannel.getInstance().open()) {
+ _itsTestAdapter = new TestAdapter();
+ try {
+ synchronized(this) {
+ wait();
+ }
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+
+ public TriStatus triCall(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddress sutAddress, TriSignatureId signatureId,
+ TriParameterList parameterList) {
+ return _itsTestAdapter.triCall(componentId, tsiPortId, sutAddress, signatureId, parameterList);
+ }
+
+ public TriStatus triCallBC(TriComponentId componentId, TriPortId tsiPortId,
+ TriSignatureId signatureId, TriParameterList parameterList) {
+ return _itsTestAdapter.triCallBC(componentId, tsiPortId, signatureId, parameterList);
+ }
+
+ public TriStatus triCallMC(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddressList sutAddresses, TriSignatureId signatureId,
+ TriParameterList parameterList) {
+ return _itsTestAdapter.triCallMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList);
+ }
+
+ public TriStatus triEndTestCase() {
+ return _itsTestAdapter.triEndTestCase();
+ }
+
+ public TriStatus triExecuteTestCase(TriTestCaseId testCaseId, TriPortIdList tsiPorts) {
+ // Disable XTRI functionality for all ports, so that existing SA implementation can be reused
+ for(int i = 0; i < tsiPorts.size(); i++) {
+ TriTciChannel.getInstance().enableXTriForPort(tsiPorts.get(i), false);
+ }
+ return _itsTestAdapter.triExecuteTestcase(testCaseId, tsiPorts);
+ }
+
+ public TriStatus triMap(TriPortId compPortId, TriPortId tsiPortId) {
+ return _itsTestAdapter.triMap(compPortId, tsiPortId);
+ }
+
+ public TriStatus triRaise(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddress sutAddress, TriSignatureId signatureId, TriException exception) {
+ return _itsTestAdapter.triRaise(componentId, tsiPortId, sutAddress, signatureId, exception);
+ }
+
+ public TriStatus triRaiseBC(TriComponentId componentId,
+ TriPortId tsiPortId, TriSignatureId signatureId, TriException exc) {
+ return _itsTestAdapter.triRaiseBC(componentId, tsiPortId, signatureId, exc);
+ }
+
+ public TriStatus triRaiseMC(TriComponentId componentId,
+ TriPortId tsiPortId, TriAddressList sutAddresses,
+ TriSignatureId signatureId, TriException exc) {
+ return _itsTestAdapter.triRaiseMC(componentId, tsiPortId, sutAddresses, signatureId, exc);
+ }
+
+ public TriStatus triReply(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddress sutAddress, TriSignatureId signatureId,
+ TriParameterList parameterList, TriParameter returnValue) {
+ return _itsTestAdapter.triReply(componentId, tsiPortId, sutAddress, signatureId, parameterList, returnValue);
+ }
+
+ public TriStatus triReplyBC(TriComponentId componentId,
+ TriPortId tsiPortId, TriSignatureId signatureId,
+ TriParameterList parameterList, TriParameter returnValue) {
+ return _itsTestAdapter.triReplyBC(componentId, tsiPortId, signatureId, parameterList, returnValue);
+ }
+
+ public TriStatus triReplyMC(TriComponentId componentId,
+ TriPortId tsiPortId, TriAddressList sutAddresses,
+ TriSignatureId signatureId, TriParameterList parameterList,
+ TriParameter returnValue) {
+ return _itsTestAdapter.triReplyMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList, returnValue);
+ }
+
+ public TriStatus triSAReset() {
+ return _itsTestAdapter.triSAReset();
+ }
+
+ public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddress address, TriMessage sendMessage) {
+ return _itsTestAdapter.triSend(componentId, tsiPortId, address, sendMessage);
+ }
+
+ public TriStatus triSendBC(TriComponentId componentId, TriPortId tsiPortId,
+ TriMessage sendMessage) {
+ return _itsTestAdapter.triSendBC(componentId, tsiPortId, sendMessage);
+ }
+
+ public TriStatus triSendMC(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddressList addresses, TriMessage sendMessage) {
+ return _itsTestAdapter.triSendMC(componentId, tsiPortId, addresses, sendMessage);
+ }
+
+ public TriStatus triSutActionInformal(String description) {
+ return _itsTestAdapter.triSutActionInformal(description);
+ }
+
+ public TriStatus triUnmap(TriPortId compPortId, TriPortId tsiPortId) {
+ return _itsTestAdapter.triUnmap(compPortId, tsiPortId);
+ }
+
+ public TriStatus triExternalFunction(TriFunctionId functionId, TriParameterList parameterList, TriParameter returnValue) {
+
+ TriStatus result = m_triOK;
+ if (
+ functionId.getFunctionName().endsWith("fx_computeIPv6CheckSum") &&
+ (parameterList.size() == 5)
+ ) {
+ // Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3
+ exec_computeIPv6CheckSum(parameterList, returnValue);
+ } else if (
+ functionId.getFunctionName().endsWith("fx_computeDistance") &&
+ (parameterList.size() == 4)
+ ) {
+ // Compute a distance between two points
+ exec_computeDistance(parameterList, returnValue);
+ } else if (
+ functionId.getFunctionName().endsWith("fx_computePositionUsingDistance") &&
+ (parameterList.size() == 6)
+ ) {
+ // Compute a position using a reference position, a distance and an orientation
+ exec_computePositionUsingDistance(parameterList, returnValue);
+ } else if (
+ functionId.getFunctionName().endsWith("fx_computePositionFromRotation") &&
+ (parameterList.size() == 7)
+ ) {
+ // Compute a reference position rotation
+ exec_computePositionFromRotation(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_computeGnTimestamp")) {
+ // Compute timestamp based on current time
+ exec_computeGnTimestamp(returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_getCurrentTime")) {
+ // Gets the current time
+ exec_getCurrentTime(returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_getCurrentTimeMark")) {
+ // Gets the tenths of a second in the current or next hour in units of 1/10th second from UTC time
+ exec_getCurrentTimeMark(returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_getMinuteOfTheYear")) {
+ // Gets the the minutes of current UTC year
+ exec_getMinuteOfTheYear(returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_getDSecond")) {
+ // Gets the milliseconds point in the current UTC minute
+ exec_getDSecond(returnValue);
+ } else if (functionId.getFunctionName().endsWith("xf_parseIpv6Address")) {
+ exec_parseIpv6Address(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_hashWithSha256") && (parameterList.size() == 1)) {
+ exec_hashWithSha256(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_signWithEcdsaNistp256WithSha256") && (parameterList.size() == 2)) {
+ exec_signWithEcdsaNistp256WithSha256(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_verifyWithEcdsaNistp256WithSha256") && (parameterList.size() == 4)) {
+ exec_verifyWithEcdsaNistp256WithSha256(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_generateKeyPair") && (parameterList.size() == 3)) {
+ exec_generateKeyPair(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_dms2dd") && (parameterList.size() == 4)) {
+ exec_dms2dd(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_isValidPolygonalRegion") && (parameterList.size() == 1)) {
+ exec_isValidPolygonalRegion(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_isPolygonalRegionInside") && (parameterList.size() == 2)) {
+ exec_isPolygonalRegionInside(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_isLocationInsideCircularRegion") && (parameterList.size() == 2)) {
+ exec_isLocationInsideCircularRegion(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_isLocationInsideRectangularRegion") && (parameterList.size() == 2)) {
+ exec_isLocationInsideRectangularRegion(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_isLocationInsidePolygonalRegion") && (parameterList.size() == 2)) {
+ exec_isLocationInsidePolygonalRegion(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_isLocationInsideIdentifiedRegion") && (parameterList.size() == 2)) {
+ exec_isLocationInsideIdentifiedRegion(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_loadCertificates") && (parameterList.size() == 2)) {
+ exec_loadCertificates(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_unloadCertificates") && (parameterList.size() == 0)) {
+ exec_unloadCertificates(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_readCertificate") && (parameterList.size() == 2)) {
+ exec_readCertificate(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_readCertificateDigest") && (parameterList.size() == 2)) {
+ exec_readCertificateDigest(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_readSigningKey") && (parameterList.size() == 2)) {
+ exec_readSigningKey(parameterList, returnValue);
+ } else if (functionId.getFunctionName().endsWith("fx_readEncryptingKey") && (parameterList.size() == 2)) {
+ exec_readEncryptingKey(parameterList, returnValue);
+ } else {
+ System.err.println("Unprocessed external function");
+ result = m_triKO;
+ }
+
+ return result;
+ }
+
+ public void onConnectionClosed() {
+ synchronized(this) {
+ notify();
+ }
+ }
+
+ public void onConnectionEstablished() {
+ }
+
+ public void onError(String error) {
+ }
+
+ @Override
+ public TriStatus triPAReset() {
+ return m_triOK;
+ }
+
+ @Override
+ public TriStatus triReadTimer(TriTimerId timerId, TriTimerDuration elapsedTime) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triStartTimer(TriTimerId timerId, TriTimerDuration timerDuration) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triStopTimer(TriTimerId timerId) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triTimerRunning(TriTimerId timerId, TriBoolean running) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public void triEnqueueCall(TriPortId tsiPortId, TriAddress SUTaddress, TriComponentId componentId, TriSignatureId signatureId, TriParameterList parameterList) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public void triEnqueueException(TriPortId tsiPortId, TriAddress sutAddress, TriComponentId componentId, TriSignatureId signatureId,
+ TriException exception) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public void triEnqueueMsg(TriPortId tsiPortId, TriAddress sutAddress, TriComponentId componentId, TriMessage receivedMessage) {
+ TriProvider.getInstance().getTriCommunicationTE().triEnqueueMsg(
+ tsiPortId,
+ null,
+ componentId,
+ receivedMessage);
+ }
+
+ @Override
+ public void triEnqueueReply(TriPortId tsiPortId, TriAddress address, TriComponentId componentId, TriSignatureId signatureId, TriParameterList parameterList, TriParameter returnValue) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triMapParam(TriPortId arg0, TriPortId arg1, TriParameterList arg2) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triUnmapParam(TriPortId arg0, TriPortId arg1, TriParameterList arg2) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriCall(TriComponentId arg0, TriPortId arg1, Value arg2, TriSignatureId arg3, TciParameterList arg4) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriCallBC(TriComponentId arg0, TriPortId arg1, TriSignatureId arg2, TciParameterList arg3) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriCallMC(TriComponentId arg0, TriPortId arg1, TciValueList arg2, TriSignatureId arg3, TciParameterList arg4) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public Value xtriConvert(Object arg0, org.etsi.ttcn.tci.Type arg1) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriMapParam(TriPortId arg0, TriPortId arg1, TciParameterList arg2) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriRaise(TriComponentId arg0, TriPortId arg1, Value arg2, TriSignatureId arg3, Value arg4) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriRaiseBC(TriComponentId arg0, TriPortId arg1, TriSignatureId arg2, Value arg3) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriRaiseMC(TriComponentId arg0, TriPortId arg1, TciValueList arg2, TriSignatureId arg3, Value arg4) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriReply(TriComponentId arg0, TriPortId arg1, Value arg2, TriSignatureId arg3, TciParameterList arg4, Value arg5) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriReplyBC(TriComponentId arg0, TriPortId arg1, TriSignatureId arg2, TciParameterList arg3, Value arg4) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriReplyMC(TriComponentId arg0, TriPortId arg1, TciValueList arg2, TriSignatureId arg3, TciParameterList arg4, Value arg5) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriSend(TriComponentId compPortId, TriPortId tsiPortId, Value arg2, Value arg3) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriSendBC(TriComponentId arg0, TriPortId arg1, Value arg2) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriSendMC(TriComponentId arg0, TriPortId arg1, TciValueList arg2, Value arg3) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus xtriUnmapParam(TriPortId arg0, TriPortId arg1, TciParameterList arg2) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triStaticMap(TriPortId arg0, TriPortId arg1) {
+ throw new RuntimeException();
+ }
+
+ private void exec_computeIPv6CheckSum(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Source address (128 bits)
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ OctetstringValue sourceAddress = (OctetstringValue)TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ sourceAddress.setLength(value.length);
+ for (int i = 0; i < value.length; i++) {
+ sourceAddress.setOctet(i, value[i]);
+ }
+ // Destination address (128 bits)
+ value = parameterList.get(1).getEncodedParameter();
+ OctetstringValue destinationAddress = (OctetstringValue)TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ destinationAddress.setLength(value.length);
+ for (int i = 0; i < value.length; i++) {
+ destinationAddress.setOctet(i, value[i]);
+ }
+ // Upper-Layer Packet Length (32 bits)
+ value = parameterList.get(2).getEncodedParameter();
+ IntegerValue payloadLength = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ payloadLength.setInteger(ByteHelper.byteArrayToInt(value));
+ // Upper-Layer payload
+ value = parameterList.get(3).getEncodedParameter();
+ OctetstringValue payload = (OctetstringValue)TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ payload.setLength(value.length);
+ for (int i = 0; i < value.length; i++) {
+ payload.setOctet(i, value[i]);
+ }
+ // Next header value (e.g. 0x3a for ICMPv6) (8bits)
+ value = parameterList.get(4).getEncodedParameter();
+ IntegerValue nextHdr = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ nextHdr.setInteger(ByteHelper.byteArrayToInt(value));
+ // Execute the function
+ OctetstringValue checksum = _extfuncsImpl.fx_computeIPv6CheckSum(
+ sourceAddress,
+ destinationAddress,
+ payloadLength,
+ payload,
+ nextHdr
+ );
+ value = new byte[checksum.getLength()];
+ for (int i = 0; i < value.length; i++) {
+ value[i] = (byte)checksum.getOctet(i);
+ }
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(value.length * Byte.SIZE);
+ returnValue.setEncodedParameter(value);
+
+ } // End of method exec_computeIPv6CheckSum
+
+ private void exec_computeDistance(TriParameterList parameterList, TriParameter returnValue) {
+
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ IntegerValue latitudeA = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ latitudeA.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(1).getEncodedParameter();
+ IntegerValue longitudeA = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ longitudeA.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(2).getEncodedParameter();
+ IntegerValue latitudeB = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ latitudeB.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(3).getEncodedParameter();
+ IntegerValue longitudeB = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ longitudeB.setInteger(ByteHelper.byteArrayToInt(value));
+
+ // Execute the function
+ FloatValue distance = _extfuncsImpl.fx_computeDistance(
+ latitudeA,
+ longitudeA,
+ latitudeB,
+ longitudeB
+ );
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ byte[] convert = ByteHelper.floatToByteArray(distance.getFloat());
+ returnValue.setNumberOfBits(convert.length * Byte.SIZE);
+ returnValue.setEncodedParameter(convert);
+
+ } // End of method exec_computeDistance
+
+ private void exec_computePositionUsingDistance(TriParameterList parameterList, TriParameter returnValue) {
+
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ IntegerValue refLatitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ refLatitude.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(1).getEncodedParameter();
+ IntegerValue refLongitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ refLongitude.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(2).getEncodedParameter();
+ FloatValue distance = (FloatValue)TciProvider.getInstance().getTciCDRequired().getFloat().newInstance();
+ distance.setFloat(ByteHelper.byteArrayToInt(value)); // FIXME Should be byteArrayToFloat???
+
+ value = parameterList.get(3).getEncodedParameter();
+ IntegerValue orientation = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ orientation.setInteger(ByteHelper.byteArrayToInt(value));
+
+ IntegerValue latitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ IntegerValue longitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ _extfuncsImpl.fx_computePositionUsingDistance(refLatitude, refLongitude, distance, orientation, latitude, longitude);
+
+ TriParameter param = parameterList.get(4);
+ param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ param.setNumberOfBits(Integer.SIZE);
+ param.setEncodedParameter(ByteHelper.intToByteArray(latitude.getInteger(), Integer.SIZE / Byte.SIZE));
+
+ param = parameterList.get(5);
+ param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ param.setNumberOfBits(Integer.SIZE);
+ param.setEncodedParameter(ByteHelper.intToByteArray(longitude.getInteger(), Integer.SIZE / Byte.SIZE));
+
+ } // End of method exec_computePositionUsingDistance
+
+ private void exec_computePositionFromRotation(TriParameterList parameterList, TriParameter returnValue) {
+
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ IntegerValue refLatitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ refLatitude.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(1).getEncodedParameter();
+ IntegerValue refLongitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ refLongitude.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(2).getEncodedParameter();
+ IntegerValue cenLatitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ cenLatitude.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(3).getEncodedParameter();
+ IntegerValue cenLongitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ cenLongitude.setInteger(ByteHelper.byteArrayToInt(value));
+
+ value = parameterList.get(4).getEncodedParameter();
+ IntegerValue rotation = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ rotation.setInteger(ByteHelper.byteArrayToInt(value));
+
+ IntegerValue latitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ IntegerValue longitude = (IntegerValue)TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+ _extfuncsImpl.fx_computePositionFromRotation(refLatitude, refLongitude, cenLatitude, cenLongitude, rotation, latitude, longitude);
+
+ TriParameter param = parameterList.get(5);
+ param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ param.setNumberOfBits(Integer.SIZE);
+ param.setEncodedParameter(ByteHelper.intToByteArray(latitude.getInteger(), Integer.SIZE / Byte.SIZE));
+
+ param = parameterList.get(6);
+ param.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ param.setNumberOfBits(Integer.SIZE);
+ param.setEncodedParameter(ByteHelper.intToByteArray(longitude.getInteger(), Integer.SIZE / Byte.SIZE));
+
+ }
+
+ private void exec_computeGnTimestamp(TriParameter returnValue) {
+
+ // Execute the function
+ IntegerValue timestamp = _extfuncsImpl.fx_computeGnTimestamp();
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Integer.SIZE);
+ returnValue.setEncodedParameter(
+ ByteHelper.intToByteArray(
+ timestamp.getInteger(),
+ Integer.SIZE / Byte.SIZE
+ ));
+
+ } // End of method exec_computeGnTimestamp
+
+ private void exec_getCurrentTime(TriParameter returnValue) {
+
+ // Execute the function
+ IntegerValue time = _extfuncsImpl.fx_getCurrentTime();
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Long.SIZE);
+ returnValue.setEncodedParameter(
+ ByteHelper.longToByteArray(
+// ((IntegerValueEx)time).getInt64() << 6, // Decoding starts from bit 0, byte 0, so we have to shift the value 6 bits to the left
+ // 6/*Long.SIZE / Byte.SIZE*/ // Encoding on 48 bits
+ ((IntegerValueEx)time).getInt64(),
+ Long.SIZE / Byte.SIZE
+ ));
+
+ } // End of method exec_getCurrentTime
+
+ private void exec_getCurrentTimeMark(TriParameter returnValue) {
+
+ // Execute the function
+ IntegerValue time = _extfuncsImpl.fx_getCurrentTimeMark();
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Long.SIZE);
+ returnValue.setEncodedParameter(
+ ByteHelper.longToByteArray(
+ ((IntegerValueEx)time).getInt64(),
+ 4/*Integer.SIZE / Byte.SIZE*/ // Encoding on 32 bits
+ ));
+
+ } // End of method exec_getCurrentTimeMark
+
+ private void exec_getMinuteOfTheYear(TriParameter returnValue) {
+
+ // Execute the function
+ IntegerValue time = _extfuncsImpl.fx_getMinuteOfTheYear();
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Long.SIZE);
+ returnValue.setEncodedParameter(
+ ByteHelper.longToByteArray(
+ ((IntegerValueEx)time).getInt64(),
+ 2/*Short.SIZE / Byte.SIZE*/ // Encoding on 16 bits
+ ));
+
+ } // End of method exec_getMinuteOfTheYear
+
+ private void exec_getDSecond(TriParameter returnValue) {
+
+ // Execute the function
+ IntegerValue time = _extfuncsImpl.fx_getDSecond();
+ //_logger.info(String.format("exec_getDSecond returns %d", ((IntegerValueEx)time).getInt64()));
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Long.SIZE);
+ returnValue.setEncodedParameter(
+ ByteHelper.longToByteArray(
+ ((IntegerValueEx)time).getInt64(),
+ 2/*Short.SIZE / Byte.SIZE*/ // Encoding on 16 bits
+ ));
+
+ } // End of method exec_getDSecond
+
+ private void exec_generateKeyPair(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Execute the function
+ OctetstringValue privateKey = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ OctetstringValue publicKeyX = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ OctetstringValue publicKeyY = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ BooleanValue result = _extfuncsImpl.fx_generateKeyPair(privateKey, publicKeyX, publicKeyY);
+ // privateKey
+ TriParameter Key = parameterList.get(0);
+ Key.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ byte[] ref = new byte[privateKey.getLength()];
+ for (int i = 0; i < ref.length; i++) {
+ ref[i] = (byte) privateKey.getOctet(i);
+ } // End 'for' statement
+ Key.setEncodedParameter(ref);
+ // publicKeyX
+ Key = parameterList.get(1);
+ Key.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ Key.setNumberOfBits(publicKeyX.getLength() * Byte.SIZE);
+ ref = new byte[publicKeyX.getLength()];
+ for (int i = 0; i < ref.length; i++) {
+ ref[i] = (byte) publicKeyX.getOctet(i);
+ } // End 'for' statement
+ Key.setEncodedParameter(ref);
+ // publicKeyY
+ Key = parameterList.get(2);
+ Key.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ Key.setNumberOfBits(publicKeyY.getLength() * Byte.SIZE);
+ ref = new byte[publicKeyY.getLength()];
+ for (int i = 0; i < ref.length; i++) {
+ ref[i] = (byte) publicKeyY.getOctet(i);
+ } // End 'for' statement
+ Key.setEncodedParameter(ref);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) } );
+
+ } // End of method exec_generateKeyPair
+
+ private void exec_verifyWithEcdsaNistp256WithSha256(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Execute the function
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ OctetstringValue toBeVerifiedData = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ toBeVerifiedData.setLength(value.length);
+ for (int i = 0; i < toBeVerifiedData.getLength(); i++) {
+ toBeVerifiedData.setOctet(i, value[i]);
+ } // End 'for' statement
+ value = parameterList.get(1).getEncodedParameter();
+ OctetstringValue signature = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ signature.setLength(value.length);
+ for (int i = 0; i < signature.getLength(); i++) {
+ signature.setOctet(i, value[i]);
+ } // End 'for' statement
+ value = parameterList.get(2).getEncodedParameter();
+ OctetstringValue ecdsaNistp256PublicKeyX = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ ecdsaNistp256PublicKeyX.setLength(value.length);
+ for (int i = 0; i < ecdsaNistp256PublicKeyX.getLength(); i++) {
+ ecdsaNistp256PublicKeyX.setOctet(i, value[i]);
+ } // End 'for' statement
+ value = parameterList.get(3).getEncodedParameter();
+ OctetstringValue ecdsaNistp256PublicKeyY = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ ecdsaNistp256PublicKeyY.setLength(value.length);
+ for (int i = 0; i < ecdsaNistp256PublicKeyY.getLength(); i++) {
+ ecdsaNistp256PublicKeyY.setOctet(i, value[i]);
+ } // End 'for' statement
+ BooleanValue result = _extfuncsImpl.fx_verifyWithEcdsaNistp256WithSha256(toBeVerifiedData, signature, ecdsaNistp256PublicKeyX, ecdsaNistp256PublicKeyY);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) } );
+
+ } // End of method exec_fx_verifyWithEcdsaNistp256WithSha256
+
+ private void exec_signWithEcdsaNistp256WithSha256(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Execute the function
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ OctetstringValue toBeSignedData = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ toBeSignedData.setLength(value.length);
+ for (int i = 0; i < toBeSignedData.getLength(); i++) {
+ toBeSignedData.setOctet(i, value[i]);
+ } // End 'for' statement
+ value = parameterList.get(1).getEncodedParameter();
+ OctetstringValue privateKey = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ privateKey.setLength(value.length);
+ for (int i = 0; i < privateKey.getLength(); i++) {
+ privateKey.setOctet(i, value[i]);
+ } // End 'for' statement
+// IntegerValueEx privateKey = (IntegerValueEx) TciProvider.getInstance().getTciCDRequired().getInteger().newInstance();
+// privateKey.setInt64(ByteHelper.byteArrayToLong(value));
+ OctetstringValue result = _extfuncsImpl.fx_signWithEcdsaNistp256WithSha256(toBeSignedData, privateKey);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(result.getLength() * Byte.SIZE);
+ value = new byte[result.getLength()];
+ for (int i = 0; i < value.length; i++) {
+ value[i] = (byte) result.getOctet(i);
+ } // End 'for' statement
+ returnValue.setEncodedParameter(value);
+
+ } // End of method exec_signWithEcdsaNistp256WithSha256
+
+ private void exec_hashWithSha256(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Execute the function
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ OctetstringValue toBeHashedData = (OctetstringValue) TciProvider.getInstance().getTciCDRequired().getOctetstring().newInstance();
+ toBeHashedData.setLength(value.length);
+ for (int i = 0; i < toBeHashedData.getLength(); i++) {
+ toBeHashedData.setOctet(i, value[i]);
+ } // End 'for' statement
+ OctetstringValue result = _extfuncsImpl.fx_hashWithSha256(toBeHashedData);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(result.getLength() * Byte.SIZE);
+ value = new byte[result.getLength()];
+ for (int i = 0; i < value.length; i++) {
+ value[i] = (byte) result.getOctet(i);
+ } // End 'for' statement
+ returnValue.setEncodedParameter(value);
+
+ } // End of method exec_hashWithSha256
+
+ private void exec_dms2dd(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Prepare arguments
+ ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
+ IntegerValue degrees = wrapper.setInteger(new BigInteger(parameterList.get(0).getEncodedParameter()));
+ IntegerValue minutes = wrapper.setInteger(new BigInteger(parameterList.get(1).getEncodedParameter()));
+ FloatValue seconds = wrapper.getFloat();
+ seconds.setFloat(ByteHelper.byteArrayToFloat(parameterList.get(2).getEncodedParameter()));
+ OctetstringValue latlon = wrapper.getOctetstring();
+ latlon.setLength(1);
+ latlon.setOctet(0, parameterList.get(3).getEncodedParameter()[0]);
+ FloatValue result = _extfuncsImpl.fx_dms2dd(degrees, minutes, seconds, latlon);
+
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Float.SIZE);
+ returnValue.setEncodedParameter(ByteHelper.floatToByteArray(result.getFloat()));
+
+ } // End of method exec_dms2dd
+
+ private void exec_isValidPolygonalRegion(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode region parameter
+ ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
+ RecordOfValue region = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ byte length = value[0];
+ int offset = 1;
+ while (offset < length) { // TODO Create a method to fill PolygonRegions
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
+ twoDLocation.setField("latitude", wrapper.setInteger(latitude));
+ twoDLocation.setField("longitude", wrapper.setInteger(longitude));
+ }
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_isValidPolygonalRegion(region);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_isValidPolygonalRegion
+
+ private void exec_isPolygonalRegionInside(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode parent parameter
+ // Execute the function
+ ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
+ RecordOfValue parent = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ byte length = value[0];
+ int offset = 1;
+ while (offset < length) { // TODO Create a method to fill PolygonRegions
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
+ twoDLocation.setField("latitude", wrapper.setInteger(latitude));
+ twoDLocation.setField("longitude", wrapper.setInteger(longitude));
+ parent.appendField(twoDLocation);
+ } // End of 'while' statement
+ // Decode region parameter
+ RecordOfValue region = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
+ value = ByteHelper.extract(parameterList.get(0).getEncodedParameter(), offset, parameterList.get(0).getEncodedParameter().length - offset);
+ length = value[0];
+ offset = 1;
+ while (offset < length) { // TODO Create a method to fill PolygonRegions
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
+ twoDLocation.setField("latitude", wrapper.setInteger(latitude));
+ twoDLocation.setField("longitude", wrapper.setInteger(longitude));
+ region.appendField(twoDLocation);
+ } // End of 'while' statement
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_isPolygonalRegionInside(parent, region);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_isPolygonalRegionInside
+
+ private void exec_isLocationInsideCircularRegion(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode rectangularRegions parameter
+ ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ int offset = 0;
+ // Center
+ RecordValue center = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ center.setField("latitude", wrapper.setInteger(latitude));
+ center.setField("longitude", wrapper.setInteger(longitude));
+
+ // Radius
+ int radius = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
+
+ RecordValue circularRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.CircularRegion");
+ circularRegion.setField("center", center);
+ circularRegion.setField("radius", wrapper.setInteger(radius));
+ // Decode location parameter
+ value = parameterList.get(1).getEncodedParameter();
+ offset = 0;
+ // WGS84 Latitude
+ latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
+ location.setField("latitude", wrapper.setInteger(latitude));
+ location.setField("longitude", wrapper.setInteger(longitude));
+ OctetstringValue elevation = wrapper.getOctetstring();
+ elevation.setLength(2);
+ elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
+ location.setField("elevation", elevation);
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_isLocationInsideCircularRegion(circularRegion, location);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_isLocationInsideCircularRegion
+
+ private void exec_isLocationInsideRectangularRegion(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode rectangularRegions parameter
+ ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
+ RecordOfValue rectangularRegions = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.RectangularRegions");
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ byte length = value[0];
+ int offset = 1;
+ while (offset < length) { // TODO Create a method to fill RectangularRegions
+ // northwest
+ RecordValue northwest = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ northwest.setField("latitude", wrapper.setInteger(latitude));
+ northwest.setField("longitude", wrapper.setInteger(longitude));
+
+ // southeast
+ RecordValue southeast = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
+ // WGS84 Latitude
+ latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ southeast.setField("latitude", wrapper.setInteger(latitude));
+ southeast.setField("longitude", wrapper.setInteger(longitude));
+
+ RecordValue rectangularRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.RectangularRegion");
+ rectangularRegion.setField("northwest", northwest);
+ rectangularRegion.setField("southeast", southeast);
+
+ rectangularRegions.appendField(rectangularRegion);
+ } // End of 'while' statement
+ // Decode location parameter
+// ByteHelper.dump("exec_isLocationInsidePolygonalRegion: ", parameterList.get(1).getEncodedParameter());
+ value = parameterList.get(1).getEncodedParameter();
+ offset = 0;
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
+ location.setField("latitude", wrapper.setInteger(latitude));
+ location.setField("longitude", wrapper.setInteger(longitude));
+ OctetstringValue elevation = wrapper.getOctetstring();
+ elevation.setLength(2);
+ elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
+ location.setField("elevation", elevation);
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_isLocationInsideRectangularRegion(rectangularRegions, location);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_isLocationInsideRectangularRegion
+
+ private void exec_isLocationInsidePolygonalRegion(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Execute the function
+ ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
+ RecordOfValue polygonalArea = wrapper.getRecordOfValue("LibItsSecurity_TypesAndValues.PolygonalRegion");
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ byte length = value[0];
+ int offset = 1;
+ while (offset < length) { // TODO Create a method to fill PolygonRegions
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ RecordValue twoDLocation = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.TwoDLocation");
+ twoDLocation.setField("latitude", wrapper.setInteger(latitude));
+ twoDLocation.setField("longitude", wrapper.setInteger(longitude));
+ polygonalArea.appendField(twoDLocation);
+ } // End of 'while' statement
+// ByteHelper.dump("exec_isLocationInsidePolygonalRegion: ", parameterList.get(1).getEncodedParameter());
+ value = parameterList.get(1).getEncodedParameter();
+ offset = 0;
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
+ location.setField("latitude", wrapper.setInteger(latitude));
+ location.setField("longitude", wrapper.setInteger(longitude));
+ OctetstringValue elevation = wrapper.getOctetstring();
+ elevation.setLength(2);
+ elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
+ location.setField("elevation", elevation);
+ BooleanValue result = _extfuncsImpl.fx_isLocationInsidePolygonalRegion(polygonalArea, location);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_isLocationInsidePolygonalRegion
+
+ private void exec_isLocationInsideIdentifiedRegion(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode rectangularRegions parameter
+ ITciCDWrapper wrapper = TciCDWrapperFactory.getTciCDInstance();
+ byte[] value = parameterList.get(0).getEncodedParameter();
+ int offset = 0;
+ // RegionDictionary
+ EnumeratedValue region_dictionary = wrapper.getEnumValue("LibItsSecurity_TypesAndValues.RegionDictionary");
+ region_dictionary.setInt(value[offset++]);
+ // region_identifier
+ int region_identifier = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
+ offset += Short.SIZE / Byte.SIZE;
+ // local_region
+ int local_region;
+ if ((value[offset] & 0x80) == 0x00) { // One byte length
+ local_region = value[offset];
+ } else {
+ // TODO Process it as IntX, not as 4 bytes integer
+ value[offset] &= 0x7f;
+ local_region = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Short.SIZE / Byte.SIZE));
+ }
+ RecordValue identifiedRegion = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.IdentifiedRegion");
+ identifiedRegion.setField("region_dictionary", region_dictionary);
+ identifiedRegion.setField("region_identifier", wrapper.setInteger(region_identifier));
+ identifiedRegion.setField("local_region", wrapper.setInteger(local_region));
+
+ // Decode location parameter
+ value = parameterList.get(1).getEncodedParameter();
+ offset = 0;
+ // WGS84 Latitude
+ int latitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ // WGS84 Longitude
+ int longitude = ByteHelper.byteArrayToInt(ByteHelper.extract(value, offset, Integer.SIZE / Byte.SIZE));
+ offset += Integer.SIZE / Byte.SIZE;
+ RecordValue location = wrapper.getRecordValue("LibItsSecurity_TypesAndValues.ThreeDLocation");
+ location.setField("latitude", wrapper.setInteger(latitude));
+ location.setField("longitude", wrapper.setInteger(longitude));
+ OctetstringValue elevation = wrapper.getOctetstring();
+ elevation.setLength(2);
+ elevation.setOctet(0, 0x00); elevation.setOctet(1, 0x00);
+ location.setField("elevation", elevation);
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_isLocationInsideIdentifiedRegion(identifiedRegion, location);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_isLocationInsideIdentifiedRegion
+
+ private void exec_loadCertificates(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode parameter
+ CharstringValue rootDirectory = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
+ String str = new String(parameterList.get(0).getEncodedParameter());
+ rootDirectory.setString(str);
+
+ CharstringValue configId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
+ str = new String(parameterList.get(1).getEncodedParameter());
+ configId.setString(str);
+
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_loadCertificates(rootDirectory, configId);
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_parseIpv6Address
+
+ private void exec_unloadCertificates(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_unloadCertificates();
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_parseIpv6Address
+
+ private void exec_readCertificate(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode parameter
+ CharstringValue certificateId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
+ String str = new String(parameterList.get(0).getEncodedParameter());
+ certificateId.setString(str);
+
+ OctetstringValue certificate = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
+
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_readCertificate(certificateId, certificate);
+
+ parameterList.get(1).setNumberOfBits(certificate.getLength() * Byte.SIZE);
+ byte[] value = new byte[certificate.getLength()];
+ for (int i = 0; i < value.length; i++) {
+ value[i] = (byte) certificate.getOctet(i);
+ }// End of 'for'statement
+ parameterList.get(1).setEncodedParameter(value);
+
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_parseIpv6Address
+
+ private void exec_readCertificateDigest(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode parameter
+ CharstringValue certificateId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
+ String str = new String(parameterList.get(0).getEncodedParameter());
+ certificateId.setString(str);
+
+ OctetstringValue digest = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
+
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_readCertificateDigest(certificateId, digest);
+
+ parameterList.get(1).setNumberOfBits(digest.getLength() * Byte.SIZE);
+ byte[] value = new byte[digest.getLength()];
+ for (int i = 0; i < value.length; i++) {
+ value[i] = (byte) digest.getOctet(i);
+ }// End of 'for'statement
+ parameterList.get(1).setEncodedParameter(value);
+
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_readCertificateDigest
+
+ private void exec_readSigningKey(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode parameter
+ CharstringValue keysId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
+ String str = new String(parameterList.get(0).getEncodedParameter());
+ keysId.setString(str);
+
+ OctetstringValue privateKey = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
+
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_readSigningKey(keysId, privateKey);
+
+ parameterList.get(1).setNumberOfBits(privateKey.getLength() * Byte.SIZE);
+ byte[] value = new byte[privateKey.getLength()];
+ for (int i = 0; i < value.length; i++) {
+ value[i] = (byte) privateKey.getOctet(i);
+ }// End of 'for'statement
+ parameterList.get(1).setEncodedParameter(value);
+
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_readSigningKeys
+
+ private void exec_readEncryptingKey(TriParameterList parameterList, TriParameter returnValue) {
+
+ // Decode parameter
+ CharstringValue keysId = TciCDWrapperFactory.getTciCDInstance().getCharstringValue();
+ String str = new String(parameterList.get(0).getEncodedParameter());
+ keysId.setString(str);
+
+ OctetstringValue privateKey = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
+
+ // Execute the function
+ BooleanValue result = _extfuncsImpl.fx_readEncryptingKey(keysId, privateKey);
+
+ parameterList.get(1).setNumberOfBits(privateKey.getLength() * Byte.SIZE);
+ byte[] value = new byte[privateKey.getLength()];
+ for (int i = 0; i < value.length; i++) {
+ value[i] = (byte) privateKey.getOctet(i);
+ }// End of 'for'statement
+ parameterList.get(1).setEncodedParameter(value);
+
+ // Return code
+ returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
+ returnValue.setNumberOfBits(Byte.SIZE);
+ returnValue.setEncodedParameter(new byte[] { (byte)((result.getBoolean() == true) ? 0x01 : 0x00) });
+
+ } // End of method exec_readSigningKeys
+
+ private void exec_parseIpv6Address(TriParameterList parameterList, TriParameter returnValue) {
+
+ } // End of method exec_parseIpv6Address
+
+ @Override
+ public TriStatus triBeginWait(long arg0, TriComponentId arg1) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triNextSampling(long arg0, TriPortId arg1) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triReadClock(TriLong arg0) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triStartClock(long arg0) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public void triSAErrorReq(String arg0) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triGetStreamValue(TriComponentId arg0, TriPortId arg1, TriAddress arg2, TriMessage arg3) {
+ throw new RuntimeException();
+ }
+
+ @Override
+ public TriStatus triSetStreamValue(TriComponentId arg0, TriPortId arg1, TriAddress arg2, TriMessage arg3) {
+ throw new RuntimeException();
+ }
+
+} // End of class PluginAdapter
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TeRequiredImpl.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TeRequiredImpl.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TeRequiredImpl.java (revision 2745)
@@ -0,0 +1,148 @@
+/**
+ * @author STF 424_ITS_Test_Platform
+ * @version $id$
+ */
+package org.etsi.ttcn.tool.elvior.adapter;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+import org.elvior.ttcn.tritci.TriFactory;
+import org.elvior.ttcn.tritci.TriProvider;
+import org.etsi.ttcn.adapter.core.ITERequired;
+import org.etsi.ttcn.tci.CharstringValue;
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriAddress;
+import org.etsi.ttcn.tri.TriCommunicationTE;
+import org.etsi.ttcn.tri.TriMessage;
+import org.etsi.ttcn.tri.TriStatus;
+
+public class TeRequiredImpl implements ITERequired {
+
+ TriFactory _factory = TriProvider.getInstance().getTriFactory();
+
+// private TriTciChannel _tciFactory = TriTciChannel.getInstance();
+
+ private final PluginAdapter _ta;
+
+ private static Properties _properties = new Properties();
+
+ protected final static Logger _logger = Logger.getLogger("org.etsi.its");
+
+ public TeRequiredImpl(PluginAdapter ta) {
+ _ta = ta;
+ // Load TA settings
+ try {
+ _properties.load(new FileInputStream("./etc/ta.properties"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public TriCommunicationTE getCommunicationTE() {
+ return (TriCommunicationTE)_ta;
+ }
+
+ /**
+ * @desc Retrieve TA settings from external file
+ * It does not work with TestcatT3 because of TCI is only available during test case execution (from triExecuteTestCase method call till triEndTestCase method call)
+ */
+ @Override
+ public Value getTaParameter(String param) {
+ CharstringValue string = new CharstringValue() {
+ private String _value = "";
+ @Override
+ public boolean notPresent() {
+ return _value.isEmpty();
+ }
+
+ @Override
+ public String getValueEncodingVariant() {
+ return null;
+ }
+
+ @Override
+ public String getValueEncoding() {
+ return null;
+ }
+
+ @Override
+ public Type getType() {
+ return null;
+ }
+
+ @Override
+ public void setString(String value) {
+ _value = value;
+ }
+
+ @Override
+ public void setLength(int length) {
+ }
+
+ @Override
+ public void setChar(int index, char arg1) {
+ }
+
+ @Override
+ public String getString() {
+ return _value;
+ }
+
+ @Override
+ public int getLength() {
+ return _value.length();
+ }
+
+ @Override
+ public char getChar(int index) {
+ return _value.charAt(index);
+ }
+ };
+ string.setString(_properties.getProperty(param, ""));
+
+ return string;
+ }
+
+ @Override
+ public TriAddress getTriAddress(byte[] message) {
+ TriAddress address = _factory.createAddress();
+ address.setEncodedAddress(message);
+ return address;
+ }
+
+ @Override
+ public TriMessage getTriMessage(byte[] message) {
+ TriMessage msg = _factory.createMessage();
+ msg.setEncodedMessage(message);
+ msg.setNumberOfBits(message.length * Byte.SIZE);
+ return msg;
+ }
+
+ @Override
+ public TriStatus getTriStatus(int statusCode) {
+ TriStatus status = _factory.createErrorStatus();
+ status.setStatus(statusCode);
+ return status;
+ }
+
+ @Override
+ public TriStatus getTriStatus(int statusCode, String message) {
+ return getTriStatus(statusCode);
+ }
+
+ @Override
+ public void logDebug(String debugMessage) {
+ _logger.info(debugMessage);
+ }
+
+ @Override
+ public void logError(String errorMessage) {
+ _logger.severe(errorMessage);
+ }
+
+} // End of class TeRequiredImpl
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TestAdapter.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TestAdapter.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TestAdapter.java (revision 2745)
@@ -0,0 +1,5 @@
+package org.etsi.ttcn.tool.elvior.adapter;
+
+public class TestAdapter extends org.etsi.ttcn.adapter.core.TestAdapter {
+
+}
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TestAdapter.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TestAdapterMain.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TestAdapterMain.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/adapter/TestAdapterMain.java (revision 2745)
@@ -0,0 +1,18 @@
+/**
+ * @author STF 424_ITS_Test_Platform
+ * @version $id$
+ */
+package org.etsi.ttcn.tool.elvior.adapter;
+
+public class TestAdapterMain {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ PluginAdapter adapter = new PluginAdapter();
+ adapter.run();
+ System.exit(0);
+ }
+
+} //End of class Main
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/BuiltInCodec.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/BuiltInCodec.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/BuiltInCodec.java (revision 2745)
@@ -0,0 +1,154 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.elvior.ttcn.tritci.TciProvider;
+import org.elvior.ttcn.tritci.TriMessageEx;
+import org.elvior.ttcn.tritci.TriProvider;
+import org.etsi.common.ByteHelper;
+import org.etsi.ttcn.tci.RecordValue;
+import org.etsi.ttcn.tci.TciCDProvided;
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class BuiltInCodec implements TciCDProvided {
+
+ /**
+ * Logger instance
+ */
+ protected final static Logger _logger = Logger.getLogger("org.etsi.its");
+
+ private String _encodingName;
+
+ /**
+ * Constructor
+ */
+ public BuiltInCodec(final String encodingName) {
+
+ if (encodingName.equals("LibItsDenm_asn1")) {
+ _encodingName = "DENM_PDU_Descriptions";
+ } else if (encodingName.equals("LibItsCam_asn1")) {
+ _encodingName = "CAM_PDU_Descriptions";
+ } else if (encodingName.equals("LibItsMapemSpatem_asn1")) {
+ _encodingName = "MAPEM_SPATEM_ETSI";
+ } else if (encodingName.equals("LibItsIvim_asn1")) {
+ _encodingName = "IVIM_PDU_Descriptions";
+ } else if (encodingName.equals("LibItsEvcsn_asn1")) {
+ _encodingName = "EVCSN_PDU_Descriptions";
+ } else if (encodingName.equals("LibItsSremSsem_asn1")) {
+ _encodingName = "SREM_SSEM_ETSI";
+ } else if (encodingName.equals("LibItsCALMmsap_asn1")) {
+ _encodingName = "CALMmsap";
+ } else if (encodingName.equals("LibItsCALMllsap_asn1")) {
+ _encodingName = "CALMllsap";
+ } else if (encodingName.equals("LibItsFntp_asn1")) {
+ _encodingName = "CALMfntp";
+ } else if (encodingName.equals("LibItsFsap_asn1")) {
+ _encodingName = "CALMfsap";
+ } else if (encodingName.equals("LibItsIicp_asn1")) {
+ _encodingName = "CALMiitsscu";
+ } else {
+ _encodingName = "";
+ }
+ }
+
+ /**
+ * This operation decodes message according to the encoding rules and returns a TTCN-3 value.
+ * The decodingHypothesis shall be used to determine whether the encoded value can be decoded.
+ * If an encoding rule is not self-sufficient, i.e. if the encoded message does not inherently
+ * contain its type decodingHypothesis shall be used. If the encoded value can be decoded without
+ * the decoding hypothesis, the distinct null value shall be returned if the type determined from
+ * the encoded message is not compatible with the decoding hypothesis
+ *
+ * @param message The encoded message to be decoded
+ * @param decodingHypothesis The hypothesis the decoding can be based on
+ * @return Returns the decoded value, if the value is of a compatible type as the decodingHypothesis, else the distinct value null
+ *
+ * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.2.1 decode
+ */
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ TriMessageEx msg = TriProvider.getInstance().getTriFactory().createMessageEx();
+ msg.setEncodedMessage(message.getEncodedMessage());
+
+ String type = String.format("%s.%s", _encodingName, decodingHypothesis.getName());
+ Type asnOriginalType = getTypeForName(type);
+ // Check which type class the decoding hypothesis is of
+ Value value = TciProvider.getInstance().getSystemInterface().internalDecode(msg, asnOriginalType);
+
+ return value;
+ }
+
+ @Override
+ public TriMessage encode(final Value template) {
+
+ RecordValue asn1Value = (RecordValue)template;
+ String type = String.format("%s.%s", _encodingName, template.getType().getName());
+ Type asnOriginalType = getTypeForName(type);
+ if (asnOriginalType != null) {
+ RecordValue internalASNEncodecValue = (RecordValue)asnOriginalType.newInstance();
+ String[] fields = internalASNEncodecValue.getFieldNames();
+ for(String field: fields) {
+ Value fieldValue = asn1Value.getField(field);
+ if(fieldValue.notPresent()) {
+ internalASNEncodecValue.setFieldOmitted(field);
+ } else {
+ internalASNEncodecValue.setField(field, fieldValue);
+ }
+ } // End of 'for' statement
+ TriMessage msg = TciProvider.getInstance().getSystemInterface().internalEncode(internalASNEncodecValue);
+ ByteHelper.dump("BuiltInCodec.encode: ", msg.getEncodedMessage());
+ return msg;
+ }
+
+ return null;
+ }
+
+ private Type getTypeForName(final String type) {
+
+ Type asnOriginalType = TciProvider.getInstance().getTciCDRequired().getTypeForName(type);
+ if (asnOriginalType == null) { // Failed with default mechanism, try with External Attributes mechanism
+// type = decodingHypothesis.getName(); //FIXME External Attributes mechanism does not work
+ String type_ = "";
+ if (type.endsWith("nfSapPrimitivesUp")) {
+ type_ = String.format("%s.%s", _encodingName, "NFsapPrimitivesUp");
+ } else if (type.endsWith("faSapPrimitivesUp")) {
+ type_ = String.format("%s.%s", _encodingName, "FAsapPrimitivesUp");
+ } else if (type.endsWith("mnRequestRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MN_Request_request");
+ } else if (type.endsWith("mfCommandRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MF_Command_request");
+ } else if (type.endsWith("miCommandRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Command_request");
+ } else if (type.endsWith("miCommandConfirm")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Command_confirm");
+ } else if (type.endsWith("miRequestRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Request_request");
+ } else if (type.endsWith("miRequestConfirm")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Request_confirm");
+ } else if (type.endsWith("miSetRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Set_request");
+ } else if (type.endsWith("miSetConfirm")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Set_confirm");
+ } else if (type.endsWith("miGetRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Get_request");
+ } else if (type.endsWith("miGetConfirm")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Get_confirm");
+ } if (type.endsWith("fntpNPDU")) {
+ type_ = String.format("%s.%s", _encodingName, "INsapPrimitivesUp");
+ }
+ asnOriginalType = TciProvider.getInstance().getTciCDRequired().getTypeForName(type_);
+ }
+
+ return asnOriginalType;
+ } // End of method getTypeForName
+
+} // End of class BuiltInCodec
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/BuiltInCodec.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/CodecMain.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/CodecMain.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/CodecMain.java (revision 2745)
@@ -0,0 +1,18 @@
+/**
+ * @author STF 424_ITS_Test_Platform
+ * @version $id$
+ */
+package org.etsi.ttcn.tool.elvior.codec;
+
+public class CodecMain {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ Its_CodecProvider app = new Its_CodecProvider();
+ app.run();
+ System.exit(0);
+ }
+
+} // End of class MainCodec
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/GetValueStructure.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/GetValueStructure.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/GetValueStructure.java (revision 2745)
@@ -0,0 +1,120 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.elvior.ttcn.tritci.IntegerValueEx;
+import org.etsi.ttcn.tci.BitstringValue;
+import org.etsi.ttcn.tci.BooleanValue;
+import org.etsi.ttcn.tci.CharstringValue;
+import org.etsi.ttcn.tci.EnumeratedValue;
+import org.etsi.ttcn.tci.FloatValue;
+import org.etsi.ttcn.tci.HexstringValue;
+import org.etsi.ttcn.tci.OctetstringValue;
+import org.etsi.ttcn.tci.RecordOfValue;
+import org.etsi.ttcn.tci.RecordValue;
+import org.etsi.ttcn.tci.TciTypeClass;
+import org.etsi.ttcn.tci.UnionValue;
+import org.etsi.ttcn.tci.Value;
+
+public class GetValueStructure {
+
+ static String indent = null;
+ static StringBuilder buffer = null;
+
+ static public void displayValueStructure(final Value value) {
+ buffer = new StringBuilder();
+ indent = "";
+ LogValueDataStructure(value);
+ }
+
+ static public String getValueStructure(final Value value) {
+ buffer = new StringBuilder();
+ indent = "";
+ LogValueDataStructure(value);
+ return buffer.toString();
+ }
+
+ static private void LogValueDataStructure(final Value value) {
+ if (value.notPresent()) {
+ buffer.append(indent + value.getClass().getName() + " : omitted" + "\n");
+ return;
+ }
+ switch (value.getType().getTypeClass()) {
+ case TciTypeClass.BOOLEAN: {
+ BooleanValue bv = (BooleanValue)value;
+ buffer.append(indent + bv.getClass().getName() + " : " + new java.lang.Boolean(bv.getBoolean()) + " - encode : " + bv.getValueEncoding() + " - variant : " + bv.getValueEncodingVariant() + "\n");
+ }
+ break;
+ case TciTypeClass.INTEGER: {
+ IntegerValueEx iv = (IntegerValueEx)value;
+ buffer.append(indent + iv.getClass().getName() + " : " + iv.getInt64() + " - encode : " + iv.getValueEncoding() + " - variant : " + iv.getValueEncodingVariant() + "\n");
+ }
+ break;
+ case TciTypeClass.FLOAT: {
+ FloatValue fv = (FloatValue)value;
+ buffer.append(indent + fv.getClass().getName() + " : " + fv.getFloat() + " - encode : " + fv.getValueEncoding() + " - variant : " + fv.getValueEncodingVariant() + "\n");
+ }
+ break;
+ case TciTypeClass.CHARSTRING: {
+ CharstringValue csv = (CharstringValue)value;
+ buffer.append(indent + csv.getClass().getName() + " : " + csv.getString() + " - encode : " + csv.getValueEncoding() + " - variant : " + csv.getValueEncodingVariant() + "\n");
+ }
+ break;
+ case TciTypeClass.BITSTRING: {
+ BitstringValue bv = (BitstringValue)value;
+ buffer.append(indent + bv.getClass().getName() + " : " + bv.getString() + " - encode : " + bv.getValueEncoding() + " - variant : " + bv.getValueEncodingVariant() + "\n");
+ }
+ break;
+ case TciTypeClass.OCTETSTRING: {
+ OctetstringValue ov = (OctetstringValue)value;
+ buffer.append(indent + ov.getClass().getName() + " : " + ov.getString() + " - encode : " + ov.getValueEncoding() + " - variant : " + ov.getValueEncodingVariant() + "\n");
+ }
+ break;
+ case TciTypeClass.HEXSTRING: {
+ HexstringValue hv = (HexstringValue)value;
+ buffer.append(indent + hv.getClass().getName() + " : " + hv.getString() + " - encode : " + hv.getValueEncoding() + " - variant : " + hv.getValueEncodingVariant() + "\n");
+ }
+ break;
+ case TciTypeClass.ENUMERATED: {
+ EnumeratedValue ev = (EnumeratedValue)value;
+ buffer.append(indent + ev.getClass().getName() + " : " + ev.getEnum() + " - encode : " + ev.getValueEncoding() + " - variant : " + ev.getValueEncodingVariant() + "\n");
+ }
+ break;
+ case TciTypeClass.SET:
+ // No break;
+ case TciTypeClass.RECORD: {
+ RecordValue rv = (RecordValue)value;
+ buffer.append(indent + rv.getClass().getName() + " - encode : " + rv.getValueEncoding() + " - variant : " + rv.getValueEncodingVariant() + "\n");
+ indent += "\t";
+ for (String key : rv.getFieldNames()) {
+ LogValueDataStructure(rv.getField(key));
+ } // End of 'for'statement
+ indent = indent.substring(0, indent.length() -1);
+ }
+ break;
+ case TciTypeClass.ANYTYPE:
+ // No break;
+ case TciTypeClass.UNION: {
+ UnionValue uv = (UnionValue)value;
+ buffer.append(indent + uv.getClass().getName() + " - encode : " + uv.getValueEncoding() + " - variant : " + uv.getValueEncodingVariant() + "\n");
+ indent += "\t";
+ LogValueDataStructure(uv.getVariant(uv.getPresentVariantName()));
+ indent = indent.substring(0, indent.length() -1);
+ }
+ break;
+ case TciTypeClass.RECORD_OF:
+ // No break;
+ case TciTypeClass.SET_OF: {
+ RecordOfValue rofv = (RecordOfValue)value;
+ buffer.append(indent + rofv.getClass().getName() + " - encode : " + rofv.getValueEncoding() + " : " + rofv.getLength() + " - variant : " + rofv.getValueEncodingVariant() + "\n");
+ indent += "\t";
+ for (int key = 0; key < rofv.getLength(); key++) {
+ LogValueDataStructure(rofv.getField(key));
+ } // End of 'for'statement
+ indent = indent.substring(0, indent.length() -1);
+ }
+ break;
+ default:
+ throw new RuntimeException("Unimplemented class type: " + value.getType().getTypeClass());
+ } // End of 'switch' value
+ }
+
+}
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/GetValueStructure.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/Its_CodecProvider.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/Its_CodecProvider.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/Its_CodecProvider.java (revision 2745)
@@ -0,0 +1,180 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.elvior.ttcn.tritci.ChannelEventHandler;
+import org.elvior.ttcn.tritci.TciProvider;
+import org.elvior.ttcn.tritci.TriTciChannel;
+import org.etsi.ttcn.codec.core.ITCIRequired;
+import org.etsi.ttcn.codec.core.ITciCDWrapper;
+import org.etsi.ttcn.codec.core.MainCodec;
+import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
+import org.etsi.ttcn.codec.core.CodecFactory;
+import org.etsi.ttcn.tci.TciCDProvided;
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+public class Its_CodecProvider implements TciCDProvided, ChannelEventHandler, ITCIRequired {
+
+ private static Properties _properties = new Properties();
+
+ private ITciCDWrapper _cdReq;
+
+ private CodecFactory _cf;
+
+ public Its_CodecProvider() {
+
+ // Load Codec settings
+ _cdReq = null;
+ _cf = null;
+ try {
+ _properties.load(CodecMain.class.getResourceAsStream("./codec.properties"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ // Register this object as the instance implementing the TCI-CD Provided interface
+ TciProvider.getInstance().setTciCDProvided(this);
+ TriTciChannel channel = TriTciChannel.getInstance();
+ // Set application name that will be displayed in the TestCast log
+ channel.setApplicationName("ItsCodec");
+ // Register this object as the receiver of events generated by TestCast framework
+ channel.setEventHandler(this);
+
+ initializeCodecs();
+ }
+
+ private void initializeCodecs() {
+ TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper());
+ _cdReq = TciCDWrapperFactory.getTciCDInstance();
+
+ // Register External codecs
+ _cf = CodecFactory.getInstance();
+ // TODO Reuse Build-in codec here
+
+ String[] asn1Codecs = _properties.getProperty("ASN.1Codecs", "").split(",");
+ for (String codec : asn1Codecs) {
+ String[] paths = _properties.getProperty(codec, "").split(",");
+ try {
+ _cf.setExternalCodec(paths[0], (TciCDProvided) Class.forName(paths[1]).newInstance());
+ } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ } // End of 'for' loop
+ try { // This comes with 'with encode () "UpperTester"' for all UtxxxTrigger/UtxxxUpdate messages
+ _cf.setExternalCodec("per-basic-unaligned:1997", LibIts_asn1.class.newInstance());
+ } catch (InstantiationException | IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ public void run() {
+
+ // Attempt to connect to TestCast
+ if (TriTciChannel.getInstance().open()) {
+ try {
+ synchronized(this) {
+ wait();
+ }
+ } catch (InterruptedException e) {
+ }
+ }
+
+ }
+
+ @Override
+ public void onConnectionClosed() {
+ synchronized(this) {
+ notify();
+ }
+ }
+
+ @Override
+ public void onConnectionEstablished() {
+ }
+
+ @Override
+ public void onError(String error) {
+ }
+
+ @Override
+ public Value decode(TriMessage message, Type decodingHypothesis) {
+ String encodingName = decodingHypothesis.getTypeEncoding();
+ if (encodingName != null) {
+ encodingName = decodingHypothesis.getDefiningModule().getModuleName();
+ } else { // Use basic codec
+ encodingName = "";
+ }
+ TciCDProvided codec = getCodec(encodingName);
+ if (codec == null) {
+ return null;
+ }
+ Value value = codec.decode(message, decodingHypothesis);
+ return value;
+ }
+
+ @Override
+ public TriMessage encode(Value value) {
+ String encodingName = value.getType().getTypeEncoding();
+ if ((encodingName != null) && !encodingName.startsWith("Lib")) {
+ encodingName = value.getType().getDefiningModule().getModuleName();
+ } else if (encodingName == null) { // Use basic codec
+ encodingName = "";
+ }
+ TciCDProvided codec = getCodec(encodingName);
+ if (codec == null) {
+ return null;
+ }
+ TriMessage res = codec.encode(value);
+ return res;
+ }
+
+ /**
+ * This method provides the codec associated to the specified encoding identifier
+ *
+ * @param rb TTwb Runtime reference
+ * @param encodingName The name of the encoding, specified by the TTCN-3 key words 'with/encode'
+ * @return The codec associated to the specified encoding identifier
+ */
+ @Override
+ public TciCDProvided getCodec(final String encodingName) {
+ // FIXME Remove argument here and in the interface ITCIRequired
+ return new Codec();
+ }
+
+ private class Codec implements TciCDProvided {
+
+ @Override
+ public Value decode(TriMessage message, Type decodingHypothesis) {
+
+ MainCodec codec = new MainCodec(_cdReq);
+ Value v = null;
+ try {
+ v = codec.triDecode(message, decodingHypothesis);
+ }
+ catch(Exception e) {
+ e.printStackTrace();
+ }
+ return v;
+ }
+
+ @Override
+ public TriMessage encode(Value value) {
+
+ MainCodec codec = new MainCodec(_cdReq);
+ TriMessage m = null;
+ try {
+ m = codec.triEncode(value);
+ }
+ catch(Exception e) {
+ e.printStackTrace();
+ }
+ return m;
+ }
+ }
+
+} // End of class Its_CodecProvider
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCALMllsap_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCALMllsap_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCALMllsap_asn1.java (revision 2745)
@@ -0,0 +1,28 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+
+public class LibItsCALMllsap_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsCALMllsap_asn1() {
+ _encodingName = "CALMllsap";
+ }
+
+ protected Type getTypeForName(final String type) {
+
+ String type_ = type;
+ if (type.endsWith("mnRequestRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MN_Request_request");
+ } else if (type.endsWith("msgIn_in")) {
+ type_ = String.format("%s.%s", _encodingName, "INsapPrimitivesDown");
+ }
+
+ Type asnOriginalType = super.getTypeForName(type_);
+
+ return asnOriginalType;
+ } // End of method getTypeForName
+
+} // End of class LibItsCALMllsap_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCALMllsap_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCALMmsap_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCALMmsap_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCALMmsap_asn1.java (revision 2745)
@@ -0,0 +1,38 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+
+public class LibItsCALMmsap_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsCALMmsap_asn1() {
+ _encodingName = "CALMmsap";
+ }
+
+ protected Type getTypeForName(final String type) {
+
+ String type_ = type;
+ if (type.endsWith("mfRequestRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MF_Request_request");
+ } else if (type.endsWith("mnRequestRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MN_Request_request");
+ } else if (type.endsWith("miRequestRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Request_request");
+ } else if (type.endsWith("mf_Command_request")) {
+ type_ = String.format("%s.%s", _encodingName, "MF_Command_request");
+ } else if (type.endsWith("mn_Command_request")) {
+ type_ = String.format("%s.%s", _encodingName, "MN_Command_request");
+ } else if (type.endsWith("mi_Command_request")) {
+ type_ = String.format("%s.%s", _encodingName, "MI_Command_request");
+ } else if (type.endsWith("faSapPrimitivesUp")) {
+ type_ = String.format("%s.%s", _encodingName, "FAsapPrimitivesUp");
+ }
+
+ Type asnOriginalType = super.getTypeForName(type_);
+
+ return asnOriginalType;
+ } // End of method getTypeForName
+
+} // End of class LibItsCALMmsap_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCALMmsap_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCam_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCam_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsCam_asn1.java (revision 2745)
@@ -0,0 +1,33 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class LibItsCam_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsCam_asn1() {
+ _encodingName = "CAM_PDU_Descriptions";
+ }
+
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ if (decodingHypothesis.getName().endsWith("camPacket")) {
+ Type type = getTypeForName("CAM_PDU_Descriptions.CAM");
+ return super.decode(message, type);
+ }
+
+ return super.decode(message, decodingHypothesis);
+ }
+
+} // End of class LibItsCam_asn1
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsContainer_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsContainer_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsContainer_asn1.java (revision 2745)
@@ -0,0 +1,44 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.elvior.ttcn.tritci.TriProvider;
+import org.etsi.common.ByteHelper;
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class LibItsContainer_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsContainer_asn1() {
+ _encodingName = "ITS_Container";
+ }
+
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ Value value = null;
+ if (decodingHypothesis.getName().equals("TimestampIts")) {
+ int ival = ByteHelper.byteArrayToInt(message.getEncodedMessage());
+ long lval = ((long)ival) << 6;
+ TriMessage msg = TriProvider.getInstance().getTriFactory().createMessage();
+ msg.setEncodedMessage(ByteHelper.longToByteArray(lval, 6));
+ value = super.decode(msg, decodingHypothesis);
+ } else if (decodingHypothesis.getName().equals("TimeMark")) {
+ TriMessage msg1 = TriProvider.getInstance().getTriFactory().createMessage();
+ msg1.setEncodedMessage(message.getEncodedMessage());
+ value = super.decode(msg1, decodingHypothesis);
+ } else {
+ value = super.decode(message, decodingHypothesis);
+ }
+
+ return value;
+ }
+
+} // End of class LibItsContainer_asn1
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsDenm_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsDenm_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsDenm_asn1.java (revision 2745)
@@ -0,0 +1,32 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class LibItsDenm_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsDenm_asn1() {
+ _encodingName = "DENM_PDU_Descriptions";
+ }
+
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ if (decodingHypothesis.getName().endsWith("denmPacket")) {
+ Type type = getTypeForName("DENM_PDU_Descriptions.DENM");
+ return super.decode(message, type);
+ }
+
+ return super.decode(message, decodingHypothesis);
+ }
+
+} // End of class LibItsDenm_asn1
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsEvcsn_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsEvcsn_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsEvcsn_asn1.java (revision 2745)
@@ -0,0 +1,33 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class LibItsEvcsn_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsEvcsn_asn1() {
+ _encodingName = "EVCSN_PDU_Descriptions";
+ }
+
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ if (decodingHypothesis.getName().endsWith("evcsnPacket")) {
+ Type type = getTypeForName("EVCSN_PDU_Descriptions.EvcsnPdu");
+ return super.decode(message, type);
+ }
+
+ return super.decode(message, decodingHypothesis);
+ }
+
+} // End of class LibItsEvcsn_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsEvcsn_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsFntp_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsFntp_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsFntp_asn1.java (revision 2745)
@@ -0,0 +1,30 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+
+public class LibItsFntp_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsFntp_asn1() {
+ _encodingName = "CALMfntp";
+ }
+
+ protected Type getTypeForName(final String type) {
+
+ String type_ = type;
+ if (type.endsWith("nfSapPrimitivesUp")) {
+ type_ = String.format("%s.%s", _encodingName, "NFsapPrimitivesUp");
+ } else if (type.endsWith("mnRequestRequest")) {
+ type_ = String.format("%s.%s", _encodingName, "MN_Request_request");
+ } else if (type.endsWith("msgIn_nf")) {
+ type_ = String.format("%s.%s", _encodingName, "NFsapPrimitivesDown");
+ }
+
+ Type asnOriginalType = super.getTypeForName(type_);
+
+ return asnOriginalType;
+ } // End of method getTypeForName
+
+} // End of class LibItsFntp_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsFntp_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsFsap_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsFsap_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsFsap_asn1.java (revision 2745)
@@ -0,0 +1,12 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+public class LibItsFsap_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsFsap_asn1() {
+ _encodingName = "CALMfsap";
+ }
+
+} // End of class LibItsFsap_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsFsap_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsIicp_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsIicp_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsIicp_asn1.java (revision 2745)
@@ -0,0 +1,30 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+
+public class LibItsIicp_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsIicp_asn1() {
+ _encodingName = "CALMiitsscu";
+ }
+
+ protected Type getTypeForName(final String type) {
+
+ String type_ = type;
+ if (type.endsWith("msg_req")) {
+ type_ = String.format("%s.%s", _encodingName, "IIC_Request");
+ } else if (type.endsWith("msg_resp")) {
+ type_ = String.format("%s.%s", _encodingName, "IIC_Response");
+ } else if (type.endsWith("mcmdRq")) {
+ type_ = String.format("%s.%s", _encodingName, "McmdRq");
+ }
+
+ Type asnOriginalType = super.getTypeForName(type_);
+
+ return asnOriginalType;
+ } // End of method getTypeForName
+
+} // End of class LibItsIicp_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsIicp_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsIvim_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsIvim_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsIvim_asn1.java (revision 2745)
@@ -0,0 +1,33 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class LibItsIvim_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsIvim_asn1() {
+ _encodingName = "IVIM_PDU_Descriptions";
+ }
+
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ if (decodingHypothesis.getName().endsWith("ivimPacket")) {
+ Type type = getTypeForName("IVIM_PDU_Descriptions.IVIM");
+ return super.decode(message, type);
+ }
+
+ return super.decode(message, decodingHypothesis);
+ }
+
+} // End of class LibItsIvim_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsIvim_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsMapemSpatem_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsMapemSpatem_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsMapemSpatem_asn1.java (revision 2745)
@@ -0,0 +1,57 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class LibItsMapemSpatem_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsMapemSpatem_asn1() {
+ _encodingName = "MAPEM_SPATEM_ETSI";
+ }
+
+ @Override
+ public TriMessage encode(final Value template) {
+
+ TriMessage result;
+ String type = String.format("%s.%s", _encodingName, template.getType().getName());
+ if (template.getType().getName().endsWith("MAPEM")) {
+ _encodingName = "MAPEM_PDU_Descriptions";
+ result = super.encode(template);
+ } else {
+ _encodingName = "SPATEM_PDU_Descriptions";
+ result = super.encode(template);
+ }
+ _encodingName = "MAPEM_SPATEM_ETSI";
+
+ return result;
+ }
+
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ Value result;
+ if (decodingHypothesis.getName().endsWith("MAPEM")) {
+ Type type = getTypeForName("MAPEM_PDU_Descriptions.MAPEM");
+ _encodingName = "MAPEM_PDU_Descriptions";
+ result = super.decode(message, type);
+ } else {
+ Type type = getTypeForName("SPATEM_PDU_Descriptions.SPATEM");
+ _encodingName = "SPATEM_PDU_Descriptions";
+ result = super.decode(message, type);
+ }
+ _encodingName = "MAPEM_SPATEM_ETSI";
+
+ return result;
+ }
+
+} // End of class LibItsMapemSpatem_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsMapemSpatem_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsSremSsem_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsSremSsem_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsSremSsem_asn1.java (revision 2745)
@@ -0,0 +1,51 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class LibItsSremSsem_asn1 extends LibIts_asn1 {
+
+ /**
+ * Constructor
+ */
+ public LibItsSremSsem_asn1() {
+ _encodingName = "SREM_SSEM_ETSI";
+ }
+
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ if (decodingHypothesis.getName().endsWith("SREM")) {
+ Type type = getTypeForName("SREM_PDU_Descriptions.SREM");
+ return super.decode(message, type);
+ } else {
+ Type type = getTypeForName("SSEM_PDU_Descriptions.SSEM");
+ return super.decode(message, type);
+ }
+ }
+
+ @Override
+ public TriMessage encode(final Value template) {
+
+ TriMessage result;
+ String type = String.format("%s.%s", _encodingName, template.getType().getName());
+ if (template.getType().getName().endsWith("SREM")) {
+ _encodingName = "SREM_PDU_Descriptions";
+ result = super.encode(template);
+ } else {
+ _encodingName = "SREM_PDU_Descriptions";
+ result = super.encode(template);
+ }
+ _encodingName = "SREM_SSEM_ETSI";
+
+ return result;
+ }
+
+} // End of class LibItsSremSsem_asn1
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibItsSremSsem_asn1.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibIts_asn1.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibIts_asn1.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/LibIts_asn1.java (revision 2745)
@@ -0,0 +1,160 @@
+package org.etsi.ttcn.tool.elvior.codec;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.elvior.ttcn.tritci.IntegerValueEx;
+import org.elvior.ttcn.tritci.TciProvider;
+import org.elvior.ttcn.tritci.TriMessageEx;
+import org.elvior.ttcn.tritci.TriProvider;
+import org.etsi.common.ByteHelper;
+import org.etsi.ttcn.tci.RecordValue;
+import org.etsi.ttcn.tci.TciCDProvided;
+import org.etsi.ttcn.tci.TciTypeClass;
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+/**
+ *
+ * Note that "Enable Internal Codec" field shall be set to true
+ *
+ */
+public class LibIts_asn1 implements TciCDProvided {
+
+ /**
+ * Logger instance
+ */
+ protected final static Logger _logger = Logger.getLogger("org.etsi.its");
+
+ protected String _encodingName;
+
+ /**
+ * Constructor
+ */
+ public LibIts_asn1() {
+ _encodingName = "";
+ }
+
+ /**
+ * This operation decodes message according to the encoding rules and returns a TTCN-3 value.
+ * The decodingHypothesis shall be used to determine whether the encoded value can be decoded.
+ * If an encoding rule is not self-sufficient, i.e. if the encoded message does not inherently
+ * contain its type decodingHypothesis shall be used. If the encoded value can be decoded without
+ * the decoding hypothesis, the distinct null value shall be returned if the type determined from
+ * the encoded message is not compatible with the decoding hypothesis
+ *
+ * @param message The encoded message to be decoded
+ * @param decodingHypothesis The hypothesis the decoding can be based on
+ * @return Returns the decoded value, if the value is of a compatible type as the decodingHypothesis, else the distinct value null
+ *
+ * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.2.1 decode
+ */
+ @Override
+ public Value decode(final TriMessage message, final Type decodingHypothesis) {
+
+ TriMessageEx msg = TriProvider.getInstance().getTriFactory().createMessageEx();
+ msg.setEncodedMessage(message.getEncodedMessage());
+ String type = "";
+ System.out.println("decode: " + String.format("%s.%s: %02x", decodingHypothesis.getTypeEncoding(), decodingHypothesis.getName(), message.getEncodedMessage()[1]));
+ if (decodingHypothesis.getTypeEncoding().equals("per-basic-unaligned:1997")) {
+ switch (message.getEncodedMessage()[1]) { // messageID INTEGER{ denm(1), cam(2), poi(3), spatem(4), mapem(5), ivim(6), ev-rsr(7), tistpgtransaction(8), srem(9), ssem(10), evcsn(11) } (0..255), -- Mantis #7209, #7005
+ case (byte)0x01:
+ if (decodingHypothesis.getName().equals("DENM")) {
+ type = "DENM_PDU_Descriptions.DENM";
+ }
+ break;
+ case (byte)0x02:
+ if (decodingHypothesis.getName().equals("CAM")) {
+ type = "CAM_PDU_Descriptions.CAM";
+ }
+ break;
+ case (byte)0x05:
+ if (decodingHypothesis.getName().equals("MAPEM")) {
+ type = "MAPEM_PDU_Descriptions.MAPEM";
+ }
+ break;
+ case (byte)0x04:
+ if (decodingHypothesis.getName().equals("SPATEM")) {
+ type = "SPATEM_PDU_Descriptions.SPATEM";
+ }
+ break;
+ case (byte)0x06:
+ if (decodingHypothesis.getName().equals("IVIM")) {
+ type = "IVIM_PDU_Descriptions.IVIM";
+ }
+ break;
+ case (byte)0x07:
+ if (decodingHypothesis.getName().equals("EvcsnPdu")) {
+ type = "EVCSN_PDU_Descriptions.EvcsnPdu";
+ }
+ break;
+ case (byte)0x09:
+ if (decodingHypothesis.getName().equals("SREM")) {
+ type = "SREM_PDU_Descriptions.SREM";
+ }
+ break;
+ case (byte)0x0a:
+ if (decodingHypothesis.getName().equals("SSEM")) {
+ type = "SSEM_PDU_Descriptions.SSEM";
+ }
+ break;
+ default:
+ // Nothing to do
+ System.out.println("Default: " + String.format("%s.%s", decodingHypothesis.getTypeEncoding(), decodingHypothesis.getName()));
+ } // End of 'switch' statement
+ } else {
+ type = String.format("%s.%s", _encodingName, decodingHypothesis.getName());
+ }
+ if (type.isEmpty()) {
+ return null; // Abort decoding
+ }
+ Type asnOriginalType = getTypeForName(type);
+ // Check which type class the decoding hypothesis is of
+ Value value = TciProvider.getInstance().getSystemInterface().internalDecode(msg, asnOriginalType);
+ return value;
+ }
+
+ @Override
+ public TriMessage encode(final Value template) {
+
+ String type = String.format("%s.%s", _encodingName, template.getType().getName());
+ Type asnOriginalType = getTypeForName(type);
+ if (asnOriginalType != null) {
+ Value internalASNEncodecValue = null;
+ switch (template.getType().getTypeClass()) {
+ case TciTypeClass.RECORD:
+ internalASNEncodecValue = (RecordValue)asnOriginalType.newInstance();
+ String[] fields = ((RecordValue)internalASNEncodecValue).getFieldNames();
+ RecordValue asn1Value = (RecordValue)template;
+ for(String field: fields) {
+ Value fieldValue = asn1Value.getField(field);
+ if(fieldValue.notPresent()) {
+ ((RecordValue)internalASNEncodecValue).setFieldOmitted(field);
+ } else {
+ ((RecordValue)internalASNEncodecValue).setField(field, fieldValue);
+ }
+ } // End of 'for' statement
+ break;
+ case TciTypeClass.INTEGER:
+ internalASNEncodecValue = (IntegerValueEx)asnOriginalType.newInstance();
+ ((IntegerValueEx)internalASNEncodecValue).setInt64(((IntegerValueEx)template).getInt64());
+ break;
+ default:
+ throw new RuntimeException("Unimplemented type " + template.getType().getTypeClass());
+ } // End of 'switch' statement
+ TriMessage msg = TciProvider.getInstance().getSystemInterface().internalEncode(internalASNEncodecValue);
+ return msg;
+ }
+
+ return null;
+ }
+
+ protected Type getTypeForName(final String type) {
+
+ Type asnOriginalType = TciProvider.getInstance().getTciCDRequired().getTypeForName(type);
+
+ return asnOriginalType;
+ } // End of method getTypeForName
+
+} // End of class LibIts_asn1
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/TciCDWrapper.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/TciCDWrapper.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior/codec/TciCDWrapper.java (revision 2745)
@@ -0,0 +1,176 @@
+/**
+ * @author STF 424_ITS_Test_Platform
+ * @version $id$
+ */
+package org.etsi.ttcn.tool.elvior.codec;
+
+import java.math.BigInteger;
+import java.util.logging.Logger;
+
+import org.elvior.ttcn.tritci.IntegerValueEx;
+import org.elvior.ttcn.tritci.TciProvider;
+import org.etsi.ttcn.adapter.core.TERFactory;
+import org.etsi.ttcn.codec.core.ITciCDWrapper;
+import org.etsi.ttcn.tci.BooleanValue;
+import org.etsi.ttcn.tci.CharstringValue;
+import org.etsi.ttcn.tci.EnumeratedValue;
+import org.etsi.ttcn.tci.FloatValue;
+import org.etsi.ttcn.tci.IntegerValue;
+import org.etsi.ttcn.tci.OctetstringValue;
+import org.etsi.ttcn.tci.RecordOfValue;
+import org.etsi.ttcn.tci.RecordValue;
+import org.etsi.ttcn.tci.TciCDRequired;
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+
+/** This class implements the ITciCDWrapper interface
+ *
+ * Note that the TCI Codec Interface (TCI-CD) describes the operations a TTCN-3 Executable is required to implement and the operations a codec implementation for a certain encoding scheme shall provide to the TE
+ *
+ * See ETSI ES 201 873-6 V4.2.1 - Clause 7.3.2.1 TCI-CD required
+ */
+public class TciCDWrapper implements ITciCDWrapper {
+
+ private TciCDRequired _tciFactory = TciProvider.getInstance().getTciCDRequired();
+
+ private Logger _logger;
+
+ public TciCDWrapper() {
+ _logger = Logger.getLogger("org.etsi.its");
+ }
+
+ @Override
+ public IntegerValue setInteger(final Integer value) {
+ IntegerValue iv = (IntegerValue)_tciFactory.getInteger().newInstance();
+ iv.setInteger(value);
+ return iv;
+ }
+
+ @Override
+ public int getInteger(final IntegerValue iv) {
+ return iv.getInteger();
+ }
+
+ @Override
+ public IntegerValue setInteger(final BigInteger value) {
+ IntegerValueEx bi = (IntegerValueEx) _tciFactory.getInteger().newInstance(); //_tciFactory.getTypeForName("org.elvior.ttcn.tritci.IntegerValueEx");
+ if (bi != null) {
+ bi.setInt64(value.longValue());
+ return (IntegerValue)bi;
+ } else {
+ IntegerValue i = (IntegerValue) _tciFactory.getInteger().newInstance();
+ i.setInteger(value.intValue());
+ return i;
+ }
+ }
+
+ @Override
+ public void setInteger(BigInteger value, IntegerValue setInt) {
+ ((IntegerValueEx)setInt).setInt64(value.longValue());
+ }
+
+ @Override
+ public long getBigInteger(final IntegerValue iv) {
+ return ((IntegerValueEx)iv).getInt64();
+ }
+
+ @Override
+ public OctetstringValue getOctetstring() {
+ return (OctetstringValue)_tciFactory.getOctetstring().newInstance();
+ }
+
+ /** Constructs and returns a basic TTCN-3 string type
+ *
+ * @return An instance of Type representing a TTCN-3 string type
+ */
+ @Override
+ public CharstringValue getCharstringValue() {
+ return (CharstringValue)_tciFactory.getCharstring().newInstance();
+ }
+
+ @Override
+ public FloatValue getFloat() {
+ return (FloatValue)_tciFactory.getFloat().newInstance();
+ }
+
+ @Override
+ public Value getUnionValue(final Type decodingHypothesis, final String variantName) {
+
+ String variantTypeName = decodingHypothesis.getDefiningModule().getModuleName() + "." + decodingHypothesis.getName() + "." + variantName;
+ Type variantType = getTypeForName(variantTypeName);
+ if(variantType != null) {
+ Value testVal = variantType.newInstance();
+ if(testVal != null) {
+ return testVal;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public Type getTypeForName(final String type) {
+ Type originalType;
+ if (type.indexOf("DecodedBtpPayload") != -1) {
+ if (type.endsWith("camPacket")) {
+ originalType = _tciFactory.getTypeForName("CAM_PDU_Descriptions.CAM");
+ } else if (type.endsWith("denmPacket")) {
+ originalType = _tciFactory.getTypeForName("DENM_PDU_Descriptions.DENM");
+ } else if (type.endsWith("mapemPacket")) {
+ originalType = _tciFactory.getTypeForName("MAPEM_PDU_Descriptions.MAPEM");
+ } else if (type.endsWith("spatemPacket")) {
+ originalType = _tciFactory.getTypeForName("MAPEM_PDU_Descriptions.SPATEM");
+ } else if (type.endsWith("ivimPacket")) {
+ originalType = _tciFactory.getTypeForName("IVIM_PDU_Descriptions.IVIM");
+ } else if (type.endsWith("evcsnPacket")) {
+ originalType = _tciFactory.getTypeForName("EVCSN_PDU_Descriptions.EvcsnPdu");
+ } else if (type.endsWith("sremPacket")) {
+ originalType = _tciFactory.getTypeForName("SREM_PDU_Descriptions.SREM");
+ } else if (type.endsWith("ssemPacket")) {
+ originalType = _tciFactory.getTypeForName("SSEM_PDU_Descriptions.SSEM");
+ } else {
+ originalType = _tciFactory.getTypeForName(type);
+ }
+ } else {
+ originalType = _tciFactory.getTypeForName(type);
+ }
+
+ return originalType;
+ } // End of method getTypeForName
+
+ @Override
+ public BooleanValue getBoolean() {
+ return (BooleanValue)_tciFactory.getBoolean().newInstance();
+ }
+
+ @Override
+ public EnumeratedValue getEnumValue(String typeName) {
+ return (EnumeratedValue)_tciFactory.getTypeForName(typeName).newInstance();
+ }
+
+ @Override
+ public RecordValue getRecordValue(final String typeName) {
+ return (RecordValue)_tciFactory.getTypeForName(typeName).newInstance();
+ }
+
+ @Override
+ public RecordOfValue getRecordOfValue(final String typeName) {
+ return (RecordOfValue)_tciFactory.getTypeForName(typeName).newInstance();
+ }
+
+ @Override
+ public void setInteger(IntegerValue intValue, final Integer value) {
+ intValue.setInteger(value);
+ }
+
+// @Override
+// public void logDebug(String debugMessage) {
+// _logger.info(debugMessage);
+// }
+//
+// @Override
+// public void logError(String errorMessage) {
+// _logger.severe(errorMessage);
+// }
+//
+} // End of class TciCDWrapper
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior (revision 2745)
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/elvior
Property changes:
Added: tsvn:logminsize
## -0,0 +1 ##
+5
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/PluginAdapter.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/PluginAdapter.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/PluginAdapter.java (revision 2745)
@@ -0,0 +1,209 @@
+package org.etsi.ttcn.tool.spirent.adapter;
+
+import org.etsi.ttcn.adapter.core.TERFactory;
+import org.etsi.ttcn.tri.TriActionTemplate;
+import org.etsi.ttcn.tri.TriAddress;
+import org.etsi.ttcn.tri.TriAddressList;
+import org.etsi.ttcn.tri.TriComponentId;
+import org.etsi.ttcn.tri.TriException;
+import org.etsi.ttcn.tri.TriMessage;
+import org.etsi.ttcn.tri.TriParameter;
+import org.etsi.ttcn.tri.TriParameterList;
+import org.etsi.ttcn.tri.TriPortId;
+import org.etsi.ttcn.tri.TriPortIdList;
+import org.etsi.ttcn.tri.TriSignatureId;
+import org.etsi.ttcn.tri.TriStatus;
+import org.etsi.ttcn.tri.TriTestCaseId;
+
+import com.testingtech.ttcn.tri.ISAPlugin;
+import com.testingtech.ttcn.tri.PluginIdentifier;
+import com.testingtech.ttcn.tri.PluginIdentifierContainer;
+import com.testingtech.ttcn.tri.TriStatusImpl;
+import com.testingtech.ttcn.tri.extension.PortPluginProvider;
+
+import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
+
[email protected]("deprecation")
+public class PluginAdapter implements ISAPlugin, PortPluginProvider, PluginIdentifierContainer {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3032642487407372318L;
+
+ /**
+ * Instance of tool independent test adapter implementation
+ */
+ protected TestAdapter ta;
+
+ /**
+ * TTwb runtime reference
+ */
+ protected RB rb;
+
+ /**
+ * TTwb plugin identifier
+ */
+ protected PluginIdentifier pluginId = new PluginIdentifier("org.etsi.ttcn.tool.spirent.port");
+
+ @Override
+ public ISAPlugin getPortPlugin() {
+ return this;
+ }
+
+ @Override
+ public void setPluginIdentifier(PluginIdentifier pluginId) {
+ this.pluginId = pluginId;
+ }
+
+ @Override
+ public void setRB(RB rb) {
+ this.rb = rb;
+ TERFactory.setImpl(new TeRequiredImpl(this.rb));
+ ta = new TestAdapter();
+ }
+
+ @Override
+ public TriStatus setUp() {
+ return new TriStatusImpl();
+ }
+
+ @Override
+ public TriStatus tearDown() {
+ return new TriStatusImpl();
+ }
+
+ @Override
+ public TriStatus triCall(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddress sutAddress, TriSignatureId signatureId,
+ TriParameterList parameterList) {
+ return ta.triCall(componentId, tsiPortId, sutAddress, signatureId, parameterList);
+ }
+
+ @Override
+ public TriStatus triCallBC(TriComponentId componentId, TriPortId tsiPortId,
+ TriSignatureId signatureId, TriParameterList parameterList) {
+ return ta.triCallBC(componentId, tsiPortId, signatureId, parameterList);
+ }
+
+ @Override
+ public TriStatus triCallMC(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddressList sutAddresses, TriSignatureId signatureId,
+ TriParameterList parameterList) {
+ return ta.triCallMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList);
+ }
+
+ @Override
+ public TriStatus triEndTestCase() {
+ return ta.triEndTestCase();
+ }
+
+ @Override
+ public TriStatus triExecuteTestcase(TriTestCaseId testCaseId,
+ TriPortIdList tsiPorts) {
+ return ta.triExecuteTestcase(testCaseId, tsiPorts);
+ }
+
+ @Override
+ public TriStatus triMap(TriPortId compPortId, TriPortId tsiPortId) {
+ return ta.triMap(compPortId, tsiPortId);
+ }
+
+ @Override
+ public TriStatus triMapParam(TriPortId compPortId, TriPortId tsiPortId,
+ TriParameterList paramList) {
+ return ta.triMapParam(compPortId, tsiPortId, paramList);
+ }
+
+ @Override
+ public TriStatus triRaise(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddress sutAddress, TriSignatureId signatureId,
+ TriException exception) {
+ return ta.triRaise(componentId, tsiPortId, sutAddress, signatureId, exception);
+ }
+
+ @Override
+ public TriStatus triRaiseBC(TriComponentId componentId,
+ TriPortId tsitPortId, TriSignatureId signatureId, TriException exc) {
+ return ta.triRaiseBC(componentId, tsitPortId, signatureId, exc);
+ }
+
+ @Override
+ public TriStatus triRaiseMC(TriComponentId componentId,
+ TriPortId tsitPortId, TriAddressList sutAddresses,
+ TriSignatureId signatureId, TriException exc) {
+ return ta.triRaiseMC(componentId, tsitPortId, sutAddresses, signatureId, exc);
+ }
+
+ @Override
+ public TriStatus triReply(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddress sutAddress, TriSignatureId signatureId,
+ TriParameterList parameterList, TriParameter returnValue) {
+ return ta.triReply(componentId, tsiPortId, sutAddress, signatureId, parameterList, returnValue);
+ }
+
+ @Override
+ public TriStatus triReplyBC(TriComponentId componentId,
+ TriPortId tsiPortId, TriSignatureId signatureId,
+ TriParameterList parameterList, TriParameter returnValue) {
+ return ta.triReplyBC(componentId, tsiPortId, signatureId, parameterList, returnValue);
+ }
+
+ @Override
+ public TriStatus triReplyMC(TriComponentId componentId,
+ TriPortId tsiPortId, TriAddressList sutAddresses,
+ TriSignatureId signatureId, TriParameterList parameterList,
+ TriParameter returnValue) {
+ return ta.triReplyMC(componentId, tsiPortId, sutAddresses, signatureId, parameterList, returnValue);
+ }
+
+ @Override
+ public TriStatus triSAReset() {
+ return ta.triSAReset();
+ }
+
+ @Override
+ public TriStatus triSend(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddress address, TriMessage sendMessage) {
+ return ta.triSend(componentId, tsiPortId, address, sendMessage);
+ }
+
+ @Override
+ public TriStatus triSendBC(TriComponentId componentId, TriPortId tsiPortId,
+ TriMessage sendMessage) {
+ return ta.triSendBC(componentId, tsiPortId, sendMessage);
+ }
+
+ @Override
+ public TriStatus triSendMC(TriComponentId componentId, TriPortId tsiPortId,
+ TriAddressList addresses, TriMessage sendMessage) {
+ return ta.triSendMC(componentId, tsiPortId, addresses, sendMessage);
+ }
+
+ @Override
+ public TriStatus triSutActionInformal(String description) {
+ return ta.triSutActionInformal(description);
+ }
+
+ @Override
+ public TriStatus triSutActionTemplate(TriActionTemplate templateValue) {
+ return ta.triSutActionTemplate(templateValue);
+ }
+
+ @Override
+ public TriStatus triUnmap(TriPortId compPortId, TriPortId tsiPortId) {
+ return ta.triUnmap(compPortId, tsiPortId);
+ }
+
+ @Override
+ public TriStatus triUnmapParam(TriPortId compPortId, TriPortId tsiPortId,
+ TriParameterList paramList) {
+ return ta.triUnmapParam(compPortId, tsiPortId, paramList);
+ }
+
+ @Override
+ public TriStatus reInit() {
+ return tearDown();
+ }
+
+}
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/PluginAdapter.java
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/TeRequiredImpl.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/TeRequiredImpl.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/TeRequiredImpl.java (revision 2745)
@@ -0,0 +1,84 @@
+package org.etsi.ttcn.tool.spirent.adapter;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.etsi.ttcn.adapter.core.ITERequired;
+import org.etsi.ttcn.tri.TriAddress;
+import org.etsi.ttcn.tri.TriCommunicationTE;
+import org.etsi.ttcn.tri.TriMessage;
+import org.etsi.ttcn.tri.TriStatus;
+
+import com.testingtech.ttcn.logging.RTLoggingConstants;
+import com.testingtech.ttcn.tri.TriAddressImpl;
+import com.testingtech.ttcn.tri.TriMessageImpl;
+import com.testingtech.ttcn.tri.TriStatusImpl;
+
+import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
+
+public class TeRequiredImpl implements ITERequired {
+
+ private RB rb;
+ private Properties properties = new Properties();
+
+ public TeRequiredImpl(RB rb) {
+ this.rb = rb;
+ try {
+ properties.load(new FileInputStream("./etc/ta.properties"));
+ } catch (IOException e) {
+ System.err.println("Unable to load TA properties");
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public TriCommunicationTE getCommunicationTE() {
+ return rb.getTriCommunicationTE();
+ }
+
+ @Override
+ public String getTaParameter(String param) {
+ return properties.getProperty(param, "");
+ }
+
+ @Override
+ public TriAddress getTriAddress(byte[] message) {
+ return new TriAddressImpl(message);
+ }
+
+ @Override
+ public TriMessage getTriMessage(byte[] message) {
+ return new TriMessageImpl(message);
+ }
+
+ @Override
+ public TriStatus getTriStatus(int statusCode) {
+ return new TriStatusImpl(statusCode);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public TriStatus getTriStatus(int statusCode, String message) {
+ switch(statusCode) {
+ case TriStatus.TRI_OK:
+ rb.getTciTLProvidedV321TT().tliRT("", System.nanoTime(), "", -1, null, RTLoggingConstants.RT_LOG_INFO, message);
+ return new TriStatusImpl();
+ default:
+ return new TriStatusImpl(message);
+ }
+
+ }
+
+ @Override
+ public void logDebug(String debugMessage) {
+ // TODO Auto-generated method stub
+ System.err.println(debugMessage);
+ }
+
+ @Override
+ public void logError(String errorMessage) {
+ // TODO Auto-generated method stub
+ System.err.println(errorMessage);
+ }
+}
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/TeRequiredImpl.java
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/TestAdapter.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/TestAdapter.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/TestAdapter.java (revision 2745)
@@ -0,0 +1,28 @@
+package org.etsi.ttcn.tool.spirent.adapter;
+
+import org.etsi.ttcn.tri.TriActionTemplate;
+import org.etsi.ttcn.tri.TriPortIdList;
+import org.etsi.ttcn.tri.TriStatus;
+import org.etsi.ttcn.tri.TriTestCaseId;
+
+
[email protected]({ "deprecation", "serial" })
+public class TestAdapter extends org.etsi.ttcn.adapter.core.TestAdapter {
+
+ /* (non-Javadoc)
+ * @see org.etsi.ttcn.tri.TriCommunicationSA#triExecuteTestcase(org.etsi.ttcn.tri.TriTestCaseId, org.etsi.ttcn.tri.TriPortIdList)
+ */
+ @Override
+ public TriStatus triExecuteTestcase(final TriTestCaseId tcId, final TriPortIdList portList) {
+ return required.getTriStatus(TriStatus.TRI_OK);
+ }
+
+ /**
+ * triSutActionTemplate not implemented
+ * @see org.etsi.ttcn.tri.TriCommunicationSA#triSutActionTemplate(org.etsi.ttcn.tri.TriActionTemplate)
+ */
+ @Override
+ public TriStatus triSutActionTemplate(TriActionTemplate templateValue) {
+ return required.getTriStatus(TriStatus.TRI_ERROR, "triSutActionTemplate not implemented");
+ }
+}
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/adapter/TestAdapter.java
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+URL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/Its_CodecProvider.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/Its_CodecProvider.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/Its_CodecProvider.java (revision 2745)
@@ -0,0 +1,85 @@
+/**
+ * @author ETSI / STF462 / Alexandre Berge
+ * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/javasrc/tool/org/etsi/its/tool/testingtech/Its_CodecProvider.java $
+ * $Id: Its_CodecProvider.java 141 2016-10-17 14:55:22Z berge $
+ */
+package org.etsi.ttcn.tool.spirent.codec;
+
+import org.etsi.ttcn.codec.core.ITciCDWrapper;
+import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
+import org.etsi.ttcn.codec.core.CodecFactory;
+import org.etsi.ttcn.codec.core.MainCodec;
+import org.etsi.ttcn.tci.TciCDProvided;
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+import org.etsi.ttcn.tri.TriMessage;
+
+import com.testingtech.ttcn.extension.CodecProvider;
+import com.testingtech.util.plugin.PluginInitException;
+
+import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
+
+/** This is the main entry point for Its codec
+ */
+public class Its_CodecProvider implements CodecProvider {
+
+ /**
+ * This method provides the codec associated to the specified encoding identifier
+ *
+ * @param rb TTwb Runtime reference
+ * @param encodingName The name of the encoding, specified by the TTCN-3 key words 'with/encode'
+ * @return The codec associated to the specified encoding identifier
+ */
+ @Override
+ public TciCDProvided getCodec(RB rb, String encodingName) throws PluginInitException {
+
+ // Register External codecs
+ CodecFactory cf = CodecFactory.getInstance();
+ TTWBCodecSupport cs = new TTWBCodecSupport(rb);
+
+ //cf.setExternalCodec("LibItsCam_asn1", cs.getCodec("LibItsCam_asn1"));
+ //cf.setExternalCodec("LibItsDenm_asn1", cs.getCodec("LibItsDenm_asn1"));
+ //cf.setExternalCodec("LibItsMapSpat_asn1", cs.getCodec("LibItsMapSpat_asn1"));
+
+ //TciCDProvided xmlCodec = cs.getCodec("CDT_accessControlPolicy_v1_0_0");
+ //((com.testingtech.ttcn.tri.ICDPlugin)xmlCodec).setUp(); // Bug in TTWBCodecSupport
+ //cf.setExternalCodec("CDT_accessControlPolicy_v1_0_0", xmlCodec);
+
+ //TODO: add V2G external codecs (xsd)
+ //TODO: Yann add CALM external codecs (ASN.1)
+ return new Codec(rb);
+ }
+
+ private class Codec implements TciCDProvided {
+
+ public Codec(RB rb) {
+ TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper(rb));
+ }
+
+ @Override
+ public Value decode(TriMessage message, Type decodingHypothesis) {
+ MainCodec codec = new MainCodec((ITciCDWrapper) TciCDWrapperFactory.getTciCDInstance());
+ Value v = null;
+ try {
+ v = codec.triDecode(message, decodingHypothesis);
+ }
+ catch(Exception e) {
+ e.printStackTrace();
+ }
+ return v;
+ }
+
+ @Override
+ public TriMessage encode(Value value) {
+ MainCodec codec = new MainCodec((ITciCDWrapper) TciCDWrapperFactory.getTciCDInstance());
+ TriMessage m = null;
+ try {
+ m = codec.triEncode(value);
+ }
+ catch(Exception e) {
+ e.printStackTrace();
+ }
+ return m;
+ }
+ }
+}
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/TTWBCodecSupport.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/TTWBCodecSupport.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/TTWBCodecSupport.java (revision 2745)
@@ -0,0 +1,82 @@
+/**
+ * @author STF 424_ITS_Test_Platform
+ * @version $URL$
+ * $Id$
+ */
+package org.etsi.ttcn.tool.spirent.codec;
+
+import org.etsi.ttcn.codec.core.ITCIRequired;
+import org.etsi.ttcn.tci.TciCDProvided;
+
+import com.testingtech.ttcn.extension.CodecProvider;
+import com.testingtech.ttcn.tri.AbstractPlugin;
+import com.testingtech.util.plugin.IPlugin;
+import com.testingtech.util.plugin.IPluginParameter;
+import com.testingtech.util.plugin.PluginInitException;
+import com.testingtech.util.plugin.PluginInstantiationException;
+import com.testingtech.util.plugin.PluginParameter;
+import com.testingtech.util.plugin.PluginRepository;
+
+import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
+
+/**
+ * This class provides an implementation of the ITCIRequired interface to create a instance of TTCN-3 codec
+ *
+ * @category Factory
+ */
+public class TTWBCodecSupport implements ITCIRequired{
+
+ private RB _rb;
+
+ /**
+ * Constructor
+ * @param rb TTWB Test Execution instance
+ */
+ public TTWBCodecSupport(RB rb) {
+ _rb = rb;
+ }
+
+ /**
+ * We overwrite this method to bypass the codec caching mechanism provided by TTwb.
+ * The reason is that the TA is based on multicomponent/one port mapping mechanism
+ *
+ * @param encodingName The encoding identifier
+ * @return The codec instance on success, null otherwise
+ */
+ @Override
+ public TciCDProvided getCodec(String encodingName) {
+ if (encodingName == null)
+ return null;
+ IPluginParameter[] parameters = new IPluginParameter[]{
+ new PluginParameter("encoding", encodingName)
+ };
+ IPlugin plugin = PluginRepository.getInstance().getPluginByParameters(
+ CodecProvider.class.getName(), parameters);
+ if (plugin != null) {
+ try {
+ CodecProvider codecProvider = (CodecProvider) plugin.instantiate(CodecProvider.class.getName(), parameters, _rb.getExternalLoader());
+ try {
+ TciCDProvided codec = codecProvider.getCodec(_rb, encodingName);
+ if (codec!=null && codec instanceof AbstractPlugin) {
+ ((AbstractPlugin) codec).initAbstractPlugin(_rb);
+ }
+ return codec;
+ } catch (PluginInitException e) {
+ e.printStackTrace();
+ }
+ }
+ catch (PluginInstantiationException e) {
+ e.printStackTrace();
+ }
+ } else {
+ TciCDProvided codec = _rb.TestAdapter.getCodec(encodingName);
+ if (codec!=null && codec instanceof AbstractPlugin) {
+ ((AbstractPlugin) codec).initAbstractPlugin(_rb);
+ }
+ return codec;
+ }
+
+ return null;
+ }
+
+} // End of class BaseCodec
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/TTWBCodecSupport.java
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/TciCDWrapper.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/TciCDWrapper.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/TciCDWrapper.java (revision 2745)
@@ -0,0 +1,148 @@
+/**
+ * @author STF 424_ITS_Test_Platform
+ * @version $id$
+ */
+package org.etsi.ttcn.tool.spirent.codec;
+
+import java.math.BigInteger;
+
+import org.etsi.ttcn.codec.core.ITciCDWrapper;
+import org.etsi.ttcn.tci.BooleanValue;
+import org.etsi.ttcn.tci.CharstringValue;
+import org.etsi.ttcn.tci.EnumeratedValue;
+import org.etsi.ttcn.tci.FloatValue;
+import org.etsi.ttcn.tci.IntegerValue;
+import org.etsi.ttcn.tci.OctetstringValue;
+import org.etsi.ttcn.tci.RecordOfValue;
+import org.etsi.ttcn.tci.RecordValue;
+import org.etsi.ttcn.tci.Type;
+import org.etsi.ttcn.tci.Value;
+
+import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
+
+/** This class implements the ITciCDWrapper interface
+ *
+ * Note that the TCI Codec Interface (TCI-CD) describes the operations a TTCN-3 Executable is required to implement and the operations a codec implementation for a certain encoding scheme shall provide to the TE
+ *
+ * See ETSI ES 201 873-6 V4.2.1 - Clause 7.3.2.1 TCI-CD required
+ */
+public class TciCDWrapper implements ITciCDWrapper {
+
+ /**
+ * RuntimeBehavior instance reference
+ */
+ private RB _rb;
+
+ /**
+ * Specialized ctor
+ * @param rb TTCN-3 runtime reference
+ */
+ public TciCDWrapper(final RB rb) {
+ _rb = rb;
+ }
+
+ @Override
+ public IntegerValue setInteger(Integer value) {
+ IntegerValue iv = (IntegerValue)_rb.getTciCDRequired().getInteger().newInstance();
+ iv.setInt(value);
+ return iv;
+ }
+
+ @Override
+ public IntegerValue setInteger(BigInteger value) {
+ IntegerValue iv = (IntegerValue)_rb.getTciCDRequired().getInteger().newInstance();
+ iv.setBigInt(value);
+ return iv;
+ }
+
+ @Override
+ public void setInteger(IntegerValue intValue, final Integer value) {
+ intValue.setInt(value);
+ }
+
+ @Override
+ public void setInteger(BigInteger value, IntegerValue setInt) {
+ setInt.setBigInt(value);
+ }
+
+ /** Constructs and returns a basic TTCN-3 integer type
+ *
+ * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.1.2 getInteger
+ * @return An instance of Type representing a TTCN-3 integer type
+ */
+// @Override
+// public IntegerValue getInteger() {
+// return (IntegerValue)_rb.getTciCDRequired().getInteger().newInstance();
+// }
+//
+ @Override
+ public int getInteger(IntegerValue iv) {
+ return iv.getInt();
+ }
+
+ @Override
+ public long getBigInteger(IntegerValue iv) {
+ return iv.getBigInt().longValue();
+ }
+
+ /** Constructs and returns a basic TTCN-3 float type
+ *
+ * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.1.3 getFloat
+ * @return An instance of Type representing a TTCN-3 float type
+ */
+ @Override
+ public FloatValue getFloat() {
+ return (FloatValue)_rb.getTciCDRequired().getFloat().newInstance();
+ }
+
+ /** Constructs and returns a basic TTCN-3 octet string type
+ *
+ * See ETSI ES 201 873-6 V4.2.1 - 7.3.2.1.2 getOctetstring
+ * @return An instance of Type representing a TTCN-3 octet string type
+ */
+ @Override
+ public OctetstringValue getOctetstring() {
+ return (OctetstringValue)_rb.getTciCDRequired().getOctetstring().newInstance();
+ }
+
+ /** Constructs and returns a basic TTCN-3 string type
+ *
+ * @return An instance of Type representing a TTCN-3 string type
+ */
+ @Override
+ public CharstringValue getCharstringValue() {
+ return (CharstringValue)_rb.getTciCDRequired().getCharstring().newInstance();
+ }
+
+ @Override
+ public Value getUnionValue(Type decodingHypothesis, String variantName) {
+ System.err.println("Unknown variant: " + variantName);
+ throw new RuntimeException("Not implemented for TTWB");
+ }
+
+ @Override
+ public Type getTypeForName(String type) {
+ return _rb.getTciCDRequired().getTypeForName(type);
+ }
+
+ @Override
+ public BooleanValue getBoolean() {
+ return (BooleanValue)_rb.getTciCDRequired().getBoolean().newInstance();
+ }
+
+ @Override
+ public RecordValue getRecordValue(String typeName) {
+ return (RecordValue) _rb.getTciCDRequired().getTypeForName(typeName);
+ }
+
+ @Override
+ public RecordOfValue getRecordOfValue(String typeName) {
+ return (RecordOfValue) _rb.getTciCDRequired().getTypeForName(typeName);
+ }
+
+ @Override
+ public EnumeratedValue getEnumValue(String typeName) {
+ return (EnumeratedValue) _rb.getTciCDRequired().getTypeForName(typeName);
+ }
+
+} // End of class TciCDWrapper
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/codec/TciCDWrapper.java
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+URL Author Date Rev Id
\ No newline at end of property
Index: AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/xf/ExternalFunctionsPluginProvider.java
===================================================================
--- AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/xf/ExternalFunctionsPluginProvider.java (nonexistent)
+++ AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/xf/ExternalFunctionsPluginProvider.java (revision 2745)
@@ -0,0 +1,361 @@
+/**
+ * @author STF 424_ITS_Test_Platform
+ * @version $id$
+ */
+package org.etsi.ttcn.tool.spirent.xf;
+
+import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
+import org.etsi.its.extfunc.IItsExternalFunctionsProvider;
+import org.etsi.its.extfunc.ItsExternalFunctionsProvider;
+import org.etsi.ttcn.tool.spirent.codec.TciCDWrapper; // FIXME investigate this
+import org.etsi.ttcn.tci.BooleanValue;
+import org.etsi.ttcn.tci.CharstringValue;
+import org.etsi.ttcn.tci.FloatValue;
+import org.etsi.ttcn.tci.IntegerValue;
+import org.etsi.ttcn.tci.OctetstringValue;
+import org.etsi.ttcn.tci.RecordOfValue;
+import org.etsi.ttcn.tci.RecordValue;
+
+import com.testingtech.ttcn.extension.ExternalFunctionsProvider;
+import com.testingtech.ttcn.tri.ExternalFunctionsDefinition;
+
+import de.tu_berlin.cs.uebb.muttcn.runtime.RB;
+
+/**
+ * This class provides access to the implementation of TTCN-3 external function
+ * @see IItsExternalFunctionsProvider
+ */
+public class ExternalFunctionsPluginProvider implements ExternalFunctionsProvider, ExternalFunctionsDefinition, IItsExternalFunctionsProvider {
+
+ /**
+ * Reference to the
+ */
+ private IItsExternalFunctionsProvider _externalFunctionsPluginProvider;
+
+
+ /**
+ * Constructor
+ */
+ public ExternalFunctionsPluginProvider() {
+ _externalFunctionsPluginProvider = null;
+
+ }
+
+ /**
+ * Constructor
+ *
+ * @param rb TTwb runtime reference
+ */
+ public ExternalFunctionsPluginProvider(RB rb) {
+ TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper(rb)); // FIXME investigate this
+ _externalFunctionsPluginProvider = (IItsExternalFunctionsProvider)new ItsExternalFunctionsProvider();
+
+ }
+
+ /**
+ * Refer to TTwb developer's guide
+ */
+ @Override
+ public ExternalFunctionsDefinition getExternalFunctions(RB rb) {
+ return new ExternalFunctionsPluginProvider(rb);
+ }
+
+ /**
+ * This external function gets the current time
+ * @param pLatitudeA Latitude of node A
+ * @param pLongitudeA Longitude of node A
+ * @param pLatitudeB Latitude of node B
+ * @param pLongitudeB Longitude of node B
+ * @return The current time in Epoch format
+ *
+ * TTCN-3 signature:
+ * external function fx_computeDistance(in UInt32 p_latitudeA, in UInt32 p_longitudeA, in UInt32 p_latitudeB, in UInt32 p_longitudeB) return float;
+ */
+ @Override
+ public FloatValue fx_computeDistance(IntegerValue pLatitudeA,
+ IntegerValue pLongitudeA, IntegerValue pLatitudeB,
+ IntegerValue pLongitudeB) {
+ return _externalFunctionsPluginProvider.fx_computeDistance(pLatitudeA, pLongitudeA, pLatitudeB, pLongitudeB);
+ }
+
+ /**
+ * External function to compute a position using a reference position, a distance and an orientation
+ * @param pIutLongPosVector Reference position
+ * @param pDistance Distance to the reference position (in meter)
+ * @param pOrientation Direction of the computed position (0 to 359; 0 means North)
+ * @param pLatitude Computed position's latitude
+ * @param pLongitude Computed position's longitude
+ *
+ * TTCN-3 signature:
+ * external function fx_computePositionUsingDistance(in LongPosVector p_iutLongPosVector, in integer p_distance, in integer p_orientation, out UInt32 p_latitude, out UInt32 p_longitude);
+ */
+ @Override
+ public void fx_computePositionUsingDistance(
+ IntegerValue p_refLatitude, IntegerValue p_refLongitude,
+ FloatValue pDistance, IntegerValue pOrientation,
+ IntegerValue pLatitude, IntegerValue pLongitude) {
+ _externalFunctionsPluginProvider.fx_computePositionUsingDistance(p_refLatitude, p_refLongitude, pDistance, pOrientation, pLatitude, pLongitude);
+ }
+
+ /**
+ * External function to compute a position using a reference position, a distance and an orientation
+ * @param pIutLongPosVector Reference position
+ * @param pCenLongPosVector Central reference position
+ * @param p_rotation Rotation value (in degrees)
+ * @param pLatitude Computed position's latitude
+ * @param pLongitude Computed position's longitude
+ *
+ * TTCN-3 signature:
+ * external function fx_computePositionFromRotation(in LongPosVector p_iutLongPosVector, in Int32 p_rotation, out Int32 p_latitude, out Int32 p_longitude);
+ */
+ @Override
+ public void fx_computePositionFromRotation(
+ IntegerValue p_refLatitude, IntegerValue p_refLongitude,
+ IntegerValue p_cenLatitude, IntegerValue p_cenLongitude,
+ IntegerValue pRotation,
+ IntegerValue pLatitude, IntegerValue pLongitude) {
+ _externalFunctionsPluginProvider.fx_computePositionFromRotation(p_refLatitude, p_refLongitude, p_cenLatitude, p_cenLongitude, pRotation, pLatitude, pLongitude);
+ }
+
+ @Override
+ public FloatValue fx_computeRadiusFromCircularArea(FloatValue p_squareMeters) {
+ return _externalFunctionsPluginProvider.fx_computeRadiusFromCircularArea(p_squareMeters);
+ }
+
+ /**
+ * This external function gets the current time
+ * @return The current time in Epoch format
+ *
+ * TTCN-3 signature:
+ * external function fx_getCurrentTime() return TimeStamp;
+ */
+ @Override
+ public IntegerValue fx_getCurrentTime() {
+ return _externalFunctionsPluginProvider.fx_getCurrentTime();
+ }
+
+ /**
+ * This external function gets the current time
+ * @return The current time in tenths of a second in the current or next hour in units of 1/10th second from UTC time
+ *
+ * TTCN-3 signature:
+ * external function fx_getCurrentTimeMark() return TimeMark;
+ */
+ @Override
+ public IntegerValue fx_getCurrentTimeMark() {
+ return _externalFunctionsPluginProvider.fx_getCurrentTimeMark();
+ }
+
+ /**
+ * This external function gets the current time
+ * @return The current time in tenths of a second in the current or next hour in units of 1/10th second from UTC time
+ *
+ * TTCN-3 signature:
+ * external function fx_getMinuteOfTheYear() return MinuteOfTheYear;
+ */
+ @Override
+ public IntegerValue fx_getMinuteOfTheYear() {
+ return _externalFunctionsPluginProvider.fx_getMinuteOfTheYear();
+ }
+
+ /**
+ * This external function gets the milliseconds point in the current UTC minute
+ * @return The milliseconds point in the current UTC minute (0..60000)
+ *
+ * TTCN-3 signature:
+ * external function fx_getDSecond() return DSecond;
+ */
+ public IntegerValue fx_getDSecond() {
+ return _externalFunctionsPluginProvider.fx_getDSecond();
+ }
+
+ /**
+ * External function to compute timestamp based on current time
+ * @return Unix-Epoch-Time mod 2^32
+ *
+ * TTCN-3 signature:
+ * external function fx_computeGnTimestamp() return UInt32;
+ */
+ @Override
+ public IntegerValue fx_computeGnTimestamp() {
+ return _externalFunctionsPluginProvider.fx_computeGnTimestamp();
+
+ }
+
+ /**
+ * @desc Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3
+ * @param p_sourceAddress Source address,
+ * @param p_destinationAddress Destination address
+ * @param p_payloadLength Upper-Layer Packet Length
+ * @param p_payload Upper-Layer payload
+ * @param p_nextHdr Next header value (e.g. 0x3a for ICMPv6)
+ * @return The checksum value
+ * @see RFC 2460 IPv6 Specification
+ *
+ * TTCN-3 signature:
+ * external function fx_computeIPv6CheckSum(
+ * in template (value) Ipv6Address p_sourceAddress,
+ * in template (value) Ipv6Address p_destinationAddress,
+ * in template (value) integer p_payloadLength,
+ * in template (value) octetstring p_payload,
+ * in template (value) integer p_nextHdr
+ * ) return Oct2;
+ * <pre>
+ * Pseudo header is defined by RFC 2460 - Clause 8.1
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | |
+ * + +
+ * | |
+ * + Source Address +
+ * | |
+ * + +
+ * | |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | |
+ * + +
+ * | |
+ * + Destination Address +
+ * | |
+ * + +
+ * | |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Upper-Layer Packet Length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | zero | Next Header |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * </pre>
+ */
+ @Override
+ public OctetstringValue fx_computeIPv6CheckSum(
+ OctetstringValue p_sourceAddress,
+ OctetstringValue p_destinationAddress,
+ IntegerValue p_payloadLength,
+ OctetstringValue p_payload,
+ IntegerValue p_nextHdr
+ ) {
+ return _externalFunctionsPluginProvider.fx_computeIPv6CheckSum(p_sourceAddress, p_destinationAddress, p_payloadLength, p_payload, p_nextHdr);
+ }
+
+ @Override
+ public OctetstringValue xf_parseIpv6Address(final CharstringValue p_textIpv6Address) {
+ return _externalFunctionsPluginProvider.xf_parseIpv6Address(p_textIpv6Address);
+ }
+
+ /**
+ * @desc Produces a 256-bit (32-byte) hash value
+ * @param p_toBeHashedData Data to be used to calculate the hash value
+ * @return The hash value
+ */
+ @Override
+ public OctetstringValue fx_hashWithSha256(final OctetstringValue p_toBeHashedData) {
+ return _externalFunctionsPluginProvider.fx_hashWithSha256(p_toBeHashedData);
+ }
+
+ /**
+ * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee
+ * @param p_toBeSignedData The data to be signed
+ * @param p_privateKey The private key
+ * @return The signature value
+ */
+ @Override
+ public OctetstringValue fx_signWithEcdsaNistp256WithSha256(final OctetstringValue p_toBeSignedData, final OctetstringValue p_privateKey) {
+ return _externalFunctionsPluginProvider.fx_signWithEcdsaNistp256WithSha256(p_toBeSignedData, p_privateKey);
+ }
+
+ /**
+ * @desc Verify the signature of the specified data
+ * @param p_toBeVerifiedData The data to be verified
+ * @param p_signature The signature
+ * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate)
+ * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate)
+ * @return true on success, false otherwise
+ */
+ @Override
+ public BooleanValue fx_verifyWithEcdsaNistp256WithSha256(final OctetstringValue p_toBeVerifiedData, final OctetstringValue p_signature, final OctetstringValue p_ecdsaNistp256PublicKeyX, final OctetstringValue p_ecdsaNistp256PublicKeyY) {
+ return _externalFunctionsPluginProvider.fx_verifyWithEcdsaNistp256WithSha256(p_toBeVerifiedData, p_signature, p_ecdsaNistp256PublicKeyX, p_ecdsaNistp256PublicKeyY);
+ }
+
+ /**
+ * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm
+ * @param p_privateKey The new private key value
+ * @param p_publicKeyX The new public key value (x coordinate)
+ * @param p_publicKeyX The new public key value (y coordinate)
+ * @return true on success, false otherwise
+ */
+ @Override
+ public BooleanValue fx_generateKeyPair(OctetstringValue p_privateKey, OctetstringValue p_publicKeyX, OctetstringValue p_publicKeyY) {
+ return _externalFunctionsPluginProvider.fx_generateKeyPair(p_privateKey, p_publicKeyX, p_publicKeyY);
+ }
+
+ /**
+ * @desc Check that given polygon doesn't have neither self-intersections nor holes.
+ * @param p_region Polygonal Region
+ * @return true on success, false otherwise
+ */
+ @Override
+ public BooleanValue fx_isValidPolygonalRegion(RecordOfValue p_region) {
+ return _externalFunctionsPluginProvider.fx_isValidPolygonalRegion(p_region);
+ }
+
+ @Override
+ public BooleanValue fx_isPolygonalRegionInside(RecordOfValue p_parent, RecordOfValue p_region) {
+ return _externalFunctionsPluginProvider.fx_isPolygonalRegionInside(p_parent, p_region);
+ }
+
+ @Override
+ public BooleanValue fx_isLocationInsideCircularRegion(RecordValue p_region, RecordValue p_location) {
+ return _externalFunctionsPluginProvider.fx_isLocationInsideCircularRegion(p_region, p_location);
+ }
+
+ @Override
+ public BooleanValue fx_isLocationInsideRectangularRegion(RecordOfValue p_region, RecordValue p_location) {
+ return _externalFunctionsPluginProvider.fx_isLocationInsideRectangularRegion(p_region, p_location);
+ }
+
+ @Override
+ public BooleanValue fx_isLocationInsidePolygonalRegion(final RecordOfValue p_region, final RecordValue p_location) {
+ return _externalFunctionsPluginProvider.fx_isLocationInsidePolygonalRegion(p_region, p_location);
+ }
+
+ @Override
+ public BooleanValue fx_isLocationInsideIdentifiedRegion(RecordValue p_region, RecordValue p_location) {
+ return _externalFunctionsPluginProvider.fx_isLocationInsideIdentifiedRegion(p_region, p_location);
+ }
+
+ @Override
+ public FloatValue fx_dms2dd(IntegerValue p_degrees, IntegerValue p_minutes, FloatValue p_seconds, OctetstringValue p_latlon) {
+ return _externalFunctionsPluginProvider.fx_dms2dd(p_degrees, p_minutes, p_seconds, p_latlon);
+ }
+
+ @Override
+ public BooleanValue fx_loadCertificates(CharstringValue p_rootDirectory, CharstringValue p_configId) {
+ return _externalFunctionsPluginProvider.fx_loadCertificates(p_rootDirectory, p_configId);
+ }
+
+ @Override
+ public BooleanValue fx_unloadCertificates() {
+ return _externalFunctionsPluginProvider.fx_unloadCertificates();
+ }
+
+ @Override
+ public BooleanValue fx_readCertificate(CharstringValue p_certificateName, OctetstringValue p_certificate) {
+ return _externalFunctionsPluginProvider.fx_readCertificate(p_certificateName, p_certificate);
+ }
+
+ @Override
+ public BooleanValue fx_readCertificateDigest(CharstringValue p_certificateName, OctetstringValue p_digest) {
+ return _externalFunctionsPluginProvider.fx_readCertificateDigest(p_certificateName, p_digest);
+ }
+
+ @Override
+ public BooleanValue fx_readSigningKey(CharstringValue p_certificateName, OctetstringValue p_privateKey) {
+ return _externalFunctionsPluginProvider.fx_readSigningKey(p_certificateName, p_privateKey);
+ }
+
+ @Override
+ public BooleanValue fx_readEncryptingKey(CharstringValue p_certificateName, OctetstringValue p_privateKey) {
+ return _externalFunctionsPluginProvider.fx_readEncryptingKey(p_certificateName, p_privateKey);
+ }
+
+}
/AdapterFramework/javasrc/tool/org/etsi/ttcn/tool/spirent/xf/ExternalFunctionsPluginProvider.java
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+URL Author Date Rev Id
\ No newline at end of property