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
module test_LibItsExternalFunctions {
import from LibCommon_BasicTypesAndValues {
type UInt8
};
import from LibItsIpv6OverGeoNetworking_TypesAndValues {
type Ipv6Address, RouterAdvertisementMsg
};
import from LibItsIpv6OverGeoNetworking_Functions all;
import from test_CommonCodec all;
template (value) UInt8 m_ICMPv6_protocoId := 58; // = 0x3a: ICMPv6 protocol ID
group testValues_01 {
template (value) Ipv6Address m_src_01 := 'fe80000000000000020086fffe0580da'O; // fe80::200:86ff:fe05:80da
template (value) Ipv6Address m_dst_01 := 'fe80000000000000026097fffe0769ea'O; // fe80::260:97ff:fe07:69ea
template (value) octetstring m_ipv6Payload_01 := '8700000000000000fe80000000000000026097fffe0769ea01010000860580da'O;
// template (value) octetstring m_ipv6Payload_01 := '870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'O;
/*template (value) RouterAdvertisementMsg m_ipv6Payload := {
icmpType := c_rtAdvMsg,
icmpCode := 0,
checksum := '68bd'O,
curHopLimit := ,
managedConfigFlag,
otherConfigFlag,
homeAgentFlag,
reserved,
routerLifetime,
reachableTime,
retransTimer,
rtAdvOptions := omit
}*/
template (value) integer m_payloadLength_01 := 32;
template octetstring mw_checksum_01 := '68bd'O;
} // End of group testValues_01
group testValues_02 {
template (value) Ipv6Address m_src_02 := '2001ffff000000000000000000000002'O;
template (value) Ipv6Address m_dst_02 := '2001ffff000000000000000000000001'O;
template (value) octetstring m_ipv6Payload_02 := '80000000636801004a43ec45d23f0b0008090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'O;
// template (value) octetstring m_ipv6Payload_02 := '8000dc4b636801004a43ec45d23f0b0008090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'O;
template (value) integer m_payloadLength_02 := 64;
template octetstring mw_checksum_02 := 'dc4b'O;
} // End of group testValues_02
group testValues_03 {
template (value) Ipv6Address m_src_03 := '2001ffff000000000000000000000001'O; // 2001:ffff::1
template (value) Ipv6Address m_dst_03 := '2001ffff000000000000000000000002'O; // 2001:ffff::2
template (value) octetstring m_ipv6Payload_03 := '8100000072680500b043ec45f3500b0008090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'O;
// template (value) octetstring m_ipv6Payload_03 := '8100413a72680500b043ec45f3500b0008090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'O;
template (value) integer m_payloadLength_03 := 64;
template octetstring mw_checksum_03 := '413a'O;
} // End of group testValues_03
group externalFunctions {
testcase tc_computeIPv6Checksum_01() runs on TCType system TCType {
var octetstring v_checksum;
v_checksum := f_computeIPv6CheckSum(
m_src_01,
m_dst_01,
m_payloadLength_01,
m_ipv6Payload_01,
m_ICMPv6_protocoId);
if (match(v_checksum, mw_checksum_01) == true) {
setverdict(pass);
} else {
setverdict(fail);
}
}
testcase tc_computeIPv6Checksum_02() runs on TCType system TCType {
var octetstring v_checksum;
v_checksum := f_computeIPv6CheckSum(
m_src_02,
m_dst_02,
m_payloadLength_02,
m_ipv6Payload_02,
m_ICMPv6_protocoId);
if (match(v_checksum, mw_checksum_02) == true) {
setverdict(pass);
} else {
setverdict(fail);
}
}
testcase tc_computeIPv6Checksum_03() runs on TCType system TCType {
var octetstring v_checksum;
v_checksum := f_computeIPv6CheckSum(
m_src_03,
m_dst_03,
m_payloadLength_03,
m_ipv6Payload_03,
m_ICMPv6_protocoId);
if (match(v_checksum, mw_checksum_03) == true) {
setverdict(pass);
} else {
setverdict(fail);
}
}
} // End of group externalFunctions
} // End of module test_LibItsExternalFunctions