Rev

Rev 2398 | Details | Compare with Previous | Last modification | View Log | SVN | Bug Tracker

Rev Author Line No. Line
370 garciay 1
/**
2655 filatov 2
 * @author    STF 424_ITS_Test_Platform
3
 * @version    $id$
370 garciay 4
 */
360 garciay 5
package org.etsi.its.extfunc;
6
 
1822 berge 7
import org.etsi.ttcn.tci.BooleanValue;
953 berge 8
import org.etsi.ttcn.tci.CharstringValue;
360 garciay 9
import org.etsi.ttcn.tci.FloatValue;
10
import org.etsi.ttcn.tci.IntegerValue;
768 garciay 11
import org.etsi.ttcn.tci.OctetstringValue;
1822 berge 12
import org.etsi.ttcn.tci.RecordOfValue;
13
import org.etsi.ttcn.tci.RecordValue;
360 garciay 14
 
463 garciay 15
/**
16
 * This interface provides the list of the TTCN-3 external function to be implemented
363 garciay 17
 *
18
 * Refer to TTCN-3 modules LibItsGeoNetworking_Functions and LibItsCommon_Functions
19
 */
360 garciay 20
public interface IItsExternalFunctionsProvider {
21
 
2655 filatov 22
    /**
23
     * This external function gets the current time
24
     * @return The current time in Epoch format
25
     *
26
     * TTCN-3 signature:
27
     * external function fx_getCurrentTime() return TimestampIts;
28
     */
29
    public IntegerValue fx_getCurrentTime();
360 garciay 30
 
2655 filatov 31
    /**
32
     * This external function gets the tenths of a second in the current or next hour in units of 1/10th second from UTC time
33
     * @return The current time in tenths of a second in the current or next hour in units of 1/10th second from UTC time
34
     *
35
     * TTCN-3 signature:
36
     * external function fx_getCurrentTimeMark() return TimeMark;
37
     */
38
    public IntegerValue fx_getCurrentTimeMark();
363 garciay 39
 
2655 filatov 40
    /**
41
     * This external function gets the minutes of current UTC year
42
     * @return The minutes of current UTC year
43
     *
44
     * TTCN-3 signature:
45
     * external function fx_getMinuteOfTheYear() return MinuteOfTheYear;
46
     */
47
    public IntegerValue fx_getMinuteOfTheYear();
48
 
49
    /**
50
     * This external function gets the milliseconds point in the current UTC minute
51
     * @return The milliseconds point in the current UTC minute (0..60000)
52
     *
53
     * TTCN-3 signature:
54
     * external function fx_getDSecond() return DSecond;
55
     */
56
    public IntegerValue fx_getDSecond();
57
 
58
    /**
59
     * This external function gets the current time
60
     * @param p_latitudeA Latitude of node A
61
     * @param p_longitudeA Longitude of node A
62
     * @param p_latitudeB Latitude of node B
63
     * @param p_longitudeB Longitude of node B
64
     * @return The current time in Epoch format
65
     *
66
     * TTCN-3 signature:
67
     * external function fx_computeDistance(in UInt32 p_latitudeA, in UInt32 p_longitudeA, in UInt32 p_latitudeB, in UInt32 p_longitudeB) return float;
68
     */
69
    public FloatValue fx_computeDistance(final IntegerValue p_latitudeA, final IntegerValue p_longitudeA, final IntegerValue p_latitudeB, final IntegerValue p_longitudeB);
70
 
71
    /**
72
     * External function to compute a position using a reference position, a distance and an orientation
73
     * @param p_iutLongPosVector Reference position
74
     * @param p_distance Distance to the reference position (in meter)
75
     * @param p_orientation Direction of the computed position (0 to 359; 0 means North)
76
     * @param p_latitude Computed position's latitude
77
     * @param p_longitude Computed position's longitude
78
     *
79
     * TTCN-3 signature:
80
     * external function fx_computePositionUsingDistance(in UInt32 p_refLatitude, in Uint32 p_refLongitude, in integer p_distance, in integer p_orientation, out UInt32 p_latitude, out UInt32 p_longitude);
81
     */
82
    public void fx_computePositionUsingDistance(final IntegerValue p_refLatitude, final IntegerValue p_refLongitude, final FloatValue p_distance, final IntegerValue p_orientation, IntegerValue p_latitude, IntegerValue p_longitude);
83
 
84
    /**
85
     * External function to compute a position using a reference position, a distance and an orientation
86
     * @param p_iutLongPosVector Reference position
87
     * @param p_rotation Rotation value (in degrees)
88
     * @param p_latitude Computed position's latitude
89
     * @param p_longitude Computed position's longitude
90
     *
91
     * TTCN-3 signature:
92
     * external function fx_computePositionFromRotation(in UInt32 p_refLatitude, in Uint32 p_refLongitude, in Uint32 p_cenLatitude, in Uint32 p_cenLongitude, in Int32 p_rotation, out UInt32 p_latitude, out UInt32 p_longitude);
93
     */
94
    public void fx_computePositionFromRotation(final IntegerValue p_refLatitude, final IntegerValue p_refLongitude, final IntegerValue p_cenLatitude, final IntegerValue p_cenLongitude, final IntegerValue p_rotation, IntegerValue p_latitude, IntegerValue p_longitude);
95
 
96
    /**
1423 filatov 97
     * External function to compute radius of a given circular area
98
     * @param   p_squareMeters  Square meters of an circular area
99
     * @return  Computed radius in meters
100
     */
101
    public FloatValue fx_computeRadiusFromCircularArea(final FloatValue p_squareMeters);
2655 filatov 102
 
103
    /**
653 berge 104
     * External function to compute timestamp based on current time
105
     * @return  Unix-Epoch-Time mod 2^32
106
     *
107
     * TTCN-3 signature:
108
     * external function fx_computeGnTimestamp() return UInt32;
109
     */
110
     public IntegerValue fx_computeGnTimestamp();
768 garciay 111
 
112
     /**
113
      * @desc    Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3
114
      * @param   p_sourceAddress         Source address,
115
      * @param   p_destinationAddress    Destination address
776 garciay 116
      * @param   p_payloadLength         Upper-Layer Packet Length
117
      * @param   p_payload               Upper-Layer payload
768 garciay 118
      * @param   p_nextHdr               Next header value (e.g. 0x3a for ICMPv6)
119
      * @return  The checksum value
776 garciay 120
      * @see     RFC 2460 IPv6 Specification
768 garciay 121
      *
122
      * TTCN-3 signature:
123
      * external function fx_computeIPv6CheckSum(
124
      *     in template (value) Ipv6Address p_sourceAddress,
125
      *     in template (value) Ipv6Address p_destinationAddress,
776 garciay 126
      *     in template (value) integer p_payloadLength,
127
      *     in template (value) octetstring p_payload,
128
      *     in template (value) integer p_nextHdr
768 garciay 129
      * ) return Oct2;
130
      * <pre>
131
      * Pseudo header is defined by RFC 2460 - Clause 8.1
132
      *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
133
      *  |                                                               |
134
      *  +                                                               +
135
      *  |                                                               |
136
      *  +                         Source Address                        +
137
      *  |                                                               |
138
      *  +                                                               +
139
      *  |                                                               |
140
      *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
141
      *  |                                                               |
142
      *  +                                                               +
143
      *  |                                                               |
144
      *  +                      Destination Address                      +
145
      *  |                                                               |
146
      *  +                                                               +
147
      *  |                                                               |
148
      *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
149
      *  |                   Upper-Layer Packet Length                   |
150
      *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
151
      *  |                      zero                     |  Next Header  |
152
      *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
153
      * </pre>
154
      */
155
     public OctetstringValue fx_computeIPv6CheckSum(
156
             final OctetstringValue p_sourceAddress,
157
             final OctetstringValue p_destinationAddress,
776 garciay 158
             final IntegerValue p_payloadLength,
159
             final OctetstringValue p_payload,
160
             final IntegerValue p_nextHdr
768 garciay 161
     );
162
 
953 berge 163
     public OctetstringValue xf_parseIpv6Address(final CharstringValue p_textIpv6Address);
1822 berge 164
 
165
     /**
166
      * @desc    Produces a 256-bit (32-byte) hash value
167
      * @param   p_toBeHashedData Data to be used to calculate the hash value
168
      * @return  The hash value
169
      */
170
     public OctetstringValue fx_hashWithSha256(final OctetstringValue p_toBeHashedData);
171
 
172
     /**
173
      * @desc    Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee
174
      * @param   p_toBeSignedData    The data to be signed
175
      * @param   p_privateKey        The private key
176
      * @return  The signature value
177
      */
178
     public OctetstringValue fx_signWithEcdsaNistp256WithSha256(final OctetstringValue p_toBeSignedData, final OctetstringValue/*IntegerValue*/ p_privateKey);
179
 
180
     /**
181
      * @desc    Verify the signature of the specified data
182
      * @param   p_toBeVerifiedData          The data to be verified
183
      * @param   p_signature                 The signature
184
      * @param   p_ecdsaNistp256PublicKeyX   The public key (x coordinate)
185
      * @param   p_ecdsaNistp256PublicKeyY   The public key (y coordinate)
186
      * @return  true on success, false otherwise
187
      */
188
     public BooleanValue fx_verifyWithEcdsaNistp256WithSha256(final OctetstringValue p_toBeVerifiedData, final OctetstringValue p_signature, final OctetstringValue p_ecdsaNistp256PublicKeyX, final OctetstringValue p_ecdsaNistp256PublicKeyY);
189
 
190
     /**
191
      * @desc    Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm
192
      * @param   p_privateKey    The new private key value
193
      * @param   p_publicKeyX    The new public key value (x coordinate)
194
      * @param   p_publicKeyX    The new public key value (y coordinate)
195
      * @return  true on success, false otherwise
196
      */
197
     public BooleanValue fx_generateKeyPair(OctetstringValue/*IntegerValue*/ p_privateKey, OctetstringValue p_publicKeyX, OctetstringValue p_publicKeyY);
198
 
199
     /**
200
      * @desc    Check that given polygon doesn't have neither self-intersections nor holes.
201
      * @param   p_region   Polygonal Region
202
      * @return  true on success, false otherwise
203
      */
204
     public BooleanValue fx_isValidPolygonalRegion(final RecordOfValue p_region);
205
 
206
     /**
207
      * @desc Check if a polygonal regin is inside another one
208
      * @param p_parent  The main polygonal region
209
      * @param p_region  The polygonal region to be included
210
      * @return true on success, false otherwise
211
      * @verdict Unchanged
212
      */
213
     public BooleanValue fx_isPolygonalRegionInside(final RecordOfValue p_parent, final RecordOfValue p_region);
214
 
215
     /**
216
      * @desc Check that the location is inside a circular region
217
      * @param p_region      The circular region to consider
218
      * @param p_location    The device location
219
      * @return true on success, false otherwise
220
      * @verdict Unchanged
221
      */
222
     public BooleanValue fx_isLocationInsideCircularRegion(final RecordValue p_region, final RecordValue p_location);
223
 
224
     /**
225
      * @desc Check that the location is inside a rectangular region
226
      * @param p_region      The rectangular region to consider
227
      * @param p_location    The device location
228
      * @return true on success, false otherwise
229
      * @verdict Unchanged
230
      */
231
     public BooleanValue fx_isLocationInsideRectangularRegion(final RecordOfValue p_region, final RecordValue p_location);
232
 
233
     /**
234
      * @desc Check that the location is inside a polygonal region
235
      * @param p_region      The polygonal region to consider
236
      * @param p_location    The device location
237
      * @return true on success, false otherwise
238
      * @verdict Unchanged
239
      */
240
     public BooleanValue fx_isLocationInsidePolygonalRegion(final RecordOfValue p_region, final RecordValue p_location);
241
 
242
     /**
243
      * @desc Check if the location is inside an identified region
244
      * @param p_region      The identified region to consider
245
      * @param p_location    The device location
246
      * @return true on success, false otherwise
247
      * @verdict Unchanged
248
      */
249
     public BooleanValue fx_isLocationInsideIdentifiedRegion(final RecordValue p_region, final RecordValue p_location);
250
 
251
     /**
252
      * @desc Convert a spacial coordinate from DMS to Dms
253
      * @param p_degrees The degrees (D)
254
      * @param p_minutes The minutes (M)
255
      * @param p_seconds The seconds (S)
256
      * @param p_latlon  The latitude/longitude: (N|S|E|W)
257
      * @return The decimal coordinate on success, 0.0, otherwise
258
      * @verdict Unchanged
259
      */
260
     public FloatValue fx_dms2dd(final IntegerValue p_degrees, final IntegerValue p_minutes, final FloatValue p_seconds, final OctetstringValue p_latlon);
261
 
262
     /**
263
      * @desc    Load in memory cache the certificates available in the specified directory
264
      * @param   p_rootDirectory Root directory to access to the certificates identified by the certificate ID
265
      * @param   p_configId      A configuration identifier
266
      * @return  true on success, false otherwise
267
      */
268
     public BooleanValue fx_loadCertificates(final CharstringValue p_rootDirectory, final CharstringValue p_configId);
269
 
270
     /**
271
      * @desc    Unload from memory cache the certificates
272
      * @return  true on success, false otherwise
273
      */
274
     public BooleanValue fx_unloadCertificates();
275
 
276
     /**
277
      * @desc    Read the specified certificate
278
      * @param   p_certificateId the certificate identifier
279
      * @param   p_certificate   the expected certificate
280
      * @return  true on success, false otherwise
281
      */
282
     public BooleanValue fx_readCertificate(final CharstringValue p_certificateId, OctetstringValue p_certificate);
283
 
2230 mullers 284
     /**
285
      * @desc    Read the specified certificate digest
286
      * @param   p_certificateId the certificate identifier
287
      * @param   p_certificate   the expected certificate
288
      * @return  true on success, false otherwise
289
      */
290
     public BooleanValue fx_readCertificateDigest(final CharstringValue p_certificateId, OctetstringValue p_certificate);
1822 berge 291
 
292
     /**
2230 mullers 293
      * @desc    Read the signing private key for the specified certificate
294
      * @param   p_keysId the keys identifier
295
      * @param   p_key    the signing private key
1822 berge 296
      * @return  true on success, false otherwise
297
      */
2230 mullers 298
     public BooleanValue fx_readSigningKey(final CharstringValue p_keysId, OctetstringValue p_key);
1822 berge 299
 
2230 mullers 300
     /**
301
      * @desc    Read the encrypting private key for the specified certificate
302
      * @param   p_keysId  the keys identifier
303
      * @param   p_key     the encrypt private key
304
      * @return  true on success, false otherwise
305
      */
306
     public BooleanValue fx_readEncryptingKey(final CharstringValue p_keysId, OctetstringValue p_key);
307
 
1822 berge 308
} // End of interface IItsExternalFunctionsProvider