Newer
Older
/*
* @author STF 276
* @version $Id$
* @desc This module specifies common template definitions
* to specify ICMPv6 packets
*
*/
module LibIpv6_Rfc2463Icmpv6_Templates {
//LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
//LibIpv6
import from LibIpv6_ExternalFunctions all;
import from LibIpv6_ModuleParameters all ;
import from LibIpv6_MultiRfcs_TypesAndValues all;
import from LibIpv6_Rfc2460Root_TypesAndValues all;
import from LibIpv6_Rfc2460Root_Templates all;
import from LibIpv6_Rfc2461NeighborDiscovery_TypesAndValues all;
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
group ICMPv6_Echo_Request {
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
*/
template EchoRequest mw_echoRequest ( template Ipv6Address p_src,
template Ipv6Address p_dst ) := {
ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := *,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= ?,
sequenceNumber:= ?,
data:= *
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest m_echoRequest_noExtHdr_noData ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
ipv6Hdr := m_ipHdr(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest mw_echoRequest_extHdr_noData (
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr
) := {
ipv6Hdr := mw_ipHdr_srcDst(p_nextHeader, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
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
/*
* @param p_hops Number of hops to be used in IPv6 header.
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest m_echoRequest_hop_noExtHdr_noData ( in UInt8 p_hops,
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hops, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest m_echoRequest_extHdr_noData (
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr
) := {
ipv6Hdr := m_ipHdr(p_nextHeader, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_hops Hop Limit value to be used.
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest m_echoRequest_hop_ExtHdr_noData (
UInt8 p_hops,
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr
) := {
ipv6Hdr := m_ipHdr_hop(p_nextHeader, p_hops, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data Data sent in the Echo Request packet.
*/
template EchoRequest m_echoRequest_extHdr_data (
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr,
octetstring p_data
) := {
ipv6Hdr := m_ipHdr(p_nextHeader, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data Data sent in the Echo Request packet.
*/
template EchoRequest m_echoRequest_noExtHdr_data (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr,
octetstring p_data
) := {
ipv6Hdr := m_ipHdr(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoRequest mw_echoRequest_noExtHdr_noData ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
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
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data Data sent in the Echo Request packet.
*/
template EchoRequest m_echoRequest_noExtHdr_dataHopL255 ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr,
octetstring p_data) := {
ipv6Hdr := m_ipHdr(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoRequest,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= p_data
}
} // end group ICMPv6_Echo_Request
group ICMPv6_Echo_Reply {
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
*/
template EchoReply mw_echoReply ( template Ipv6Address p_src,
template Ipv6Address p_dst ) := {
ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := *,
icmpType:= c_echoReply,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= ?,
sequenceNumber:= ?,
data:= *
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoReply mw_echoReply_noExtHdr_noData ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoReply,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
*/
template EchoReply m_echoReply_noExtHdr_noData ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr) := {
ipv6Hdr := m_ipHdr(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoReply,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= omit
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data data in ICMPv6 echo reply.
*/
template EchoReply m_echoReply_noExtHdr_data ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr,
template octetstring p_data ) := {
ipv6Hdr := m_ipHdr(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_echoReply,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data data in ICMPv6 echo reply.
*/
template EchoReply mw_echoReply_noExtHdr_data ( template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt16 p_id,
UInt16 p_seqNr,
template octetstring p_data ) := {
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
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_nextHeader Next header identifier value to be used.
* @param p_extHdrList List of extension header in the packet.
* @param p_id ICMPv6 echo identifier.
* @param p_seqNr ICMPv6 echo sequence number.
* @param p_data data in ICMPv6 echo reply.
*/
template EchoReply mw_echoReply_extHdr_data (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_nextHeader,
template ExtensionHeaderList p_extHdrList,
UInt16 p_id,
UInt16 p_seqNr,
template octetstring p_data
) := {
ipv6Hdr := mw_ipHdr_srcDst(p_nextHeader, p_src, p_dst),
extHdrList := p_extHdrList,
icmpType:= c_echoReply,
identifier:= p_id,
sequenceNumber:= p_seqNr,
data:= p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_data data in ICMPv6 echo reply.
*/
template EchoReply mw_echoReply_hopL255_data ( template Ipv6Address p_src,
template Ipv6Address p_dst,
octetstring p_data ) := {
ipv6Hdr := mw_ipHdr_srcDst_hopL255(p_src, p_dst),
extHdrList := *,
icmpType:= c_echoReply,
icmpCode:= c_icmpCode0,
checksum:= ?,
identifier:= ?,
sequenceNumber:= ?,
data:= p_data
}
} // end group ICMPv6_Echo_Reply
group ICMPv6_Parameter_Problem {
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
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_hopLimit Number of hops to be used in IPv6 header.
* @param p_icmpCode ICMPv6 type to be used
* @param p_pointer ICMPv6 pointer to be used
* @param p_data data in ICMPv6 Parameter Problem message.
*/
template ParameterProblem m_parameterProblem_hopLimit_noExtHdr (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hopLimit,
UInt8 p_icmpCode,
UInt32 p_pointer,
template octetstring p_data
) := {
ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
extHdrList := omit,
icmpType:= c_parameterProblem,
icmpCode:= p_icmpCode,
checksum:= c_2ZeroBytes,
pointer := p_pointer,
data := p_data
}
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
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_icmpCode ICMPv6 code to be used
* @param p_pointer ICMPv6 pointer to be used
*/
template ParameterProblem mw_parameterProblem_code_pointer (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_icmpCode,
UInt32 p_pointer
) := {
ipv6Hdr := mw_ipHdr_srcDst(?, p_src, p_dst),
extHdrList := *,
icmpType:= c_parameterProblem,
icmpCode:= p_icmpCode,
checksum:= ?,
pointer := p_pointer,
data := *
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
*/
template ParameterProblem mw_parameterProblem (
template Ipv6Address p_src,
template Ipv6Address p_dst
) := {
ipv6Hdr := mw_ipHdr_srcDst(?, p_src, p_dst),
extHdrList := *,
icmpType:= c_parameterProblem,
icmpCode:= ?,
checksum:= ?,
pointer := ?,
data := *
}
} // end group ICMPv6_Parameter_Problem
group ICMPv6_Time_Exceeded {
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_hopLimit Number of hops to be used in IPv6 header.
* @param p_icmpCode ICMPv6 type to be used
* @param p_data data in ICMPv6 Time Exceeded message.
*/
template TimeExceeded m_timeExceeded_hopLimit_noExtHdr (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hopLimit,
UInt8 p_icmpCode,
template octetstring p_data
) := {
ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
extHdrList := omit,
icmpType:= c_timeExceeded,
icmpCode:= p_icmpCode,
checksum:= c_2ZeroBytes,
unused := 0,
data := p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_icmpCode ICMPv6 code to be used
*/
template TimeExceeded mw_timeExceeded_noExtHdr (template Ipv6Address p_src,
template Ipv6Address p_dst,
ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_timeExceeded,
icmpCode:= p_icmpCode,
checksum:= ?,
unused := ?,
data := *
}
} // end group ICMPv6_Time_Exceeded
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
group Destination_Unreachable {
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_hopLimit Number of hops to be used in IPv6 header.
* @param p_icmpCode ICMPv6 type to be used
* @param p_data data in ICMPv6 Destination Unreachable message.
*/
template DestinationUnreachable m_destUnreachable_hopLimit_noExtHdr (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hopLimit,
UInt8 p_icmpCode,
template octetstring p_data
) := {
ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
extHdrList := omit,
icmpType:= c_destinationUnreachable,
icmpCode:= p_icmpCode,
checksum:= c_2ZeroBytes,
unused := '00000000'O,
data := p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_icmpCode ICMPv6 type to be used
*/
template DestinationUnreachable mw_destUnreachable_code (
template Ipv6Address p_src,
template Ipv6Address p_dst,
template UInt8 p_icmpCode
) := {
ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := *,
icmpType:= c_destinationUnreachable,
icmpCode:= p_icmpCode,
checksum:= ?,
unused := '00000000'O,
data := *
}
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
} // end group Destination_Unreachable
group Packet_Too_Big {
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_hopLimit Number of hops to be used in IPv6 header.
* @param p_data data in ICMPv6 Packet Too Big message.
*/
template PacketTooBig m_packetTooBig_hopLimit_noExtHdr (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_hopLimit,
template octetstring p_data
) := {
ipv6Hdr := m_ipHdr_hop(c_icmpHdr, p_hopLimit, p_src, p_dst),
extHdrList := omit,
icmpType:= c_packetTooBig,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
mtu := c_mtu1280,
data := p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_mtu MTU value to be sent.
* @param p_data data in ICMPv6 Packet Too Big message.
*/
template PacketTooBig m_packetTooBig_noExtHdr_mtu (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt32 p_mtu,
template octetstring p_data
) := {
ipv6Hdr := m_ipHdr(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_packetTooBig,
icmpCode:= c_icmpCode0,
checksum:= c_2ZeroBytes,
mtu := p_mtu,
data := p_data
}
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_icmpCode ICMPv6 Code value in the received message.
*/
template PacketTooBig mw_packetTooBig_noExtHdr_code (
template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_icmpCode
) := {
ipv6Hdr := mw_ipHdr_srcDst(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= c_packetTooBig,
icmpCode:= p_icmpCode,
checksum:= ?,
mtu := ?,
data := *
}
} // end group Packet_Too_Big
group ICMPv6_Other {
/*
* @param p_src Binary IPv6 address associated with the
* test component.
* @param p_dst Binary IPv6 address associated with NUT.
* @param p_icmpCode ICMPv6 code to be used
*/
template OtherIcmpv6Hdr m_otherIcmpv6Hdr_noExtHdr_noData (template Ipv6Address p_src,
template Ipv6Address p_dst,
UInt8 p_icmpType,
UInt8 p_icmpCode ) := {
ipv6Hdr := m_ipHdr(c_icmpHdr, p_src, p_dst),
extHdrList := omit,
icmpType:= p_icmpType,
icmpCode:= p_icmpCode,
checksum:= c_2ZeroBytes,
data := omit
}
} // end group ICMPv6_Other
} // end module LibIpv6_Rfc2463Icmpv6_Templates