Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module test_LibItsGeoNetworking_TypesAndValues /*language "TTCN-3:2009 Advanced Parameterization"*/ {
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
import from LibItsGeoNetworking_TestSystem all;
import from LibItsGeoNetworking_TypesAndValues all;
import from LibItsGeoNetworking_Templates all;
import from LibItsGeoNetworking_Functions all;
import from LibItsGeoNetworking_Pixits {
modulepar PX_GN_UPPER_LAYER
};
import from LibItsGeoNetworking_Pics {
modulepar PICS_GN_LOCAL_ADDR_CONF_METHOD
};
import from LibItsIpv6OverGeoNetworking_TypesAndValues all;
import from LibItsIpv6OverGeoNetworking_Templates all;
import from LibItsExternal_TypesAndValues all;
import from test_CommonCodec all;
import from test_LibItsBtp_TypesAndValues {
template all
};
/**
* @desc Send template for GeoNetworking packet (GeonetworkingPort Primitive)
* @param p_geoNwMsg GeoNetworking packet to be sent
*/
template GeoNetworkingReq mw_geoNwReq_linkLayerBroadcast(
template GeoNetworkingPacket p_geoNwMsg
) := {
msgOut := p_geoNwMsg,
macDestinationAddress := c_llBroadcast
}
group LibItsGeoNetworking_DummyTemplates {
template CommonHeader mw_commonHeaderWithHopLimitAndLength (
in template (present) LongPosVector p_senderLongPosVec,
in template (present) NextHeader p_nextHeader,
in template (present) HeaderTST p_headerTypeSubType,
in template (present) UInt8 p_hopLimit,
in template (value) integer p_plLength
) modifies mw_commonHeaderWithHopLimit := {
plLength := p_plLength
}
template Header mw_shbHeaderWithLength (in integer p_plLength):= {
shbHeader := {
commonHeader := mw_commonHeaderWithHopLimitAndLength(
?, // SE PV
?, // NH
m_shbHeaderType, // HT + HST
1, // HL
p_plLength // plLength
)
}
}
/**
* @desc Dummy template for GN_Address
*/
template (value) GN_Address m_dummyGnAddrIut := {
typeOfAddress := e_manual,
stationType := {
vehicleStation := {
stationType := e_vehicleStation,
vsKind := e_car
}
},
stationSubType := e_private,
stationCountryCode := 33,
mid := 'a4fedecabeef'O
}
template (value) GN_Address m_dummyGnAddrIutSopvSepv := {
typeOfAddress := e_initial,
stationType := {
vehicleStation := {
stationType := e_vehicleStation,
vsKind := e_bike
}
},
stationSubType := e_public,
stationCountryCode := 0,
mid := '000000000001'O
}
/**
* @desc Dummy template for long position vector
*/
template (value) LongPosVector m_dummyLongPosVectorIut := {
gnAddr := m_dummyGnAddrIut,
timestamp := 123456,
latitude := 4856,
longitude := 675,
speed := 55,
heading := 9876,
altitude := 526,
timeAccuracy := 6,
posAccuracy := 2,
speedAccuracy := 2,
headingAccuracy := 2,
altitudeAccuracy := 0
}
template (value) LongPosVector m_dummyLongPosVectorIutSopvSepv := {
gnAddr := m_dummyGnAddrIutSopvSepv,
timestamp := 3794543552,
latitude := 490666666,
longitude := 81166666,
speed := 0,
heading := 0,
altitude := 0,
timeAccuracy := 0,
posAccuracy := 0,
speedAccuracy := 0,
headingAccuracy := 0,
altitudeAccuracy := 0
}
template (value) GN_Address m_dummyGnAddrNodeA := {
typeOfAddress := e_manual,
stationType := {
vehicleStation := {
stationType := e_vehicleStation,
vsKind := e_bus
}
},
stationSubType := e_private,
stationCountryCode := 49,
mid := 'a4fdea5ea5ed'O
}
template (value) GN_Address m_dummyGnAddrNodeB := {
typeOfAddress := e_manual,
stationType := {
vehicleStation := {
stationType := e_vehicleStation,
vsKind := e_car
}
},
stationSubType := e_private,
stationCountryCode := 50,
mid := 'a40102030405'O
}
template (value) GN_Address m_dummyGnAddrNodeC := {
typeOfAddress := e_manual,
stationType := {
vehicleStation := {
stationType := e_vehicleStation,
vsKind := e_car
}
},
stationSubType := e_private,
stationCountryCode := 42,
mid := 'deadbabebeef'O
}
template (value) LongPosVector m_dummyLongPosVectorNodeA := {
gnAddr := m_dummyGnAddrNodeA,
timestamp := 875,
latitude := 265,
longitude := 789,
speed := 80,
heading := 548,
altitude := 12,
timeAccuracy := 5,
posAccuracy := 1,
speedAccuracy := 3,
headingAccuracy := 1,
altitudeAccuracy := 2
}
template (value) LongPosVector m_dummyLongPosVectorNodeB := {
gnAddr := m_dummyGnAddrNodeB,
timestamp := 4585,
latitude := 126,
longitude := 123,
speed := 45,
heading := 125,
altitude := 25,
timeAccuracy := 4,
posAccuracy := 2,
speedAccuracy := 0,
headingAccuracy := 2,
altitudeAccuracy := 1
}
template (value) LongPosVector m_dummyLongPosVectorNodeC := {
gnAddr := m_dummyGnAddrNodeC,
timestamp := 23644,
latitude := 23754,
longitude := 49645,
speed := 110,
heading := 23,
altitude := 18,
timeAccuracy := 3,
posAccuracy := 1,
speedAccuracy := 2,
headingAccuracy := 1,
altitudeAccuracy := 1
}
template (value) Area m_dummyArea1 := {
geoAreaPosLatitude := 298376,
geoAreaPosLongitude := 32745,
distanceA := 1234,
distanceB := 5678,
angle := 9123
}
template (value) Area m_dummyArea2 := {
geoAreaPosLatitude := 873548,
geoAreaPosLongitude := 2837,
distanceA := 8765,
distanceB := 4321,
angle := 4567
}
template (value) GeoBroadcastArea m_dummyGeoBroadcastArea1 := {
geoBroadcastSubType := e_geoBroadcastRect,
geoBroadcastArea := m_dummyArea1
}
template (value) GeoBroadcastArea m_dummyGeoBroadcastArea2 := {
geoBroadcastSubType := e_geoBroadcastElip,
geoBroadcastArea := m_dummyArea2
}
template (value) GeoAnycastArea m_dummyGeoAnycastArea1 := {
geoAnycastSubType := e_geoAnycastCircle,
geoAnycastArea := m_dummyArea1
}
template (value) GeoAnycastArea m_dummyGeoAnycastArea2 := {
geoAnycastSubType := e_geoAnycastRect,
geoAnycastArea := m_dummyArea2
}
template (value) AcGnPrimitive m_startBeaconingRoadSide := {
startBeaconing := {
beaconHeader := {
commonHeader := {
version := 0,
nextHeader := e_any,
headerTST := {
beaconHdr := {
headerType := e_beacon,
headerSubType := 0
}
},
reserved := 0,
flags := '00000000'B,
plLength := 0,
trafficClass := {
reserved := 0,
relevance := 0,
reliability := e_veryHigh,
latency := e_veryLow
},
hopLimit := 10,
senderPosVector := {
gnAddr := {
typeOfAddress := e_initial,
stationType := {
roadsideStation := {
stationType := e_roadsideStation,
rsKind := e_ordinary
}
},
stationSubType := e_private,
stationCountryCode := 0,
mid := 'DEADBEEF0003'O
},
timestamp := 0,
latitude := 399990000,
longitude := 100000000,
speed := 1000,
heading := 0,
altitude := 20,
timeAccuracy := 0,
posAccuracy := 0,
speedAccuracy := 0,
headingAccuracy := 0,
altitudeAccuracy := 0
}
}
}
}
}
template (value) AcGnPrimitive m_startBeaconingRoadSide_NEC := {
startBeaconing := {
beaconHeader := {
commonHeader := {
version := 1,
nextHeader := e_any,
headerTST := {
beaconHdr := {
headerType := e_beacon,
headerSubType := 0
}
},
reserved := 0,
flags := '00000000'B,
plLength := 0,
trafficClass := {
reserved := 0,
relevance := 0,
reliability := e_veryHigh,
latency := e_veryLow
},
hopLimit := 10,
senderPosVector := {
gnAddr := {
typeOfAddress := e_initial,
stationType := {
roadsideStation := {
stationType := e_roadsideStation,
rsKind := e_ordinary
}
},
stationSubType := e_private,
stationCountryCode := 0,
mid := 'DEADBEEF0002'O
},
timestamp := 3373012264,
latitude := 20000,
longitude := 0,
speed := 0,
heading := 0,
altitude := 0,
timeAccuracy := 0,
posAccuracy := 0,
speedAccuracy := 0,
headingAccuracy := 0,
altitudeAccuracy := 0
}
}
}
}
}
template (value) AcGnPrimitive m_startBeaconingRoadSide_NEC_1 := {
startBeaconing := {
beaconHeader := {
commonHeader := {
version := 1,
nextHeader := e_any,
headerTST := {
beaconHdr := {
headerType := e_beacon,
headerSubType := 0
}
},
reserved := 0,
flags := '00000000'B,
plLength := 0,
trafficClass := {
reserved := 0,
relevance := 0,
reliability := e_veryHigh,
latency := e_veryLow
},
hopLimit := 10,
senderPosVector := {
gnAddr := {
typeOfAddress := e_initial,
stationType := {
roadsideStation := {
stationType := e_roadsideStation,
rsKind := e_ordinary
}
},
stationSubType := e_private,
stationCountryCode := 0,
mid := 'DEADBEEF0003'O
},
timestamp := 3374720650,
latitude := -10000,
longitude := 0,
speed := 0,
heading := 0,
altitude := 0,
timeAccuracy := 0,
posAccuracy := 0,
speedAccuracy := 0,
headingAccuracy := 0,
altitudeAccuracy := 0
}
}
}
}
}
/**
* @desc Send template for GeoUnicast header
* @param p_sourceLongPosVec Long position vector of source
* @param p_destinationLongPosVec Long position vector of destination
* @param p_senderLongPosVec Long position vector of sender
* @param p_seqNumber Sequence number of GeoUnicast packet
*/
template (value) Header m_geoUnicastHeaderBtp(
in template (value) LongPosVector p_sourceLongPosVec,
in template (value) ShortPosVector p_destinationLongPosVec,
in template (value) LongPosVector p_senderLongPosVec,
in template (value) UInt16 p_seqNumber
) := {
geoUnicastHeader := {
commonHeader := m_commonHeader(
e_btpA,
m_geoUnicastHeaderType,
m_trafficClass,
c_defaultHopLimit,
p_senderLongPosVec
),
seqNumber := p_seqNumber,
lifetime := m_defaultLifetime,
reserved := c_uInt8Zero,
srcPosVector := p_sourceLongPosVec,
dstPosVector := p_destinationLongPosVec
}
}
/**
* @desc Receive template for Beacon common header
* @param p_trafficClass Packet's traffic class
* @param p_hopLimit Maximum number of hops
* @param p_senderLongPosVec Long position vector of sender
*/
template CommonHeader mw_commonHeaderBeacon_NEC (
in template (present) TrafficClass p_trafficClass,
in template (present) UInt8 p_hopLimit,
in template (present) LongPosVector p_senderLongPosVec
) := {
version := 1,
nextHeader := e_any,
headerTST := {
beaconHdr := {
headerType := e_beacon,
headerSubType := 0
}
},
reserved := c_uInt8Zero,
flags := c_8ZeroBits,
plLength := 0,
trafficClass := p_trafficClass,
hopLimit := p_hopLimit,
senderPosVector := p_senderLongPosVec
}
/**
* @desc Receive template for Beacon header
* @param p_trafficClass Packet's traffic class
* @param p_hopLimit Maximum number of hops
* @param p_senderLongPosVec Long position vector of sender
*/
template Header mw_beaconHeader_NEC (
in template (present) TrafficClass p_trafficClass,
in template (present) UInt8 p_hopLimit,
in template (present) LongPosVector p_senderLongPosVec
) := {
beaconHeader := {
commonHeader := mw_commonHeaderBeacon_NEC(
p_trafficClass,
p_hopLimit,
p_senderLongPosVec
)
}
}
/**
* @desc Send template for GeoNetworking PDU with payload
* @param p_header Header value of GeoNetworking message
* @param p_payload Payload
* @param p_rawPayload Raw payload
* @see m_geoNwPdu
*/
template (value) GeoNetworkingPacket m_geoNwPduWithPayload_ipv6(
in template (value) Header p_header,
in template (value) Ipv6Packet p_ipv6Packet,
in template (value) octetstring p_rawPayload
) modifies m_geoNwPdu := {
payload := {
decodedPayload := {
ipv6Packet := p_ipv6Packet
}, // End of 'decodedPayload' field
rawPayload := p_rawPayload
} // End of 'payload' field
}
/**
* @desc Send template for GeoNetworking PDU with payload
* @param p_header Header value of GeoNetworking message
* @param p_payload Payload
* @param p_rawPayload Raw payload
* @see m_geoNwPdu
*/
template GeoNetworkingPacket mw_geoNwPduWithPayload_ipv6(
in template (present) Header p_header,
in template (present) Ipv6Packet p_ipv6Packet,
in template (present) octetstring p_rawPayload
) modifies mw_geoNwPdu := {
payload := {
decodedPayload := {
ipv6Packet := p_ipv6Packet
}, // End of 'decodedPayload' field
rawPayload := p_rawPayload
} // End of 'payload' field
}
} // End of group LibItsGeoNetworking_DummyTemplates
group LibItsGeoNetworking_testCases {
group testAcPrimitives {
/**
*
* @desc validate StartBeaconing primitive
* @verdict Pass on success, Fail otherwise
*/
testcase tc_startBeaconing() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(
m_startBeaconing(
m_beaconHeader(m_dummyLongPosVectorIut).beaconHeader),
true,
oct2bit('010027050024001000000000000a9421a4fedecabeef0001e240000012f8000002a300372694020e6248'O) // Check for 'LibItsGeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
);
}
/**
*
* @desc validate StartBeaconing primitive for roadside equipment
* @verdict Pass on success, Fail otherwise
*/
testcase tc_startBeaconingRoadside() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(
m_startBeaconingRoadSide,
true,
oct2bit('010027050024001000000000000a4c00deadbeef00030000000017d75cf005f5e10003e8000000140000'O) // Check for 'LibItsGeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
);
}
testcase tc_startBeaconingRoadside_NEC() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(
m_startBeaconingRoadSide_NEC,
true,
oct2bit('010027050024101000000000000a4c00deadbeef0002c90c152800004e20000000000000000000000000'O) // Check for 'LibItsGeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
);
}
testcase tc_startBeaconingRoadside_NEC_1() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(
m_startBeaconingRoadSide_NEC_1,
true,
oct2bit('010027050024101000000000000a4c00deadbeef0003c926268affffd8f0000000000000000000000000'O) // Check for 'LibItsGeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
);
}
/**
* @desc validate StartPassBeaconing primitive
* @verdict Pass on success, Fail otherwise
*/
testcase tc_startPassBeaconing() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(
m_startPassBeaconing(
m_beaconHeader(m_dummyLongPosVectorIut).beaconHeader),
true,
oct2bit('010027070024001000000000000a9421a4fedecabeef0001e240000012f8000002a300372694020e6248'O) // Check for 'LibItsGeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
);
}
/**
* @desc validate StartBeaconingMultipleNeighbour primitive
* @verdict Pass on success, Fail otherwise
*/
testcase tc_startBeaconingMultipleNeighbour() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(
m_startBeaconingMultipleNeighbour(
m_beaconHeader(m_dummyLongPosVectorIut).beaconHeader,
3),
true,
oct2bit('01002b090028001000000000000a9421a4fedecabeef0001e240000012f8000002a300372694020e624800000003'O) // Check for 'LibItsGeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
);
}
/**
* @desc validate StopBeaconing primitive
* @verdict Pass on success, Fail otherwise
*/
testcase tc_stopBeaconing() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(m_stopBeaconing, true, oct2bit('010003060000'O));
}
/**
* @desc validate StopPassBeaconing primitive
* @verdict Pass on success, Fail otherwise
*/
testcase tc_stopPassBeaconing() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(m_stopPassBeaconing, true, oct2bit('010003080000'O));
}
/**
* @desc validate StopBeaconingMultipleNeighbour
* @verdict Pass on success, Fail otherwise
*/
testcase tc_stopBeaconingMultipleNeighbour() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(m_stopBeaconingMultipleNeighbour, true, oct2bit('0100030a0000'O));
}
/**
* @desc validate AcGetLongPosVector
* @verdict Pass on success, Fail otherwise
*/
testcase tc_getLongPosVector() runs on TCType system TCType {
test_PDU<AcGnPrimitive>(m_getLongPosVector(m_dummyGnAddrIut), true, oct2bit('01000b0b00089421a4fedecabeef'O)); // Check log for TC_GEONW_FDV_COH_BV_01 TC to retrieve the frame
}
/**
* @desc validate AcGnResponse
* @verdict Pass on success, Fail otherwise
*/
testcase tc_longPosVector() runs on TCType system TCType {
test_decodePDU<AcGnResponse>(mw_getLongPosVectorAny(m_dummyGnAddrIut), '0300270c00249421a4fedecabeef000030aa000030aa000030aa000030aa000030aa000030aa000030aa'O); // Check log for TC_GEONW_FDV_COH_BV_01 TC to retrieve the frame
}
/**
* @desc validate AcGnResponse with a NULL LongPosVector
* @verdict Pass on success, Fail otherwise
*/
testcase tc_longPosVectorWithNullLongPosVector() runs on TCType system TCType {
test_decodePDU<AcGnResponse>(mw_getLongPosVectorAny(m_dummyGnAddrIut), '03000b0c00088400000000000001FFFFFFFFFFFF'O); // Check log for TC_GEONW_PON_LPV_BV_01 TC to retrieve the frame
}
} // End of group testAcPrimitives
group testGeoNetPrimitiveMessages {
/**
* @desc validate GeoNetworkingReq/Beacon
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Beacon() runs on TCType system TCType {
var Header v_header := null;
var octetstring v_buffer := '4d003c27003300100000000f000a9421a4fedecabeef0001e240000012f8000002a300372694020e624844454641554c545f5041594c4f4144ffffffffffff'O; // Check for 'LibItsIPv6GeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
if (PX_GN_UPPER_LAYER != e_any) {
log("PX_GN_UPPER_LAYER shall be set to e_any");
stop;
}
test_PDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
m_beaconHeader(
m_dummyLongPosVectorIut
))),
false,
oct2bit(v_buffer));
v_header := m_beaconHeader(
m_dummyLongPosVectorIut
);
v_header.beaconHeader.commonHeader.plLength := 15;
test_decodePDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
v_header
)
),
v_buffer
);
}
/**
* @desc validate GeoNetworkingReq/Beacon from Hitachi GeoN daemon
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Beacon_Hitachi() runs on TCType system TCType {
test_decodePDU<GeoNetworkingInd>(
mw_geoNwInd_withLinkLayerDestination(mw_geoNwPdu(mw_beaconHeader(?, ?, ?)), 'ffffffffffff'O),
'4c002d270024001000000000000a9421a4fedecabeef0001e240000012f8000002a300372694020e6248ffffffffffff'O
);
}
/**
* @desc validate GeoNetworkingReq/Beacon from NEC GeoN daemon
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Beacon_NEC() runs on TCType system TCType {
test_decodePDU<GeoNetworkingInd>(
mw_geoNwInd_withLinkLayerDestination(mw_geoNwPdu(mw_beaconHeader_NEC(?, ?, ?)), 'ffffffffffff'O),
'4c002d270024101000000000000100000000000000013d4d060500000000000000000000000000000000FFFFFFFFFFFF'O
);
}
/**
* @desc validate GeoNetworkingReq/Anycast
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Anycast() runs on TCType system TCType {
var Header v_header := null;
var octetstring v_buffer := '4d006c27006300300000000f000a9432a40102030405000011e90000007e0000007b002d007d001942091de62b009432a40102030405000011e90000007e0000007b002d007d0019420900048d8800007fe904d2162e23a3000044454641554c545f5041594c4f4144ffffffffffff'O; // Check for 'LibItsIPv6GeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
if (PX_GN_UPPER_LAYER != e_any) {
log("PX_GN_UPPER_LAYER shall be set to e_any");
stop;
}
test_PDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
m_geoAnycastHeader(
m_dummyLongPosVectorNodeB,
m_dummyLongPosVectorNodeB,
7654,
m_dummyGeoAnycastArea1))),
false,
oct2bit(v_buffer));
v_header := m_geoAnycastHeader(
m_dummyLongPosVectorNodeB,
m_dummyLongPosVectorNodeB,
7654,
m_dummyGeoAnycastArea1);
v_header.geoAnycastHeader.commonHeader.plLength := 15;
test_decodePDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
v_header
)
),
v_buffer
);
}
/**
* @desc validate GeoNetworkingReq/Anycast with hop limit
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Anycast_With_HopLimit() runs on TCType system TCType {
var Header v_header := null;
var octetstring v_buffer := '4d006c27006300310000000f0005942adeadbabebeef00005c5c00005cca0000c1ed006e001700123145029a2b00a431a4fdea5ea5ed0000036b000001090000031500500224000c5166000d544c00000b15223d10e111d7000044454641554c545f5041594c4f4144ffffffffffff'O; // Check for 'LibItsIPv6GeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
if (PX_GN_UPPER_LAYER != e_any) {
log("PX_GN_UPPER_LAYER shall be set to e_any");
setverdict(inconc);
stop;
}
test_PDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
m_geoAnycastHeaderWithHopLimit(
m_dummyLongPosVectorNodeA,
m_dummyLongPosVectorNodeC,
666,
m_dummyGeoAnycastArea2,
c_defaultHopLimit / 2))),
false,
oct2bit(v_buffer));
v_header := m_geoAnycastHeaderWithHopLimit(
m_dummyLongPosVectorNodeA,
m_dummyLongPosVectorNodeC,
666,
m_dummyGeoAnycastArea2,
c_defaultHopLimit / 2);
v_header.geoAnycastHeader.commonHeader.plLength := 15;
test_decodePDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
v_header
)
),
v_buffer
);
}
/**
* @desc validate GeoNetworkingReq/Unicast
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Unicast() runs on TCType system TCType {
var Header v_header := null;
var octetstring v_buffer := '4d007027006700200000000f000a942adeadbabebeef00005c5c00005cca0000c1ed006e00170012314506162b00a431a4fdea5ea5ed0000036b000001090000031500500224000c51669421a4fedecabeef0001e240000012f8000002a344454641554c545f5041594c4f4144ffffffffffff'O; // Check for 'LibItsIPv6GeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
if (PX_GN_UPPER_LAYER != e_any) {
log("PX_GN_UPPER_LAYER shall be set to e_any");
setverdict(inconc);
stop;
}
// test_PDU<GeoNetworkingReq>(
// m_geoNwReq_linkLayerBroadcast(
// m_geoNwPdu(
// m_geoUnicastHeader(
// m_dummyLongPosVectorNodeA,
// f_longPosVector2ShortPosVector(m_dummyLongPosVectorIut),
// m_dummyLongPosVectorNodeC,
// 1558))),
// false,
// oct2bit(v_buffer));
v_header := m_geoUnicastHeader(
m_dummyLongPosVectorNodeA,
f_longPosVector2ShortPosVector(m_dummyLongPosVectorIut),
m_dummyLongPosVectorNodeC,
1558);
v_header.geoUnicastHeader.commonHeader.plLength := 15;
test_decodePDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
v_header
)
),
v_buffer
);
}
/**
* @desc validate GeoNetworkingReq/Unicast with hop limit
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Unicast_With_HopLimit() runs on TCType system TCType {
var Header v_header := null;
var octetstring v_buffer := '4d007027006700200000000f0001942adeadbabebeef00005c5c00005cca0000c1ed006e001700123145029a2b00a431a4fdea5ea5ed0000036b000001090000031500500224000c51669421a4fedecabeef0001e240000012f8000002a344454641554c545f5041594c4f4144ffffffffffff'O; // Check for 'LibItsIPv6GeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
if (PX_GN_UPPER_LAYER != e_any) {
log("PX_GN_UPPER_LAYER shall be set to e_any");
setverdict(inconc);
stop;
}
test_PDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
m_geoUnicastHeaderWithHopLimit(
m_dummyLongPosVectorNodeA,
f_longPosVector2ShortPosVector(m_dummyLongPosVectorIut),
m_dummyLongPosVectorNodeC,
666,
1))),
false,
oct2bit(v_buffer));
v_header := m_geoUnicastHeaderWithHopLimit(
m_dummyLongPosVectorNodeA,
f_longPosVector2ShortPosVector(m_dummyLongPosVectorIut),
m_dummyLongPosVectorNodeC,
666,
1);
v_header.geoUnicastHeader.commonHeader.plLength := 15;
test_decodePDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPdu(
v_header
)
),
v_buffer
);
}
/**
* @desc validate GeoNetworkingReq/Unicast with payload
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Unicast_With_BtpPayload() runs on TCType system TCType {
var Header v_header := null;
var octetstring v_buffer := '4d006827005f012000000007000a942adeadbabebeef00005c5c00005cca0000c1ed006e00170012314506162b00a431a4fdea5ea5ed0000036b000001090000031500500224000c51669421a4fedecabeef0001e240000012f8000002a35041594c4f4144ffffffffffff'O; // Check for 'LibItsIPv6GeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
if (PX_GN_UPPER_LAYER != e_btpA) {
log("PX_GN_UPPER_LAYER shall be set to e_btpA");
setverdict(inconc);
stop;
}
test_PDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPduWithPayload(
m_geoUnicastHeaderBtp(
m_dummyLongPosVectorNodeA,
f_longPosVector2ShortPosVector(m_dummyLongPosVectorIut),
m_dummyLongPosVectorNodeC,
1558
),
{
decodedPayload := omit,
rawPayload := char2oct("PAYLOAD")
} // End of 'payload' field
)
),
false,
oct2bit(v_buffer));
v_header := m_geoUnicastHeaderBtp(
m_dummyLongPosVectorNodeA,
f_longPosVector2ShortPosVector(m_dummyLongPosVectorIut),
m_dummyLongPosVectorNodeC,
1558);
v_header.geoUnicastHeader.commonHeader.plLength := 7;
test_decodePDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPduWithPayload(
v_header,
{
decodedPayload := {
btpPacket := m_btpA_With_Payload(
20545,
22860,
omit,
'4F4144'O
)
},
rawPayload := char2oct("PAYLOAD")
} // End of 'payload' field
)
),
v_buffer
);
}
testcase tc_GeoNetReq_Unicast_With_BtpAWithPayload() runs on TCType system TCType {
if (PX_GN_UPPER_LAYER != e_btpA) {
log("PX_GN_UPPER_LAYER shall be set to e_btpA");
setverdict(inconc);
stop;
}
test_decodePDU<GeoNetworkingInd>(
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPduWithPayload(
mw_geoUnicastHeader(?, ?, ?),
{
decodedPayload := {
btpPacket := mw_btpA_With_Payload(
3751,
3751,
omit,
'0EA70EA75041594C4F41445F31'O
)
},
rawPayload := '0EA70EA70EA70EA75041594C4F41445F31'O
} // End of 'payload' field
),
'deadbeef0000'O),
'4c007227006f01200000001104004c00001e4f40d37e0000000017d7840005f5e10003e80000001400000002ee004c00001e4f40d37e0000000017d7840005f5e10003e80000001400001400deadbeef00013837b5f317d7f93005f5e1000ea70ea70ea70ea75041594c4f41445f31deadbeef0000'O);
}
/**
* @desc validate GeoNetworkingReq/Unicast with IPv6 header
* @verdict Pass on success, Fail otherwise
*/
testcase tc_GeoNetReq_Unicast_With_IPv6Header() runs on TCType system TCType {
var Ipv6Packet v_ipv6Packet := null;
var Header v_header := null;
var octetstring v_buffer := '4d00b12700a8032000000050000a942adeadbabebeef00005c5c00005cca0000c1ed006e00170012314506162b00a431a4fdea5ea5ed0000036b000001090000031500500224000c51669421a4fedecabeef0001e240000012f8000002a360000000002806ff2001061804000000000000005199cc70200106180001800000000000000000058c9b00506ae7073600000000a0021630299c00000204058c0402080a00dd1a390000000001030302ffffffffffff'O; // Check for 'LibItsIPv6GeoNetworking_TypesAndValues.encode:' output in codec traces to get the dump
if (PX_GN_UPPER_LAYER != e_ipv6) {
log("PX_GN_UPPER_LAYER shall be set to e_ipv6");
setverdict(inconc);
stop;
}
test_PDU<GeoNetworkingReq>(
m_geoNwReq_linkLayerBroadcast(
m_geoNwPduWithPayload_ipv6(
m_geoUnicastHeader(
m_dummyLongPosVectorNodeA,
f_longPosVector2ShortPosVector(m_dummyLongPosVectorIut),
m_dummyLongPosVectorNodeC,
1558),
m_ipv6Packet( // payload length = 40
'2001061804000000000000005199cc70'O,
'20010618000180000000000000000005'O,
6,
{ octetstringMsg := '8c9b00506ae7073600000000a0021630299c00000204058c0402080a00dd1a390000000001030302'O }
),
''O
)
),
false,
oct2bit(v_buffer));
v_ipv6Packet := m_ipv6Packet( // payload length = 40
'2001061804000000000000005199cc70'O,
'20010618000180000000000000000005'O,
6,
{ octetstringMsg := '8c9b00506ae7073600000000a0021630299c00000204058c0402080a00dd1a390000000001030302'O }
);
v_ipv6Packet.ipv6Hdr.payloadLength := 40;
v_header := m_geoUnicastHeader(
m_dummyLongPosVectorNodeA,
f_longPosVector2ShortPosVector(m_dummyLongPosVectorIut),
m_dummyLongPosVectorNodeC,
1558);
v_header.geoUnicastHeader.commonHeader.plLength := 80;
test_decodePDU<GeoNetworkingReq>(
mw_geoNwReq_linkLayerBroadcast(
m_geoNwPduWithPayload_ipv6(
v_header,
v_ipv6Packet,
'60000000002806FF2001061804000000000000005199CC70200106180001800000000000000000058C9B00506AE7073600000000A0021630299C00000204058C0402080A00DD1A390000000001030302'O
)
),
v_buffer
);
}
testcase tc_GeoNetInd_UnicastWithBtpAPayload() runs on TCType system TCType {
if (PX_GN_UPPER_LAYER != e_btpA) {
log("PX_GN_UPPER_LAYER shall be set to e_btpA");
setverdict(inconc);