Newer
Older
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
+ fx_checkUperEncoding ( in RawData p_rawData ) return boolean;
+*/
+BOOLEAN fx__checkUperEncoding(const OCTETSTRING& p__rawData)
+{
+ return TRUE;
+}
+
+} //end namespace
Index: Externals/LibItsSecurity_externals.cc
===================================================================
--- Externals/LibItsSecurity_externals.cc (nonexistent)
+++ Externals/LibItsSecurity_externals.cc (working copy)
@@ -0,0 +1,302 @@
+#include "LibItsSecurity_Functions.hh"
+
+namespace LibItsSecurity__Functions
+{
+// group signing
+/* * @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
+ fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32;
+*/
+OCTETSTRING fx__hashWithSha256(
+ const OCTETSTRING& p__toBeHashedData
+) {
+//RGY when implementing, look at TCC_Useful_functions/TCCSecurity_Functions
+ OCTETSTRING ret_val = int2oct(0,1);
+ return ret_val;
+}
+
+/* * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee
+ * @param p_toBeSignedSecuredMessage The data to be signed
+ * @param p_privateKey The private key
+ * @return The signature value
+ fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in octetstring<UInt64> p_privateKey) return octetstring;
+*/
+OCTETSTRING fx__signWithEcdsaNistp256WithSha256(
+ const OCTETSTRING& p__toBeSignedSecuredMessage,
+ const OCTETSTRING& p__privateKey
+) {
+ OCTETSTRING ret_val = int2oct(0,1);
+ return ret_val;
+}
+
+/* * @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
+ fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in octetstring p_ecdsaNistp256PublicKeyX, in octetstring p_ecdsaNistp256PublicKeyY) return boolean;
+*/
+BOOLEAN fx__verifyWithEcdsaNistp256WithSha256(
+ const OCTETSTRING& p__toBeVerifiedData,
+ const OCTETSTRING& p__signature,
+ const OCTETSTRING& p__ecdsaNistp256PublicKeyX,
+ const OCTETSTRING& p__ecdsaNistp256PublicKeyY
+) {
+ return TRUE;
+}
+
+/* * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm.
+ * This function should not be used by the ATS
+ * @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
+ fx_generateKeyPair(out octetstring<UInt64> p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean;
+*/
+BOOLEAN fx__generateKeyPair(
+ OCTETSTRING& p__privateKey,
+ OCTETSTRING& p__publicKeyX,
+ OCTETSTRING& p__publicKeyY
+) {
+ return TRUE;
+}
+
+// group encryption
+
+// group certificatesLoader
+
+/* * @desc Load in memory cache the certificates available in the specified directory
+ * @param p_rootDirectory Root directory to access to the certificates identified by the certificate ID
+ * @param p_configId A configuration identifier
+ * @remark This method SHALL be call before any usage of certificates
+ * @return true on success, false otherwise
+ fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean;
+*/
+BOOLEAN fx__loadCertificates(
+ const CHARSTRING& p__rootDirectory,
+ const CHARSTRING& p__configId
+) {
+ return TRUE;
+}
+
+/* * @desc Unload from memory cache the certificates
+ * @return true on success, false otherwise
+ fx_unloadCertificates() return boolean;
+*/
+BOOLEAN fx__unloadCertificates(
+) {
+ return TRUE;
+}
+
+/* * @desc Read the specified certificate
+ * @param p_certificateId the certificate identifier
+ * @param p_certificate the expected certificate
+ * @return true on success, false otherwise
+ fx_readCertificate(in charstring p_certificateId, out octetstring p_certificate) return boolean;
+*/
+BOOLEAN fx__readCertificate(
+ const CHARSTRING& p__certificateId,
+ OCTETSTRING& p__certificate
+) {
+ return TRUE;
+}
+
+
+/* * @desc Read the specified certificate digest
+ * @param p_certificateId the certificate identifier
+ * @param p_digest the expected certificate
+ * @return true on success, false otherwise
+ fx_readCertificateDigest(in charstring p_certificateId, out HashedId8 p_digest) return boolean;
+*/
+BOOLEAN fx__readCertificateDigest(
+ const CHARSTRING& p__certificateId,
+ OCTETSTRING& p__digest
+) {
+ return TRUE;
+}
+
+/* * @desc Read the private keys for the specified certificate
+ * @param p_keysId the keys identifier
+ * @param p_signingPrivateKey the signing private key
+ * @return true on success, false otherwise
+ fx_readSigningKey(in charstring p_keysId, out Oct32 p_signingPrivateKey) return boolean;
+*/
+BOOLEAN fx__readSigningKey(
+ const CHARSTRING& p__keysId,
+ OCTETSTRING& p__signingPrivateKey
+) {
+ return TRUE;
+}
+
+/* * @desc Read the private keys for the specified certificate
+ * @param p_keysId the keys identifier
+ * @param p_encryptPrivateKey the encrypt private key
+ * @return true on success, false otherwise
+ fx_readEncryptingKey(in charstring p_keysId, out Oct32 p_encryptingPrivateKey) return boolean;
+*/
+BOOLEAN fx__readEncryptingKey(
+ const CHARSTRING& p__keysId,
+ OCTETSTRING& p__encryptingPrivateKey
+) {
+ return TRUE;
+}
+
+// group geodesic
+
+/* * @desc Check that given polygon doesn't have neither self-intersections nor holes.
+ * @param p_region Polygonal Region
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isValidPolygonalRegion(in PolygonalRegion p_region) return boolean;
+*/
+BOOLEAN fx__isValidPolygonalRegion(
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p__region
+) {
+ return TRUE;
+}
+
+/* * @desc Check if a polygonal region is inside another one
+ * @param p_parent The main polygonal region
+ * @param p_region The polygonal region to be included
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isPolygonalRegionInside(in PolygonalRegion p_parent, in PolygonalRegion p_region) return boolean;
+*/
+BOOLEAN fx__isPolygonalRegionInside(
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p__parent,
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p__region
+) {
+ return TRUE;
+}
+
+/* * @desc Check that the location is inside a circular region
+ * @param p_region The circular region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsideCircularRegion(in CircularRegion p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsideCircularRegion(
+ const LibItsSecurity__TypesAndValues::CircularRegion& p__region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p__location
+) {
+ return TRUE;
+}
+
+/* * @desc Check that the location is inside a rectangular region
+ * @param p_region The rectangular region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsideRectangularRegion(in RectangularRegions p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsideRectangularRegion(
+ const LibItsSecurity__TypesAndValues::RectangularRegions& p__region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p__location
+) {
+ return TRUE;
+}
+
+/* * @desc Check that the location is inside a polygonal region
+ * @param p_region The polygonal region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsidePolygonalRegion(in PolygonalRegion p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsidePolygonalRegion(
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p__region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p__location
+) {
+ return TRUE;
+}
+
+
+/* * @desc Check if the location is inside an identified region
+ * @param p_region The identified region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsideIdentifiedRegion(in IdentifiedRegion p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsideIdentifiedRegion(
+ const LibItsSecurity__TypesAndValues::IdentifiedRegion& p__region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p__location
+) {
+ return TRUE;
+}
+
+/* * @desc Check if the location is inside an undefined region
+ * @param p_region The identified region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsideOtherRegion(in octetstring p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsideOtherRegion(
+ const OCTETSTRING& p_region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p_location
+) {
+ return TRUE;
+}
+
+/* * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region
+ * @param p_circular_region_1 Circular region 1
+ * @param p_circular_region_2 Circular region 2
+ * @return true on success, false otherwise
+ fx_areCirclesInside(in CircularRegion p_circular_region_1, in CircularRegion p_circular_region_2) return boolean;
+*/
+BOOLEAN fx__areCirclesInside(
+ const LibItsSecurity__TypesAndValues::CircularRegion& p_circular_region_1,
+ const LibItsSecurity__TypesAndValues::CircularRegion& p_circular_region_2
+) {
+ return TRUE;
+}
+
+/* * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region
+ * @param p_rectanglar_region_1 Rectangular region 1
+ * @param p_rectanglar_region_2 Rectangular region 2
+ * @return true on success, false otherwise
+ fx_areRectanglesInside(in RectangularRegions p_rectanglar_region_1, in RectangularRegions p_rectanglar_region_2) return boolean;
+*/
+BOOLEAN fx__areRectanglesInside(
+ const LibItsSecurity__TypesAndValues::RectangularRegions& p_rectanglar_region_1,
+ const LibItsSecurity__TypesAndValues::RectangularRegions& p_rectanglar_region_2
+) {
+ return TRUE;
+}
+
+/* * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region
+ * @param p_polygonal_region_1 Polygonal region 1
+ * @param p_polygonal_region_2 Polygonal region 2
+ * @return true on success, false otherwise
+ fx_arePolygonsInside(in PolygonalRegion p_polygonal_region_1, in PolygonalRegion p_polygonal_region_2) return boolean;
+*/
+BOOLEAN fx__arePolygonsInside(
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p_polygonal_region_1,
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p_polygonal_region_2
+) {
+ return TRUE;
+}
+
+/* * @desc Convert a spacial coordinate from DMS to Dms
+ * @param p_degrees The degrees (D)
+ * @param p_minutes The minutes (M)
+ * @param p_seconds The seconds (S)
+ * @param p_latlon The latitude/longitude: (N|S|E|W)
+ * @return The decimal coordinate on success, 0.0, otherwise
+ * @verdict Unchanged
+ fx_dms2dd(in Int p_degrees, in Int p_minutes, in float p_seconds, in Oct1 p_latlon) return float;
+*/
+FLOAT fx__dms2dd(
+ const INTEGER& p__degrees,
+ const INTEGER& p__minutes,
+ const FLOAT& p__seconds,
+ const OCTETSTRING& p__latlon
+) {
+ return 0.0;
+}
+
+} // end of namespace
Index: Externals/LibItsCommon_externals.cc
===================================================================
--- Externals/LibItsCommon_externals.cc (nonexistent)
+++ Externals/LibItsCommon_externals.cc (working copy)
@@ -0,0 +1,95 @@
+#include "LibItsCommon_Functions.hh"
+//#include "ITS_Container.hh"
+#include <time.h>
+#include <math.h>
+
+namespace LibItsCommon__Functions
+{
+
+/* * @desc This external function gets the current time
+ * @return Timestamp - current time since 01/01/2014 in milliseconds
+ fx_getCurrentTime() return TimestampIts;
+*/
+INTEGER fx__getCurrentTime(
+) {
+ unsigned long long timestamp2014 = 1356998400000;
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+ unsigned long long timestampNow = tv.tv_sec*1000 + tv.tv_usec/1000;
+
+// i.set_long_long_val(timestampNow - timestamp2014);
+// return i;
+ return INTEGER(timestampNow - timestamp2014);
+}
+
+/* * @desc External function to compute distance between two points
+ * @param p_latitudeA Latitude of first point
+ * @param p_longitudeA Longitude of first point
+ * @param p_latitudeB Latitude of second point
+ * @param p_longitudeB Longitude of second point
+ * @return Computed distance in meters
+ fx_computeDistance(in Int32 p_latitudeA, in Int32 p_longitudeA, in Int32 p_latitudeB, in Int32 p_longitudeB) return float;
+*/
+FLOAT fx__computeDistance(
+ const INTEGER& p__latitudeA,
+ const INTEGER& p__longitudeA,
+ const INTEGER& p__latitudeB,
+ const INTEGER& p__longitudeB
+) {
+ double d_latA = ((int)p__latitudeA)/10000000.0;
+ double d_latB = ((int)p__latitudeB)/10000000.0;
+
+ double d_lonA = ((int)p__longitudeA)/10000000.0;
+ double d_lonB = ((int)p__longitudeB)/10000000.0;
+
+ double earth_radius = 6371000.0; //meters
+
+ double d_lat = (d_latB - d_latA) *M_PI/180.0;
+ double d_lon = (d_lonB - d_lonA)*M_PI/180.0;
+
+ double a = sin(d_lat/2)*sin(d_lat/2) + cos(d_latA*M_PI/180.0)*cos(d_latB*M_PI/180.0)*sin(d_lon/2)*sin(d_lon/2);
+ double c = 2*atan2(sqrt(a), sqrt(1-a));
+
+ return FLOAT(earth_radius*c);
+
+}
+
+/* * @desc External function to compute a position using a reference position, a distance and an orientation
+ * @param p_iutLongPosVector Reference position
+ * @param p_distance Distance to the reference position (in meter)
+ * @param p_orientation Direction of the computed position (0 to 359; 0 means North)
+ * @param p_latitude Computed position's latitude
+ * @param p_longitude Computed position's longitude
+ fx_computePositionUsingDistance(in Int32 p_refLatitude,in Int32 p_refLongitude,in float p_distance,in integer p_orientation,out Int32 p_latitude,out Int32 p_longitude);
+*/
+void fx__computePositionUsingDistance(
+ const INTEGER& p__refLatitude,
+ const INTEGER& p__refLongitude,
+ const FLOAT& p__distance,
+ const INTEGER& p__orientation,
+ INTEGER& p__latitude,
+ INTEGER& p__longitude
+) {
+ double distance = p__distance/6371000.0;
+ double angle = p__orientation*M_PI/180.0;
+
+ double ref_lat = p__refLatitude*M_PI/180.0;
+ double ref_lon = p__refLongitude*M_PI/180.0;
+
+ p__latitude = asin(sin(ref_lat)*cos(distance) + cos(ref_lat)*sin(distance)*cos(angle))*180/M_PI;
+ p__longitude = p__refLongitude + atan2(sin(angle)*sin(distance)*cos(ref_lat), cos(distance) - sin(ref_lat)*sin(p__latitude))*180/M_PI;
+}
+
+/* * @desc External function to compute radius of a given circular area
+ * @param p_squareMeters Square meters of an circular area
+ * @return Computed radius in meters
+ fx_computeRadiusFromCircularArea(in float p_squareMeters) return float;
+*/
+FLOAT fx__computeRadiusFromCircularArea(
+ const FLOAT& p__squareMeters
+) {
+ return FLOAT(sqrt(p__squareMeters/M_PI));
+}
+
+} // end of Namespace
Index: Externals/LibItsDcc_externals.cc
===================================================================
--- Externals/LibItsDcc_externals.cc (nonexistent)
+++ Externals/LibItsDcc_externals.cc (working copy)
@@ -0,0 +1,12 @@
+#include "LibItsDcc_Functions.hh"
+
+namespace LibItsDcc__Functions
+{
+/* * @desc Returns the string representation of the float value
+ * @param p_float The float value
+ * @return The string representation of the float value
+ fx_float2str(float p_float) return charstring;
+*/
+//RGY no C++ implementation is needed, Titan supports this function natively
+
+} // end of namespace
Index: Externals/LibItsGeoNetworking_externals.cc
===================================================================
--- Externals/LibItsGeoNetworking_externals.cc (nonexistent)
+++ Externals/LibItsGeoNetworking_externals.cc (working copy)
@@ -0,0 +1,24 @@
+#include "LibItsGeoNetworking_Functions.hh"
+#include <time.h>
+#include <math.h>
+
+namespace LibItsGeoNetworking__Functions
+{
+/* * @desc External function to compute timestamp based on current time
+ * @return Unix-Epoch-Time mod 2^32
+ fx_computeGnTimestamp() return UInt32;
+*/
+INTEGER fx__computeGnTimestamp(
+) {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+// unsigned long long timestampNow = tv.tv_sec*1000 + tv.tv_usec/1000;
+ long long timestampNow = tv.tv_sec*1000 + tv.tv_usec/1000;
+ INTEGER i = INTEGER();
+ i.set_long_long_val(timestampNow % 4294967296);
+// return INTEGER(timestampNow % 4294967296);
+ return i;
+}
+
+} //end namespace
Index: Externals/LibItsIpv6OverGeoNetworking_externals.cc
===================================================================
--- Externals/LibItsIpv6OverGeoNetworking_externals.cc (nonexistent)
+++ Externals/LibItsIpv6OverGeoNetworking_externals.cc (working copy)
@@ -0,0 +1,58 @@
+#include "LibItsIpv6OverGeoNetworking_Functions.hh"
+#include <time.h>
+#include <math.h>
+
+namespace LibItsIpv6OverGeoNetworking__Functions
+{
+/* * @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
+ * <pre>
+ * Pseudo header is defined by RFC 2460 - Clause 8.1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | |
+ * + +
+ * | |
+ * + Source Address +
+ * | |
+ * + +
+ * | |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | |
+ * + +
+ * | |
+ * + Destination Address +
+ * | |
+ * + +
+ * | |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Upper-Layer Packet Length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | zero | Next Header |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * </pre>
+ 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) UInt8 p_nextHdr
+ ) return Oct2;
+*/
+
+OCTETSTRING fx__computeIPv6CheckSum(
+ const OCTETSTRING_template& p__sourceAddress,
+ const OCTETSTRING_template& p__destinationAddress,
+ const INTEGER_template& p__payloadLength,
+ const OCTETSTRING_template& p__payload,
+ const INTEGER_template& p__nextHdr
+) {
+ OCTETSTRING ret_val = int2oct(0,1);
+ return ret_val;
+}
+
+} //end namespace
Index: Externals/LibItsMapemSpatem_externals.cc
===================================================================
--- Externals/LibItsMapemSpatem_externals.cc (nonexistent)
+++ Externals/LibItsMapemSpatem_externals.cc (working copy)
@@ -0,0 +1,18 @@
+#include "LibItsMapemSpatem_externals.hh"
+#include <time.h>
+#include <math.h>
+
+namespace LibItsMapemSpatem__externals
+{
+/*FIXME RGY @desc sounds like a copy-paste, not as the real purpose of the function
+ * @desc External function to compute distance between two points
+ * @param p_rawData Octetstring to analyse
+ * @return true or false according to the check
+ fx_checkUperEncoding ( in RawData p_rawData ) return boolean;
+*/
+BOOLEAN fx__checkUperEncoding(const OCTETSTRING& p__rawData)
+{
+ return TRUE;
+}
+
+} //end namespace
Index: Externals/LibItsSecurity_externals.cc
===================================================================
--- Externals/LibItsSecurity_externals.cc (nonexistent)
+++ Externals/LibItsSecurity_externals.cc (working copy)
@@ -0,0 +1,302 @@
+#include "LibItsSecurity_Functions.hh"
+
+namespace LibItsSecurity__Functions
+{
+// group signing
+/* * @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
+ fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32;
+*/
+OCTETSTRING fx__hashWithSha256(
+ const OCTETSTRING& p__toBeHashedData
+) {
+//RGY when implementing, look at TCC_Useful_functions/TCCSecurity_Functions
+ OCTETSTRING ret_val = int2oct(0,1);
+ return ret_val;
+}
+
+/* * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee
+ * @param p_toBeSignedSecuredMessage The data to be signed
+ * @param p_privateKey The private key
+ * @return The signature value
+ fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedSecuredMessage, in octetstring<UInt64> p_privateKey) return octetstring;
+*/
+OCTETSTRING fx__signWithEcdsaNistp256WithSha256(
+ const OCTETSTRING& p__toBeSignedSecuredMessage,
+ const OCTETSTRING& p__privateKey
+) {
+ OCTETSTRING ret_val = int2oct(0,1);
+ return ret_val;
+}
+
+/* * @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
+ fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in octetstring p_ecdsaNistp256PublicKeyX, in octetstring p_ecdsaNistp256PublicKeyY) return boolean;
+*/
+BOOLEAN fx__verifyWithEcdsaNistp256WithSha256(
+ const OCTETSTRING& p__toBeVerifiedData,
+ const OCTETSTRING& p__signature,
+ const OCTETSTRING& p__ecdsaNistp256PublicKeyX,
+ const OCTETSTRING& p__ecdsaNistp256PublicKeyY
+) {
+ return TRUE;
+}
+
+/* * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm.
+ * This function should not be used by the ATS
+ * @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
+ fx_generateKeyPair(out octetstring<UInt64> p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean;
+*/
+BOOLEAN fx__generateKeyPair(
+ OCTETSTRING& p__privateKey,
+ OCTETSTRING& p__publicKeyX,
+ OCTETSTRING& p__publicKeyY
+) {
+ return TRUE;
+}
+
+// group encryption
+
+// group certificatesLoader
+
+/* * @desc Load in memory cache the certificates available in the specified directory
+ * @param p_rootDirectory Root directory to access to the certificates identified by the certificate ID
+ * @param p_configId A configuration identifier
+ * @remark This method SHALL be call before any usage of certificates
+ * @return true on success, false otherwise
+ fx_loadCertificates(in charstring p_rootDirectory, in charstring p_configId) return boolean;
+*/
+BOOLEAN fx__loadCertificates(
+ const CHARSTRING& p__rootDirectory,
+ const CHARSTRING& p__configId
+) {
+ return TRUE;
+}
+
+/* * @desc Unload from memory cache the certificates
+ * @return true on success, false otherwise
+ fx_unloadCertificates() return boolean;
+*/
+BOOLEAN fx__unloadCertificates(
+) {
+ return TRUE;
+}
+
+/* * @desc Read the specified certificate
+ * @param p_certificateId the certificate identifier
+ * @param p_certificate the expected certificate
+ * @return true on success, false otherwise
+ fx_readCertificate(in charstring p_certificateId, out octetstring p_certificate) return boolean;
+*/
+BOOLEAN fx__readCertificate(
+ const CHARSTRING& p__certificateId,
+ OCTETSTRING& p__certificate
+) {
+ return TRUE;
+}
+
+
+/* * @desc Read the specified certificate digest
+ * @param p_certificateId the certificate identifier
+ * @param p_digest the expected certificate
+ * @return true on success, false otherwise
+ fx_readCertificateDigest(in charstring p_certificateId, out HashedId8 p_digest) return boolean;
+*/
+BOOLEAN fx__readCertificateDigest(
+ const CHARSTRING& p__certificateId,
+ OCTETSTRING& p__digest
+) {
+ return TRUE;
+}
+
+/* * @desc Read the private keys for the specified certificate
+ * @param p_keysId the keys identifier
+ * @param p_signingPrivateKey the signing private key
+ * @return true on success, false otherwise
+ fx_readSigningKey(in charstring p_keysId, out Oct32 p_signingPrivateKey) return boolean;
+*/
+BOOLEAN fx__readSigningKey(
+ const CHARSTRING& p__keysId,
+ OCTETSTRING& p__signingPrivateKey
+) {
+ return TRUE;
+}
+
+/* * @desc Read the private keys for the specified certificate
+ * @param p_keysId the keys identifier
+ * @param p_encryptPrivateKey the encrypt private key
+ * @return true on success, false otherwise
+ fx_readEncryptingKey(in charstring p_keysId, out Oct32 p_encryptingPrivateKey) return boolean;
+*/
+BOOLEAN fx__readEncryptingKey(
+ const CHARSTRING& p__keysId,
+ OCTETSTRING& p__encryptingPrivateKey
+) {
+ return TRUE;
+}
+
+// group geodesic
+
+/* * @desc Check that given polygon doesn't have neither self-intersections nor holes.
+ * @param p_region Polygonal Region
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isValidPolygonalRegion(in PolygonalRegion p_region) return boolean;
+*/
+BOOLEAN fx__isValidPolygonalRegion(
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p__region
+) {
+ return TRUE;
+}
+
+/* * @desc Check if a polygonal region is inside another one
+ * @param p_parent The main polygonal region
+ * @param p_region The polygonal region to be included
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isPolygonalRegionInside(in PolygonalRegion p_parent, in PolygonalRegion p_region) return boolean;
+*/
+BOOLEAN fx__isPolygonalRegionInside(
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p__parent,
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p__region
+) {
+ return TRUE;
+}
+
+/* * @desc Check that the location is inside a circular region
+ * @param p_region The circular region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsideCircularRegion(in CircularRegion p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsideCircularRegion(
+ const LibItsSecurity__TypesAndValues::CircularRegion& p__region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p__location
+) {
+ return TRUE;
+}
+
+/* * @desc Check that the location is inside a rectangular region
+ * @param p_region The rectangular region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsideRectangularRegion(in RectangularRegions p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsideRectangularRegion(
+ const LibItsSecurity__TypesAndValues::RectangularRegions& p__region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p__location
+) {
+ return TRUE;
+}
+
+/* * @desc Check that the location is inside a polygonal region
+ * @param p_region The polygonal region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsidePolygonalRegion(in PolygonalRegion p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsidePolygonalRegion(
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p__region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p__location
+) {
+ return TRUE;
+}
+
+
+/* * @desc Check if the location is inside an identified region
+ * @param p_region The identified region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsideIdentifiedRegion(in IdentifiedRegion p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsideIdentifiedRegion(
+ const LibItsSecurity__TypesAndValues::IdentifiedRegion& p__region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p__location
+) {
+ return TRUE;
+}
+
+/* * @desc Check if the location is inside an undefined region
+ * @param p_region The identified region to consider
+ * @param p_location The device location
+ * @return true on success, false otherwise
+ * @verdict Unchanged
+ fx_isLocationInsideOtherRegion(in octetstring p_region, in ThreeDLocation p_location) return boolean;
+*/
+BOOLEAN fx__isLocationInsideOtherRegion(
+ const OCTETSTRING& p_region,
+ const LibItsSecurity__TypesAndValues::ThreeDLocation& p_location
+) {
+ return TRUE;
+}
+
+/* * @desc Check that p_circular_region_1 circular region is included into p_circular_region_2 circular region
+ * @param p_circular_region_1 Circular region 1
+ * @param p_circular_region_2 Circular region 2
+ * @return true on success, false otherwise
+ fx_areCirclesInside(in CircularRegion p_circular_region_1, in CircularRegion p_circular_region_2) return boolean;
+*/
+BOOLEAN fx__areCirclesInside(
+ const LibItsSecurity__TypesAndValues::CircularRegion& p_circular_region_1,
+ const LibItsSecurity__TypesAndValues::CircularRegion& p_circular_region_2
+) {
+ return TRUE;
+}
+
+/* * @desc Check that p_rectanglar_region_1 rectangular region is included into p_rectanglar_region_2 rectangular region
+ * @param p_rectanglar_region_1 Rectangular region 1
+ * @param p_rectanglar_region_2 Rectangular region 2
+ * @return true on success, false otherwise
+ fx_areRectanglesInside(in RectangularRegions p_rectanglar_region_1, in RectangularRegions p_rectanglar_region_2) return boolean;
+*/
+BOOLEAN fx__areRectanglesInside(
+ const LibItsSecurity__TypesAndValues::RectangularRegions& p_rectanglar_region_1,
+ const LibItsSecurity__TypesAndValues::RectangularRegions& p_rectanglar_region_2
+) {
+ return TRUE;
+}
+
+/* * @desc Check that p_polygonal_region_1 polygonal region is included into p_polygonal_region_2 polygonal region
+ * @param p_polygonal_region_1 Polygonal region 1
+ * @param p_polygonal_region_2 Polygonal region 2
+ * @return true on success, false otherwise
+ fx_arePolygonsInside(in PolygonalRegion p_polygonal_region_1, in PolygonalRegion p_polygonal_region_2) return boolean;
+*/
+BOOLEAN fx__arePolygonsInside(
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p_polygonal_region_1,
+ const LibItsSecurity__TypesAndValues::PolygonalRegion& p_polygonal_region_2
+) {
+ return TRUE;
+}
+
+/* * @desc Convert a spacial coordinate from DMS to Dms
+ * @param p_degrees The degrees (D)
+ * @param p_minutes The minutes (M)
+ * @param p_seconds The seconds (S)
+ * @param p_latlon The latitude/longitude: (N|S|E|W)
+ * @return The decimal coordinate on success, 0.0, otherwise
+ * @verdict Unchanged
+ fx_dms2dd(in Int p_degrees, in Int p_minutes, in float p_seconds, in Oct1 p_latlon) return float;
+*/
+FLOAT fx__dms2dd(
+ const INTEGER& p__degrees,
+ const INTEGER& p__minutes,
+ const FLOAT& p__seconds,
+ const OCTETSTRING& p__latlon
+) {
+ return 0.0;
+}
+
+} // end of namespace
Index: Ports/LibIts_ports/AdapterControlPort.cc
===================================================================
--- Ports/LibIts_ports/AdapterControlPort.cc (nonexistent)
+++ Ports/LibIts_ports/AdapterControlPort.cc (working copy)
@@ -0,0 +1,21 @@
+#include "AdapterControlPort.hh"
+
+//#include "CALM_ports/AdapterControlPort_CALM.partC"
+/* to be used when built without generating softlinks to the working directory
+#include "CAM_ports/AdapterControlPort_CAM.partC"
+#include "DENM_ports/AdapterControlPort_DENM.partC"
+#include "GN_ports/AdapterControlPort_GN.partC"
+#include "IVIM_ports/AdapterControlPort_IVIM.partC"
+#include "MapemSpatem_ports/AdapterControlPort_MapemSpatem.partC"
+#include "SremSsem_ports/AdapterControlPort_SremSsem.partC"
+#include "V2G_ports/AdapterControlPort_V2G.partC"
+*/
+#include "AdapterControlPort_CAM.partC"
+#include "AdapterControlPort_DENM.partC"
+#include "AdapterControlPort_GN.partC"
+#include "AdapterControlPort_IVIM.partC"
+#include "AdapterControlPort_MapemSpatem.partC"
+#include "AdapterControlPort_SremSsem.partC"
+#include "AdapterControlPort_Evcsn.partC"
+//#include "AdapterControlPort_V2G.partC"
+
Index: Ports/LibIts_ports/AdapterControlPort.hh
===================================================================
--- Ports/LibIts_ports/AdapterControlPort.hh (nonexistent)
+++ Ports/LibIts_ports/AdapterControlPort.hh (working copy)
@@ -0,0 +1,25 @@
+#ifndef AdapterControlPort_HH
+#define AdapterControlPort_HH
+
+//#include "TRI_mapper_API.hh"
+
+//#include "CALM_ports/AdapterControlPort_CALM.partH"
+/* to be used when built without generating softlinks to the working directory
+#include "CAM_ports/AdapterControlPort_CAM.partH"
+#include "DENM_ports/AdapterControlPort_DENM.partH"
+#include "GN_ports/AdapterControlPort_GN.partH"
+#include "IVIM_ports/AdapterControlPort_IVIM.partH"
+#include "MapemSpatem_ports/AdapterControlPort_MapemSpatem.partH"
+#include "SremSsem_ports/AdapterControlPort_SremSsem.partH"
+#include "V2G_ports/AdapterControlPort_V2G.partH"
+*/
+#include "AdapterControlPort_CAM.partH"
+#include "AdapterControlPort_DENM.partH"
+#include "AdapterControlPort_GN.partH"
+#include "AdapterControlPort_IVIM.partH"
+#include "AdapterControlPort_MapemSpatem.partH"
+#include "AdapterControlPort_SremSsem.partH"
+#include "AdapterControlPort_Evcsn.partH"
+//#include "AdapterControlPort_V2G.partH"
+
+#endif
Index: Ports/LibIts_ports/BTP_ports/BtpPort.cc
===================================================================
--- Ports/LibIts_ports/BTP_ports/BtpPort.cc (nonexistent)
+++ Ports/LibIts_ports/BTP_ports/BtpPort.cc (working copy)
@@ -0,0 +1,77 @@
+// This Test Port skeleton source file was generated by the
+// TTCN-3 Compiler of the TTCN-3 Test Executor version CRL 113 200/5 R3A
+// for U-ERICSSON\ethgry (ethgry@HU00078339) on Fri Aug 14 21:19:06 2015
+
+// Copyright Ericsson Telecom AB 2000-2014
+
+// You may modify this file. Complete the body of empty functions and
+// add your member functions here.
+
+#include "BtpPort.hh"
+
+namespace LibItsBtp__TestSystem {
+
+BtpPort::BtpPort(const char *par_port_name)
+ : BtpPort_BASE(par_port_name)
+{
+
+}
+
+BtpPort::~BtpPort()
+{
+
+}
+
+void BtpPort::set_parameter(const char * /*parameter_name*/,
+ const char * /*parameter_value*/)
+{
+
+}
+
+/*void BtpPort::Handle_Fd_Event(int fd, boolean is_readable,
+ boolean is_writable, boolean is_error) {}*/
+
+void BtpPort::Handle_Fd_Event_Error(int /*fd*/)
+{
+
+}
+
+void BtpPort::Handle_Fd_Event_Writable(int /*fd*/)
+{
+
+}
+
+void BtpPort::Handle_Fd_Event_Readable(int /*fd*/)
+{
+
+}
+
+/*void BtpPort::Handle_Timeout(double time_since_last_call) {}*/
+
+void BtpPort::user_map(const char * /*system_port*/)
+{
+
+}
+
+void BtpPort::user_unmap(const char * /*system_port*/)
+{
+
+}
+
+void BtpPort::user_start()
+{
+
+}
+
+void BtpPort::user_stop()
+{
+
+}
+
+void BtpPort::outgoing_send(const BtpReq& /*send_par*/)
+{
+
+}
+
+} /* end of namespace */
+
Index: Ports/LibIts_ports/BTP_ports/BtpPort.hh
===================================================================
--- Ports/LibIts_ports/BTP_ports/BtpPort.hh (nonexistent)
+++ Ports/LibIts_ports/BTP_ports/BtpPort.hh (working copy)
@@ -0,0 +1,44 @@
+// This Test Port skeleton header file was generated by the
+// TTCN-3 Compiler of the TTCN-3 Test Executor version CRL 113 200/5 R3A
+// for U-ERICSSON\ethgry (ethgry@HU00078339) on Fri Aug 14 21:19:06 2015