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
/*
* @author STF 276
* @version $Id$
* @desc This module defines the ICMPv6 message types and
* their information elements using types from the
* Common and Ipv6 library. Also it provides some useful
* constant definitions.
* All types have been defined on the basis of RFC 2463
* @url http://www.ietf.org/rfc/rfc2463.txt
*
*/
module LibIpv6_Rfc2463Icmpv6_TypesAndValues {
//LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
//LibIpv6
import from LibIpv6_MultiRfcs_TypesAndValues all ;
import from LibIpv6_Rfc2460Root_TypesAndValues all ;
group IcmpCodes {
const UInt8 c_icmpCode0 := 0 ;
const UInt8 c_icmpCode1 := 1 ;
const UInt8 c_icmpCode2 := 2 ;
const UInt8 c_icmpCode3 := 3 ;
const UInt8 c_icmpCode4 := 4 ;
const UInt8 c_icmpCode5 := 5 ;
const UInt8 c_icmpCode255 := 255 ;
}
group rfc2463MessageIds {
const UInt8 c_destinationUnreachable := 1;
const UInt8 c_packetTooBig := 2;
const UInt8 c_timeExceeded := 3;
const UInt8 c_parameterProblem := 4;
const UInt8 c_echoRequest := 128;
const UInt8 c_echoReply := 129;
} // end group rfc2463MessageIds
group IcmpPointers {
const UInt32 c_icmpPointer4 := 4;
const UInt32 c_icmpPointer6 := 6;
const UInt32 c_icmpPointer40 := 40;
const UInt32 c_icmpPointer41 := 41;
const UInt32 c_icmpPointer42 := 42;
const UInt32 c_icmpPointer43 := 43;
}
group icmpRfc2463MessageTypes {
/*
** @desc PDU type derived from RFC2463 clause 3.1
*/
type record DestinationUnreachable {
Ipv6Header ipv6Hdr,
ExtensionHeaderList extHdrList optional,
UInt8 icmpType(c_destinationUnreachable),
UInt8 icmpCode,
Oct2 checksum,
Oct4 unused,
octetstring data optional
}
with {
encode "isPDU=LibIpv6_Rfc2463Icmpv6_TypesAndValues;import=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 1)";
encode (data) "length=getIntTag(\"IPv6Header_payloadLength\")-8";
}
/*
** @desc PDU type derived from RFC2463 clause 3.2
*/
type record PacketTooBig {
Ipv6Header ipv6Hdr,
ExtensionHeaderList extHdrList optional,
UInt8 icmpType(c_packetTooBig),
UInt8 icmpCode,
Oct2 checksum,
UInt32 mtu,
octetstring data optional
}
with {
encode "isPDU=LibIpv6_Rfc2463Icmpv6_TypesAndValues;import=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 2)";
encode (data) "length=getIntTag(\"IPv6Header_payloadLength\")-8";
}
/*
** @desc PDU type derived from RFC2463 clause 3.3
*/
type record TimeExceeded {
Ipv6Header ipv6Hdr,
ExtensionHeaderList extHdrList optional,
UInt8 icmpType(c_timeExceeded),
UInt8 icmpCode,
Oct2 checksum,
UInt32 unused(0), //always zero
octetstring data optional
}
with {
encode "isPDU=LibIpv6_Rfc2463Icmpv6_TypesAndValues;import=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 3)";
encode (data) "length=getIntTag(\"IPv6Header_payloadLength\")-8";
}
/*
** @desc PDU type derived from RFC2463 clause 3.4
*/
type record ParameterProblem {
Ipv6Header ipv6Hdr,
ExtensionHeaderList extHdrList optional,
UInt8 icmpType(c_parameterProblem),
UInt8 icmpCode,
Oct2 checksum,
UInt32 pointer,
octetstring data optional
}
with {
encode "isPDU=LibIpv6_Rfc2463Icmpv6_TypesAndValues;import=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 4)";
encode (data) "length=getIntTag(\"IPv6Header_payloadLength\")-8";
}
/*
** @desc PDU type derived from RFC2463 clause 4.1
*/
type record EchoRequest {
Ipv6Header ipv6Hdr,
ExtensionHeaderList extHdrList optional,
UInt8 icmpType(c_echoRequest),
UInt8 icmpCode,
Oct2 checksum,
UInt16 identifier,
UInt16 sequenceNumber,
octetstring data optional
}
with {
encode "isPDU=LibIpv6_Rfc2463Icmpv6_TypesAndValues;import=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 128)";
encode (data) "length=getIntTag(\"IPv6Header_payloadLength\")-8";
}
/*
** @desc PDU type derived from RFC2463 clause 4.2
*/
type record EchoReply {
Ipv6Header ipv6Hdr,
ExtensionHeaderList extHdrList optional,
UInt8 icmpType(c_echoReply),
UInt8 icmpCode,
Oct2 checksum,
UInt16 identifier,
UInt16 sequenceNumber,
octetstring data optional
}
with {
encode "isPDU=LibIpv6_Rfc2463Icmpv6_TypesAndValues;import=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 129)";
encode (data) "length=getIntTag(\"IPv6Header_payloadLength\")-8";
}
/*
** @desc Generic Icmpv6 header
*/
type record OtherIcmpv6Hdr {
Ipv6Header ipv6Hdr,
ExtensionHeaderList extHdrList optional,
UInt8 icmpType,
UInt8 icmpCode,
Oct2 checksum,
octetstring data optional
}
with {
encode "isPDU=LibIpv6_Rfc2463Icmpv6_TypesAndValues;import=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeader(dec, 58)";
encode (data) "length=getIntTag(\"IPv6Header_payloadLength\")-8";
}
} // end icmpRfc2463Packets
} // end module LibIpv6_Rfc2463Icmpv6_TypesAndValues