A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
packetbb-test-suite.cc
Go to the documentation of this file.
1/* vim: set ts=2 sw=2 sta expandtab ai si cin: */
2/*
3 * Copyright (c) 2009 Drexel University
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Author: Tom Wambold <tom5760@gmail.com>
8 */
9
10#include "ns3/ipv4-address.h"
11#include "ns3/ipv6-address.h"
12#include "ns3/packetbb.h"
13#include "ns3/ptr.h"
14#include "ns3/test.h"
15
16#include <cstring>
17#include <iostream>
18
19using namespace ns3;
20
21/**
22 * @ingroup network-test
23 * @ingroup tests
24 *
25 * @brief PacketBb TestCase
26 */
27class PbbTestCase : public TestCase
28{
29 public:
30 /**
31 * Constructor
32 * @param name Test name.
33 * @param packet Packet to test.
34 * @param buffer Buffer to test.
35 * @param size Buffer size.
36 */
37 PbbTestCase(std::string name, Ptr<PbbPacket> packet, uint8_t* buffer, uint32_t size);
38 ~PbbTestCase() override;
39
40 protected:
41 void DoRun() override;
42
43 private:
44 /// Serialization
45 void TestSerialize();
46 /// Deserialization
47 void TestDeserialize();
48
49 Ptr<PbbPacket> m_refPacket; //!< Reference packet
50 Buffer m_refBuffer; //!< Reference buffer
51};
52
53PbbTestCase::PbbTestCase(std::string name, Ptr<PbbPacket> packet, uint8_t* buffer, uint32_t size)
54 : TestCase(name)
55{
56 m_refPacket = packet;
57
59 m_refBuffer.Begin().Write(buffer, size);
60}
61
65
66void
72
73void
75{
76 Buffer newBuffer;
77 newBuffer.AddAtStart(m_refPacket->GetSerializedSize());
78 m_refPacket->Serialize(newBuffer.Begin());
79
82 "serialization failed, buffers have different sizes");
83
84 int memrv = memcmp(newBuffer.PeekData(), m_refBuffer.PeekData(), newBuffer.GetSize());
85
86 NS_TEST_ASSERT_MSG_EQ(memrv, 0, "serialization failed, buffers differ");
87}
88
89void
91{
93 uint32_t numbytes = newPacket->Deserialize(m_refBuffer.Begin());
94
95 NS_TEST_ASSERT_MSG_EQ(numbytes,
97 "deserialization failed, did not use all bytes");
98
99 NS_TEST_ASSERT_MSG_EQ(*newPacket, *m_refPacket, "deserialization failed, objects do not match");
100}
101
102/**
103 * @ingroup network-test
104 * @ingroup tests
105 *
106 * @brief PacketBb TestSuite
107 */
109{
110 public:
111 PbbTestSuite();
112};
113
115 : TestSuite("packetbb-test-suite", Type::UNIT)
116{
117 /* Test 1
118 * ,------------------
119 * | PACKET
120 * |------------------
121 * | * Packet version: 0
122 * | * Packet flags: 0
123 * `------------------
124 */
125 {
127 uint8_t buffer[] = {0x00};
128 AddTestCase(new PbbTestCase("1", packet, buffer, sizeof(buffer)),
129 TestCase::Duration::QUICK);
130 }
131
132 /* Test 2
133 * ,------------------
134 * | PACKET
135 * |------------------
136 * | * Packet version: 0
137 * | * Packet flags: 8
138 * | * Packet seq number: 2
139 * `------------------
140 */
141 {
143 packet->SetSequenceNumber(2);
144 uint8_t buffer[] = {0x08, 0x00, 0x02};
145 AddTestCase(new PbbTestCase("2", packet, buffer, sizeof(buffer)),
146 TestCase::Duration::QUICK);
147 }
148
149 /* Test 3
150 * ,------------------
151 * | PACKET
152 * |------------------
153 * | * Packet version: 0
154 * | * Packet flags: 12
155 * | * Packet seq number: 3
156 * `------------------
157 * This test has the phastlv flag set to 1 with no tlvs.
158 *
159 * Note: it is not possible to run this test with the current test class.
160 * The bytecode of the packet should be:
161 * - pkt-header (8 bits): 0x0c (phasseqnum and phastlv)
162 * - pkt-seq-num (16 bits): 0x00, 0x03
163 * - tlvs-length (16 bits): 0x00, 0x00 (i.e., no TLVs)
164 *
165 * RFC 5444 doesn't forbid this, but it doesn't foresee it either.
166 * The packet is questionable, but it is not malformed.
167 */
168 {
170 packet->SetSequenceNumber(3);
171 packet->ForceTlv(true);
172 uint8_t buffer[] = {0x0c, 0x00, 0x03, 0x00, 0x00};
173 AddTestCase(new PbbTestCase("3", packet, buffer, sizeof(buffer)),
174 TestCase::Duration::QUICK);
175 }
176
177 /* Test 4
178 * ,------------------
179 * | PACKET
180 * |------------------
181 * | * Packet version: 0
182 * | * Packet flags: 12
183 * | * Packet seq number: 4
184 * | | * Packet TLV Block
185 * | | - TLV
186 * | | Flags = 0
187 * | | Type = 1; Value = (warning: parameter is NULL)
188 * `------------------
189 */
190 {
192 packet->SetSequenceNumber(4);
193
195 tlv->SetType(1);
196
197 packet->TlvPushBack(tlv);
198 uint8_t buffer[] = {0x0c, 0x00, 0x04, 0x00, 0x02, 0x01, 0x00};
199 AddTestCase(new PbbTestCase("4", packet, buffer, sizeof(buffer)),
200 TestCase::Duration::QUICK);
201 }
202
203 /* Test 5
204 * ,------------------
205 * | PACKET
206 * |------------------
207 * | * Packet version: 0
208 * | * Packet flags: 12
209 * | * Packet seq number: 5
210 * | | * Packet TLV Block
211 * | | - TLV
212 * | | Flags = 0
213 * | | Type = 1; Value = (warning: parameter is NULL)
214 * | | - TLV
215 * | | Flags = 128
216 * | | Type = 2; Type ext. = 100; Value = (warning: parameter is NULL)
217 * `------------------
218 */
219 {
221 packet->SetSequenceNumber(5);
222
224 tlv1->SetType(1);
225 packet->TlvPushBack(tlv1);
226
228 tlv2->SetType(2);
229 tlv2->SetTypeExt(100);
230 packet->TlvPushBack(tlv2);
231
232 uint8_t buffer[] = {0x0c, 0x00, 0x05, 0x00, 0x05, 0x01, 0x00, 0x02, 0x80, 0x64};
233 AddTestCase(new PbbTestCase("5", packet, buffer, sizeof(buffer)),
234 TestCase::Duration::QUICK);
235 }
236
237 /* Test 6
238 * ,------------------
239 * | PACKET
240 * |------------------
241 * | * Packet version: 0
242 * | * Packet flags: 12
243 * | * Packet seq number: 6
244 * | | * Packet TLV Block
245 * | | - TLV
246 * | | Flags = 0
247 * | | Type = 1; Value = (warning: parameter is NULL)
248 * | | - TLV
249 * | | Flags = 144
250 * | | Type = 2; Type ext. = 100; Value = 01 02 03 04
251 * | |
252 * `------------------
253 */
254 {
256 packet->SetSequenceNumber(6);
257
259 tlv1->SetType(1);
260 packet->TlvPushBack(tlv1);
261
263 tlv2->SetType(2);
264 tlv2->SetTypeExt(100);
265
266 uint8_t tlv2val[] = {1, 2, 3, 4};
267 tlv2->SetValue(tlv2val, sizeof(tlv2val));
268
269 packet->TlvPushBack(tlv2);
270
271 uint8_t buffer[] = {
272 0x0c,
273 0x00,
274 0x06,
275 0x00,
276 0x0a,
277 0x01,
278 0x00,
279 0x02,
280 0x90,
281 0x64,
282 0x04,
283 0x01,
284 0x02,
285 0x03,
286 0x04,
287 };
288 AddTestCase(new PbbTestCase("6", packet, buffer, sizeof(buffer)),
289 TestCase::Duration::QUICK);
290 }
291
292 /* Test 7
293 * ,------------------
294 * | PACKET
295 * |------------------
296 * | * Packet version: 0
297 * | * Packet flags: 12
298 * | * Packet seq number: 7
299 * | | * Packet TLV Block
300 * | | - TLV
301 * | | Flags = 0
302 * | | Type = 1; Value = (warning: parameter is NULL)
303 * | | - TLV
304 * | | Flags = 152
305 * | | Type = 2; Type ext. = 100; Value = 00 01 02 03
306 * | | 04 05 06 07
307 * | | 08 09 0a 0b
308 * | | 0c 0d 0e 0f
309 * | | 10 11 12 13
310 * | | 14 15 16 17
311 * | | 18 19 1a 1b
312 * | | 1c 1d 1e 1f
313 * | | 20 21 22 23
314 * | | 24 25 26 27
315 * | | 28 29 2a 2b
316 * | | 2c 2d 2e 2f
317 * | | 30 31 32 33
318 * | | 34 35 36 37
319 * | | 38 39 3a 3b
320 * | | 3c 3d 3e 3f
321 * | | 40 41 42 43
322 * | | 44 45 46 47
323 * | | 48 49 4a 4b
324 * | | 4c 4d 4e 4f
325 * | | 50 51 52 53
326 * | | 54 55 56 57
327 * | | 58 59 5a 5b
328 * | | 5c 5d 5e 5f
329 * | | 60 61 62 63
330 * | | 64 65 66 67
331 * | | 68 69 6a 6b
332 * | | 6c 6d 6e 6f
333 * | | 70 71 72 73
334 * | | 74 75 76 77
335 * | | 78 79 7a 7b
336 * | | 7c 7d 7e 7f
337 * | | 80 81 82 83
338 * | | 84 85 86 87
339 * | | 88 89 8a 8b
340 * | | 8c 8d 8e 8f
341 * | | 90 91 92 93
342 * | | 94 95 96 97
343 * | | 98 99 9a 9b
344 * | | 9c 9d 9e 9f
345 * | | a0 a1 a2 a3
346 * | | a4 a5 a6 a7
347 * | | a8 a9 aa ab
348 * | | ac ad ae af
349 * | | b0 b1 b2 b3
350 * | | b4 b5 b6 b7
351 * | | b8 b9 ba bb
352 * | | bc bd be bf
353 * | | c0 c1 c2 c3
354 * | | c4 c5 c6 c7
355 * | | c8 c9 ca cb
356 * | | cc cd ce cf
357 * | | d0 d1 d2 d3
358 * | | d4 d5 d6 d7
359 * | | d8 d9 da db
360 * | | dc dd de df
361 * | | e0 e1 e2 e3
362 * | | e4 e5 e6 e7
363 * | | e8 e9 ea eb
364 * | | ec ed ee ef
365 * | | f0 f1 f2 f3
366 * | | f4 f5 f6 f7
367 * | | f8 f9 fa fb
368 * | | fc fd fe 00
369 * | | 01 02 03 04
370 * | | 05 06 07 08
371 * | | 09 0a 0b 0c
372 * | | 0d 0e 0f 10
373 * | | 11 12 13 14
374 * | | 15 16 17 18
375 * | | 19 1a 1b 1c
376 * | | 1d 1e 1f 20
377 * | | 21 22 23 24
378 * | | 25 26 27 28
379 * | | 29 2a 2b 2c
380 * | |
381 * `------------------
382 */
383 {
385 packet->SetSequenceNumber(7);
386
388 tlv1->SetType(1);
389 packet->TlvPushBack(tlv1);
390
392 tlv2->SetType(2);
393 tlv2->SetTypeExt(100);
394
395 uint8_t tlv2val[] = {
396 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
397 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
398 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
399 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
400 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
401 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
402 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61,
403 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
404 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d,
405 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b,
406 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
407 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
408 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5,
409 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3,
410 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1,
411 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
412 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
413 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,
414 0xfc, 0xfd, 0xfe, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
415 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
416 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
417 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,
418 };
419 tlv2->SetValue(tlv2val, sizeof(tlv2val));
420
421 packet->TlvPushBack(tlv2);
422
423 uint8_t buffer[] = {
424 0x0c, 0x00, 0x07, 0x01, 0x33, 0x01, 0x00, 0x02, 0x98, 0x64, 0x01, 0x2c, 0x00, 0x01,
425 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
426 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
427 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
428 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
429 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
430 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55,
431 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63,
432 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71,
433 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
434 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d,
435 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b,
436 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
437 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
438 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5,
439 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3,
440 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1,
441 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
442 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd,
443 0xfe, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
444 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a,
445 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
446 0x29, 0x2a, 0x2b, 0x2c,
447 };
448 AddTestCase(new PbbTestCase("7", packet, buffer, sizeof(buffer)),
449 TestCase::Duration::QUICK);
450 }
451
452 /* Test 8
453 * ,------------------
454 * | PACKET
455 * |------------------
456 * | * Packet version: 0
457 * | * Packet flags: 12
458 * | * Packet seq number: 8
459 * | | * Packet TLV Block
460 * | | - TLV
461 * | | Flags = 0
462 * | | Type = 1; Value = (warning: parameter is NULL)
463 * | ,-------------------
464 * | | MESSAGE
465 * | |-------------------
466 * | | * Message type: 1
467 * | | * Message flags: 0
468 * | `-------------------
469 * |
470 * `------------------
471 */
472 {
474 packet->SetSequenceNumber(8);
475
477 tlv1->SetType(1);
478 packet->TlvPushBack(tlv1);
479
481 msg1->SetType(1);
482 packet->MessagePushBack(msg1);
483
484 uint8_t buffer[] = {
485 0x0c,
486 0x00,
487 0x08,
488 0x00,
489 0x02,
490 0x01,
491 0x00,
492 0x01,
493 0x03,
494 0x00,
495 0x06,
496 0x00,
497 0x00,
498 };
499 AddTestCase(new PbbTestCase("8", packet, buffer, sizeof(buffer)),
500 TestCase::Duration::QUICK);
501 }
502
503 /* Test 9
504 * ,------------------
505 * | PACKET
506 * |------------------
507 * | * Packet version: 0
508 * | * Packet flags: 12
509 * | * Packet seq number: 9
510 * | | * Packet TLV Block
511 * | | - TLV
512 * | | Flags = 0
513 * | | Type = 1; Value = (warning: parameter is NULL)
514 * | ,-------------------
515 * | | MESSAGE
516 * | |-------------------
517 * | | * Message type: 1
518 * | | * Message flags: 0
519 * | `-------------------
520 * |
521 * | ,-------------------
522 * | | MESSAGE
523 * | |-------------------
524 * | | * Message type: 2
525 * | | * Message flags: 128
526 * | | * Originator address: 10.0.0.1
527 * | `-------------------
528 * |
529 * `------------------
530 */
531 {
533 packet->SetSequenceNumber(9);
534
536 tlv1->SetType(1);
537 packet->TlvPushBack(tlv1);
538
540 msg1->SetType(1);
541 packet->MessagePushBack(msg1);
542
544 msg2->SetType(2);
545 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
546 packet->MessagePushBack(msg2);
547
548 uint8_t buffer[] = {
549 0x0c, 0x00, 0x09, 0x00, 0x02, 0x01, 0x00, 0x01,
550 0x03, 0x00, 0x06, 0x00, 0x00, 0x02, 0x83, 0x00, /* [14] used to be 0x80 */
551 0x0a, 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00,
552 };
553 AddTestCase(new PbbTestCase("9", packet, buffer, sizeof(buffer)),
554 TestCase::Duration::QUICK);
555 }
556
557 /* Test 10
558 * ,------------------
559 * | PACKET
560 * |------------------
561 * | * Packet version: 0
562 * | * Packet flags: 12
563 * | * Packet seq number: 10
564 * | | * Packet TLV Block
565 * | | - TLV
566 * | | Flags = 0
567 * | | Type = 1; Value = (warning: parameter is NULL)
568 * | ,-------------------
569 * | | MESSAGE
570 * | |-------------------
571 * | | * Message type: 1
572 * | | * Message flags: 0
573 * | `-------------------
574 * |
575 * | ,-------------------
576 * | | MESSAGE
577 * | |-------------------
578 * | | * Message type: 2
579 * | | * Message flags: 160
580 * | | * Originator address: 10.0.0.1
581 * | | * Hop count: 1
582 * | `-------------------
583 * |
584 * `------------------
585 */
586 {
588 packet->SetSequenceNumber(10);
589
591 tlv1->SetType(1);
592 packet->TlvPushBack(tlv1);
593
595 msg1->SetType(1);
596 packet->MessagePushBack(msg1);
597
599 msg2->SetType(2);
600 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
601 msg2->SetHopCount(1);
602 packet->MessagePushBack(msg2);
603
604 uint8_t buffer[] = {
605 0x0c, 0x00, 0x0a, 0x00, 0x02, 0x01, 0x00, 0x01,
606 0x03, 0x00, 0x06, 0x00, 0x00, 0x02, 0xa3, 0x00, /* [14] used to be 0xa0 */
607 0x0b, 0x0a, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
608 };
609 AddTestCase(new PbbTestCase("10", packet, buffer, sizeof(buffer)),
610 TestCase::Duration::QUICK);
611 }
612
613 /* Test 11
614 * ,------------------
615 * | PACKET
616 * |------------------
617 * | * Packet version: 0
618 * | * Packet flags: 12
619 * | * Packet seq number: 11
620 * | | * Packet TLV Block
621 * | | - TLV
622 * | | Flags = 0
623 * | | Type = 1; Value = (warning: parameter is NULL)
624 * | ,-------------------
625 * | | MESSAGE
626 * | |-------------------
627 * | | * Message type: 1
628 * | | * Message flags: 0
629 * | `-------------------
630 * |
631 * | ,-------------------
632 * | | MESSAGE
633 * | |-------------------
634 * | | * Message type: 2
635 * | | * Message flags: 224
636 * | | * Originator address: 10.0.0.1
637 * | | * Hop limit: 255
638 * | | * Hop count: 1
639 * | `-------------------
640 * |
641 * `------------------
642 */
643 {
645 packet->SetSequenceNumber(11);
646
648 tlv1->SetType(1);
649 packet->TlvPushBack(tlv1);
650
652 msg1->SetType(1);
653 packet->MessagePushBack(msg1);
654
656 msg2->SetType(2);
657 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
658 msg2->SetHopLimit(255);
659 msg2->SetHopCount(1);
660 packet->MessagePushBack(msg2);
661
662 uint8_t buffer[] = {
663 0x0c, 0x00, 0x0b, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03,
664 0x00, 0x06, 0x00, 0x00, 0x02, 0xe3, 0x00, /* [14] used to be 0xe0 */
665 0x0c, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x01, 0x00, 0x00,
666 };
667 AddTestCase(new PbbTestCase("11", packet, buffer, sizeof(buffer)),
668 TestCase::Duration::QUICK);
669 }
670
671 /* Test 12
672 * ,------------------
673 * | PACKET
674 * |------------------
675 * | * Packet version: 0
676 * | * Packet flags: 12
677 * | * Packet seq number: 12
678 * | | * Packet TLV Block
679 * | | - TLV
680 * | | Flags = 0
681 * | | Type = 1; Value = (warning: parameter is NULL)
682 * | ,-------------------
683 * | | MESSAGE
684 * | |-------------------
685 * | | * Message type: 1
686 * | | * Message flags: 0
687 * | `-------------------
688 * |
689 * | ,-------------------
690 * | | MESSAGE
691 * | |-------------------
692 * | | * Message type: 2
693 * | | * Message flags: 240
694 * | | * Originator address: 10.0.0.1
695 * | | * Hop limit: 255
696 * | | * Hop count: 1
697 * | | * Message seq number: 12345
698 * | `-------------------
699 * |
700 * `------------------
701 */
702 {
704 packet->SetSequenceNumber(12);
705
707 tlv1->SetType(1);
708 packet->TlvPushBack(tlv1);
709
711 msg1->SetType(1);
712 packet->MessagePushBack(msg1);
713
715 msg2->SetType(2);
716 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
717 msg2->SetHopLimit(255);
718 msg2->SetHopCount(1);
719 msg2->SetSequenceNumber(12345);
720 packet->MessagePushBack(msg2);
721
722 uint8_t buffer[] = {
723 0x0c, 0x00, 0x0c, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x06,
724 0x00, 0x00, 0x02, 0xf3, 0x00, /* [14] - 0xf0 */
725 0x0e, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00,
726 };
727 AddTestCase(new PbbTestCase("12", packet, buffer, sizeof(buffer)),
728 TestCase::Duration::QUICK);
729 }
730
731 /* Test 13
732 * Test 13 has been removed because it was identical to test 12
733 * The following tests have not been renumbered
734 */
735
736 /* Test 14
737 * ,------------------
738 * | PACKET
739 * |------------------
740 * | * Packet version: 0
741 * | * Packet flags: 12
742 * | * Packet seq number: 14
743 * | | * Packet TLV Block
744 * | | - TLV
745 * | | Flags = 0
746 * | | Type = 1; Value = (warning: parameter is NULL)
747 * | ,-------------------
748 * | | MESSAGE
749 * | |-------------------
750 * | | * Message type: 1
751 * | | * Message flags: 0
752 * | | * Message TLV Block
753 * | | - TLV
754 * | | Flags = 0
755 * | | Type = 1; Value = (warning: parameter is NULL)
756 * | `-------------------
757 * |
758 * | ,-------------------
759 * | | MESSAGE
760 * | |-------------------
761 * | | * Message type: 2
762 * | | * Message flags: 240
763 * | | * Originator address: 10.0.0.1
764 * | | * Hop limit: 255
765 * | | * Hop count: 1
766 * | | * Message seq number: 12345
767 * | `-------------------
768 * |
769 * `------------------
770 */
771 {
773 packet->SetSequenceNumber(14);
774
776 tlv1->SetType(1);
777 packet->TlvPushBack(tlv1);
778
780 msg1->SetType(1);
781
782 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
783 msg1tlv1->SetType(1);
784 msg1->TlvPushBack(msg1tlv1);
785
786 packet->MessagePushBack(msg1);
787
789 msg2->SetType(2);
790 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
791 msg2->SetHopLimit(255);
792 msg2->SetHopCount(1);
793 msg2->SetSequenceNumber(12345);
794 packet->MessagePushBack(msg2);
795
796 uint8_t buffer[] = {
797 0x0c, 0x00, 0x0e, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00,
798 0x08, 0x00, 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x0e, 0x0a, /* [16] - 0xf0 */
799 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00,
800 };
801 AddTestCase(new PbbTestCase("14", packet, buffer, sizeof(buffer)),
802 TestCase::Duration::QUICK);
803 }
804
805 /* Test 15
806 * ,------------------
807 * | PACKET
808 * |------------------
809 * | * Packet version: 0
810 * | * Packet flags: 12
811 * | * Packet seq number: 15
812 * | | * Packet TLV Block
813 * | | - TLV
814 * | | Flags = 0
815 * | | Type = 1; Value = (warning: parameter is NULL)
816 * | ,-------------------
817 * | | MESSAGE
818 * | |-------------------
819 * | | * Message type: 1
820 * | | * Message flags: 0
821 * | | * Message TLV Block
822 * | | - TLV
823 * | | Flags = 0
824 * | | Type = 1; Value = (warning: parameter is NULL)
825 * | `-------------------
826 * |
827 * | ,-------------------
828 * | | MESSAGE
829 * | |-------------------
830 * | | * Message type: 2
831 * | | * Message flags: 240
832 * | | * Originator address: 10.0.0.1
833 * | | * Hop limit: 255
834 * | | * Hop count: 1
835 * | | * Message seq number: 12345
836 * | | - Address block (1 addresses)
837 * | | - 0.0.0.0/32
838 * | | - Flags = 0
839 * | | - ADDRESS TLV block (0 TLVs)
840 * | `-------------------
841 * |
842 * `------------------
843 */
844 {
846 packet->SetSequenceNumber(15);
847
849 tlv1->SetType(1);
850 packet->TlvPushBack(tlv1);
851
853 msg1->SetType(1);
854
855 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
856 msg1tlv1->SetType(1);
857 msg1->TlvPushBack(msg1tlv1);
858
859 packet->MessagePushBack(msg1);
860
862 msg2->SetType(2);
863 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
864 msg2->SetHopLimit(255);
865 msg2->SetHopCount(1);
866 msg2->SetSequenceNumber(12345);
867
869 msg2a1->AddressPushBack(Ipv4Address("0.0.0.0"));
870 msg2->AddressBlockPushBack(msg2a1);
871
872 packet->MessagePushBack(msg2);
873
874 uint8_t buffer[] = {
875 0x0c, 0x00, 0x0f, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00,
876 0x08, 0x00, 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */
877 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x01,
878 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
879 };
880 AddTestCase(new PbbTestCase("15", packet, buffer, sizeof(buffer)),
881 TestCase::Duration::QUICK);
882 }
883
884 /* Test 16
885 * ,------------------
886 * | PACKET
887 * |------------------
888 * | * Packet version: 0
889 * | * Packet flags: 12
890 * | * Packet seq number: 16
891 * | | * Packet TLV Block
892 * | | - TLV
893 * | | Flags = 0
894 * | | Type = 1; Value = (warning: parameter is NULL)
895 * | ,-------------------
896 * | | MESSAGE
897 * | |-------------------
898 * | | * Message type: 1
899 * | | * Message flags: 0
900 * | | * Message TLV Block
901 * | | - TLV
902 * | | Flags = 0
903 * | | Type = 1; Value = (warning: parameter is NULL)
904 * | `-------------------
905 * |
906 * | ,-------------------
907 * | | MESSAGE
908 * | |-------------------
909 * | | * Message type: 2
910 * | | * Message flags: 240
911 * | | * Originator address: 10.0.0.1
912 * | | * Hop limit: 255
913 * | | * Hop count: 1
914 * | | * Message seq number: 12345
915 * | | - Address block (1 addresses)
916 * | | - 255.255.255.255/32
917 * | | - Flags = 0
918 * | | - ADDRESS TLV block (0 TLVs)
919 * | `-------------------
920 * |
921 * `------------------
922 */
923 {
925 packet->SetSequenceNumber(16);
926
928 tlv1->SetType(1);
929 packet->TlvPushBack(tlv1);
930
932 msg1->SetType(1);
933
934 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
935 msg1tlv1->SetType(1);
936 msg1->TlvPushBack(msg1tlv1);
937
938 packet->MessagePushBack(msg1);
939
941 msg2->SetType(2);
942 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
943 msg2->SetHopLimit(255);
944 msg2->SetHopCount(1);
945 msg2->SetSequenceNumber(12345);
946
948 msg2a1->AddressPushBack(Ipv4Address("255.255.255.255"));
949 msg2->AddressBlockPushBack(msg2a1);
950
951 packet->MessagePushBack(msg2);
952
953 uint8_t buffer[] = {
954 0x0c, 0x00, 0x10, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00,
955 0x08, 0x00, 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */
956 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x01,
957 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
958 };
959 AddTestCase(new PbbTestCase("16", packet, buffer, sizeof(buffer)),
960 TestCase::Duration::QUICK);
961 }
962
963 /* Test 17
964 * ,------------------
965 * | PACKET
966 * |------------------
967 * | * Packet version: 0
968 * | * Packet flags: 12
969 * | * Packet seq number: 17
970 * | | * Packet TLV Block
971 * | | - TLV
972 * | | Flags = 0
973 * | | Type = 1; Value = (warning: parameter is NULL)
974 * | ,-------------------
975 * | | MESSAGE
976 * | |-------------------
977 * | | * Message type: 1
978 * | | * Message flags: 0
979 * | | * Message TLV Block
980 * | | - TLV
981 * | | Flags = 0
982 * | | Type = 1; Value = (warning: parameter is NULL)
983 * | `-------------------
984 * |
985 * | ,-------------------
986 * | | MESSAGE
987 * | |-------------------
988 * | | * Message type: 2
989 * | | * Message flags: 240
990 * | | * Originator address: 10.0.0.1
991 * | | * Hop limit: 255
992 * | | * Hop count: 1
993 * | | * Message seq number: 12345
994 * | | - Address block (1 addresses)
995 * | | - 0.0.0.1/32
996 * | | - Flags = 0
997 * | | - ADDRESS TLV block (0 TLVs)
998 * | `-------------------
999 * |
1000 * `------------------
1001 */
1002 {
1004 packet->SetSequenceNumber(17);
1005
1006 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1007 tlv1->SetType(1);
1008 packet->TlvPushBack(tlv1);
1009
1011 msg1->SetType(1);
1012
1013 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1014 msg1tlv1->SetType(1);
1015 msg1->TlvPushBack(msg1tlv1);
1016
1017 packet->MessagePushBack(msg1);
1018
1020 msg2->SetType(2);
1021 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1022 msg2->SetHopLimit(255);
1023 msg2->SetHopCount(1);
1024 msg2->SetSequenceNumber(12345);
1025
1027 msg2a1->AddressPushBack(Ipv4Address("0.0.0.1"));
1028 msg2->AddressBlockPushBack(msg2a1);
1029
1030 packet->MessagePushBack(msg2);
1031
1032 uint8_t buffer[] = {
1033 0x0c, 0x00, 0x11, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00,
1034 0x08, 0x00, 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */
1035 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x01,
1036 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
1037 };
1038 AddTestCase(new PbbTestCase("17", packet, buffer, sizeof(buffer)),
1039 TestCase::Duration::QUICK);
1040 }
1041
1042 /* Test 18
1043 * ,------------------
1044 * | PACKET
1045 * |------------------
1046 * | * Packet version: 0
1047 * | * Packet flags: 12
1048 * | * Packet seq number: 18
1049 * | | * Packet TLV Block
1050 * | | - TLV
1051 * | | Flags = 0
1052 * | | Type = 1; Value = (warning: parameter is NULL)
1053 * | ,-------------------
1054 * | | MESSAGE
1055 * | |-------------------
1056 * | | * Message type: 1
1057 * | | * Message flags: 0
1058 * | | * Message TLV Block
1059 * | | - TLV
1060 * | | Flags = 0
1061 * | | Type = 1; Value = (warning: parameter is NULL)
1062 * | `-------------------
1063 * |
1064 * | ,-------------------
1065 * | | MESSAGE
1066 * | |-------------------
1067 * | | * Message type: 2
1068 * | | * Message flags: 240
1069 * | | * Originator address: 10.0.0.1
1070 * | | * Hop limit: 255
1071 * | | * Hop count: 1
1072 * | | * Message seq number: 12345
1073 * | | - Address block (1 addresses)
1074 * | | - 10.0.0.0/32
1075 * | | - Flags = 0
1076 * | | - ADDRESS TLV block (0 TLVs)
1077 * | `-------------------
1078 * |
1079 * `------------------
1080 */
1081 {
1083 packet->SetSequenceNumber(18);
1084
1085 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1086 tlv1->SetType(1);
1087 packet->TlvPushBack(tlv1);
1088
1090 msg1->SetType(1);
1091
1092 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1093 msg1tlv1->SetType(1);
1094 msg1->TlvPushBack(msg1tlv1);
1095
1096 packet->MessagePushBack(msg1);
1097
1099 msg2->SetType(2);
1100 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1101 msg2->SetHopLimit(255);
1102 msg2->SetHopCount(1);
1103 msg2->SetSequenceNumber(12345);
1104
1106 msg2a1->AddressPushBack(Ipv4Address("10.0.0.0"));
1107 msg2->AddressBlockPushBack(msg2a1);
1108
1109 packet->MessagePushBack(msg2);
1110
1111 uint8_t buffer[] = {
1112 0x0c, 0x00, 0x12, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00,
1113 0x08, 0x00, 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */
1114 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x01,
1115 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
1116 };
1117 AddTestCase(new PbbTestCase("18", packet, buffer, sizeof(buffer)),
1118 TestCase::Duration::QUICK);
1119 }
1120
1121 /* Test 19
1122 * ,------------------
1123 * | PACKET
1124 * |------------------
1125 * | * Packet version: 0
1126 * | * Packet flags: 12
1127 * | * Packet seq number: 19
1128 * | | * Packet TLV Block
1129 * | | - TLV
1130 * | | Flags = 0
1131 * | | Type = 1; Value = (warning: parameter is NULL)
1132 * | ,-------------------
1133 * | | MESSAGE
1134 * | |-------------------
1135 * | | * Message type: 1
1136 * | | * Message flags: 0
1137 * | | * Message TLV Block
1138 * | | - TLV
1139 * | | Flags = 0
1140 * | | Type = 1; Value = (warning: parameter is NULL)
1141 * | `-------------------
1142 * |
1143 * | ,-------------------
1144 * | | MESSAGE
1145 * | |-------------------
1146 * | | * Message type: 2
1147 * | | * Message flags: 240
1148 * | | * Originator address: 10.0.0.1
1149 * | | * Hop limit: 255
1150 * | | * Hop count: 1
1151 * | | * Message seq number: 12345
1152 * | | - Address block (1 addresses)
1153 * | | - 10.0.0.1/32
1154 * | | - Flags = 0
1155 * | | - ADDRESS TLV block (0 TLVs)
1156 * | `-------------------
1157 * |
1158 * `------------------
1159 */
1160 {
1162 packet->SetSequenceNumber(19);
1163
1164 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1165 tlv1->SetType(1);
1166 packet->TlvPushBack(tlv1);
1167
1169 msg1->SetType(1);
1170
1171 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1172 msg1tlv1->SetType(1);
1173 msg1->TlvPushBack(msg1tlv1);
1174
1175 packet->MessagePushBack(msg1);
1176
1178 msg2->SetType(2);
1179 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1180 msg2->SetHopLimit(255);
1181 msg2->SetHopCount(1);
1182 msg2->SetSequenceNumber(12345);
1183
1185 msg2a1->AddressPushBack(Ipv4Address("10.0.0.1"));
1186 msg2->AddressBlockPushBack(msg2a1);
1187
1188 packet->MessagePushBack(msg2);
1189
1190 uint8_t buffer[] = {
1191 0x0c, 0x00, 0x13, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00,
1192 0x08, 0x00, 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x16, 0x0a, /* [16] - 0xf0 */
1193 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x01,
1194 0x00, 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00,
1195 };
1196 AddTestCase(new PbbTestCase("19", packet, buffer, sizeof(buffer)),
1197 TestCase::Duration::QUICK);
1198 }
1199
1200 /* Test 20
1201 * ,------------------
1202 * | PACKET
1203 * |------------------
1204 * | * Packet version: 0
1205 * | * Packet flags: 12
1206 * | * Packet seq number: 20
1207 * | | * Packet TLV Block
1208 * | | - TLV
1209 * | | Flags = 0
1210 * | | Type = 1; Value = (warning: parameter is NULL)
1211 * | ,-------------------
1212 * | | MESSAGE
1213 * | |-------------------
1214 * | | * Message type: 1
1215 * | | * Message flags: 0
1216 * | | * Message TLV Block
1217 * | | - TLV
1218 * | | Flags = 0
1219 * | | Type = 1; Value = (warning: parameter is NULL)
1220 * | `-------------------
1221 * |
1222 * | ,-------------------
1223 * | | MESSAGE
1224 * | |-------------------
1225 * | | * Message type: 2
1226 * | | * Message flags: 240
1227 * | | * Originator address: 10.0.0.1
1228 * | | * Hop limit: 255
1229 * | | * Hop count: 1
1230 * | | * Message seq number: 12345
1231 * | | - Address block (2 addresses)
1232 * | | - 10.0.0.1/32
1233 * | | - 10.0.0.2/32
1234 * | | - Flags = 128
1235 * | | - ADDRESS TLV block (0 TLVs)
1236 * | `-------------------
1237 * |
1238 * `------------------
1239 */
1240 {
1242 packet->SetSequenceNumber(20);
1243
1244 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1245 tlv1->SetType(1);
1246 packet->TlvPushBack(tlv1);
1247
1249 msg1->SetType(1);
1250
1251 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1252 msg1tlv1->SetType(1);
1253 msg1->TlvPushBack(msg1tlv1);
1254
1255 packet->MessagePushBack(msg1);
1256
1258 msg2->SetType(2);
1259 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1260 msg2->SetHopLimit(255);
1261 msg2->SetHopCount(1);
1262 msg2->SetSequenceNumber(12345);
1263
1265 msg2a1->AddressPushBack(Ipv4Address("10.0.0.1"));
1266 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
1267 msg2->AddressBlockPushBack(msg2a1);
1268
1269 packet->MessagePushBack(msg2);
1270
1271 uint8_t buffer[] = {
1272 0x0c, 0x00, 0x14, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00,
1273 0x08, 0x00, 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x18, 0x0a, /* [16] - 0xf0 */
1274 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02,
1275 0x80, 0x03, 0x0a, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00,
1276 };
1277 AddTestCase(new PbbTestCase("20", packet, buffer, sizeof(buffer)),
1278 TestCase::Duration::QUICK);
1279 }
1280
1281 /* Test 21
1282 * ,------------------
1283 * | PACKET
1284 * |------------------
1285 * | * Packet version: 0
1286 * | * Packet flags: 12
1287 * | * Packet seq number: 21
1288 * | | * Packet TLV Block
1289 * | | - TLV
1290 * | | Flags = 0
1291 * | | Type = 1; Value = (warning: parameter is NULL)
1292 * | ,-------------------
1293 * | | MESSAGE
1294 * | |-------------------
1295 * | | * Message type: 1
1296 * | | * Message flags: 0
1297 * | | * Message TLV Block
1298 * | | - TLV
1299 * | | Flags = 0
1300 * | | Type = 1; Value = (warning: parameter is NULL)
1301 * | `-------------------
1302 * |
1303 * | ,-------------------
1304 * | | MESSAGE
1305 * | |-------------------
1306 * | | * Message type: 2
1307 * | | * Message flags: 240
1308 * | | * Originator address: 10.0.0.1
1309 * | | * Hop limit: 255
1310 * | | * Hop count: 1
1311 * | | * Message seq number: 12345
1312 * | | - Address block (2 addresses)
1313 * | | - 10.0.0.2/32
1314 * | | - 10.1.1.2/32
1315 * | | - Flags = 192
1316 * | | - ADDRESS TLV block (0 TLVs)
1317 * | `-------------------
1318 * |
1319 * `------------------
1320 */
1321 {
1323 packet->SetSequenceNumber(21);
1324
1325 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1326 tlv1->SetType(1);
1327 packet->TlvPushBack(tlv1);
1328
1330 msg1->SetType(1);
1331
1332 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1333 msg1tlv1->SetType(1);
1334 msg1->TlvPushBack(msg1tlv1);
1335
1336 packet->MessagePushBack(msg1);
1337
1339 msg2->SetType(2);
1340 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1341 msg2->SetHopLimit(255);
1342 msg2->SetHopCount(1);
1343 msg2->SetSequenceNumber(12345);
1344
1346 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
1347 msg2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
1348 msg2->AddressBlockPushBack(msg2a1);
1349
1350 packet->MessagePushBack(msg2);
1351
1352 uint8_t buffer[] = {
1353 0x0c, 0x00, 0x15, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x08,
1354 0x00, 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x1a, 0x0a, /* [16] - 0xf0 */
1355 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02, 0xc0,
1356 0x01, 0x0a, 0x01, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
1357 };
1358 AddTestCase(new PbbTestCase("21", packet, buffer, sizeof(buffer)),
1359 TestCase::Duration::QUICK);
1360 }
1361
1362 /* Test 22
1363 * ,------------------
1364 * | PACKET
1365 * |------------------
1366 * | * Packet version: 0
1367 * | * Packet flags: 12
1368 * | * Packet seq number: 22
1369 * | | * Packet TLV Block
1370 * | | - TLV
1371 * | | Flags = 0
1372 * | | Type = 1; Value = (warning: parameter is NULL)
1373 * | ,-------------------
1374 * | | MESSAGE
1375 * | |-------------------
1376 * | | * Message type: 1
1377 * | | * Message flags: 0
1378 * | | * Message TLV Block
1379 * | | - TLV
1380 * | | Flags = 0
1381 * | | Type = 1; Value = (warning: parameter is NULL)
1382 * | `-------------------
1383 * |
1384 * | ,-------------------
1385 * | | MESSAGE
1386 * | |-------------------
1387 * | | * Message type: 2
1388 * | | * Message flags: 240
1389 * | | * Originator address: 10.0.0.1
1390 * | | * Hop limit: 255
1391 * | | * Hop count: 1
1392 * | | * Message seq number: 12345
1393 * | | - Address block (2 addresses)
1394 * | | - 10.0.0.2/32
1395 * | | - 10.1.1.2/32
1396 * | | - Flags = 192
1397 * | | - ADDRESS TLV block (0 TLVs)
1398 * | | - Address block (2 addresses)
1399 * | | - 10.0.0.0/32
1400 * | | - 11.0.0.0/32
1401 * | | - Flags = 32
1402 * | | - ADDRESS TLV block (0 TLVs)
1403 * | `-------------------
1404 * |
1405 * `------------------
1406 */
1407 {
1409 packet->SetSequenceNumber(22);
1410
1411 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1412 tlv1->SetType(1);
1413 packet->TlvPushBack(tlv1);
1414
1416 msg1->SetType(1);
1417
1418 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1419 msg1tlv1->SetType(1);
1420 msg1->TlvPushBack(msg1tlv1);
1421
1422 packet->MessagePushBack(msg1);
1423
1425 msg2->SetType(2);
1426 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1427 msg2->SetHopLimit(255);
1428 msg2->SetHopCount(1);
1429 msg2->SetSequenceNumber(12345);
1430
1432 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
1433 msg2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
1434 msg2->AddressBlockPushBack(msg2a1);
1435
1437 msg2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
1438 msg2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
1439 msg2->AddressBlockPushBack(msg2a2);
1440
1441 packet->MessagePushBack(msg2);
1442
1443 uint8_t buffer[] = {
1444 0x0c, 0x00, 0x16, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00, 0x02, 0x01,
1445 0x00, 0x02, 0xf3, 0x00, 0x21, 0x0a, /* [16] - 0xf0 */
1446 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02, 0xc0, 0x01, 0x0a, 0x01,
1447 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x02, 0x20, 0x03, 0x0a, 0x0b, 0x00, 0x00,
1448 };
1449 AddTestCase(new PbbTestCase("22", packet, buffer, sizeof(buffer)),
1450 TestCase::Duration::QUICK);
1451 }
1452
1453 /* Test 23
1454 * ,------------------
1455 * | PACKET
1456 * |------------------
1457 * | * Packet version: 0
1458 * | * Packet flags: 12
1459 * | * Packet seq number: 23
1460 * | | * Packet TLV Block
1461 * | | - TLV
1462 * | | Flags = 0
1463 * | | Type = 1; Value = (warning: parameter is NULL)
1464 * | ,-------------------
1465 * | | MESSAGE
1466 * | |-------------------
1467 * | | * Message type: 1
1468 * | | * Message flags: 0
1469 * | | * Message TLV Block
1470 * | | - TLV
1471 * | | Flags = 0
1472 * | | Type = 1; Value = (warning: parameter is NULL)
1473 * | `-------------------
1474 * |
1475 * | ,-------------------
1476 * | | MESSAGE
1477 * | |-------------------
1478 * | | * Message type: 2
1479 * | | * Message flags: 240
1480 * | | * Originator address: 10.0.0.1
1481 * | | * Hop limit: 255
1482 * | | * Hop count: 1
1483 * | | * Message seq number: 12345
1484 * | | - Address block (2 addresses)
1485 * | | - 10.0.0.2/32
1486 * | | - 10.1.1.2/32
1487 * | | - Flags = 192
1488 * | | - ADDRESS TLV block (0 TLVs)
1489 * | | - Address block (4 addresses)
1490 * | | - 10.0.0.0/32
1491 * | | - 11.0.0.0/32
1492 * | | - 10.0.0.5/16
1493 * | | - 10.0.0.6/24
1494 * | | - Flags = 8
1495 * | | - ADDRESS TLV block (0 TLVs)
1496 * | `-------------------
1497 * |
1498 * `------------------
1499 */
1500 {
1502 packet->SetSequenceNumber(23);
1503
1504 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1505 tlv1->SetType(1);
1506 packet->TlvPushBack(tlv1);
1507
1509 msg1->SetType(1);
1510
1511 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1512 msg1tlv1->SetType(1);
1513 msg1->TlvPushBack(msg1tlv1);
1514
1515 packet->MessagePushBack(msg1);
1516
1518 msg2->SetType(2);
1519 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1520 msg2->SetHopLimit(255);
1521 msg2->SetHopCount(1);
1522 msg2->SetSequenceNumber(12345);
1523
1525 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
1526 msg2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
1527 msg2->AddressBlockPushBack(msg2a1);
1528
1530 msg2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
1531 msg2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
1532 msg2a2->AddressPushBack(Ipv4Address("10.0.0.5"));
1533 msg2a2->AddressPushBack(Ipv4Address("10.0.0.6"));
1534
1535 msg2a2->PrefixPushBack(32);
1536 msg2a2->PrefixPushBack(32);
1537 msg2a2->PrefixPushBack(16);
1538 msg2a2->PrefixPushBack(24);
1539
1540 msg2->AddressBlockPushBack(msg2a2);
1541
1542 packet->MessagePushBack(msg2);
1543
1544 uint8_t buffer[] = {
1545 0x0c, 0x00, 0x17, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00,
1546 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x32, 0x0a, /* [16] - 0xf0 */
1547 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02, 0xc0, 0x01,
1548 0x0a, 0x01, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04, 0x08, 0x0a,
1549 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x05, 0x0a,
1550 0x00, 0x00, 0x06, 0x20, 0x20, 0x10, 0x18, 0x00, 0x00,
1551 };
1552 AddTestCase(new PbbTestCase("23", packet, buffer, sizeof(buffer)),
1553 TestCase::Duration::QUICK);
1554 }
1555
1556 /* Test 24
1557 * ,------------------
1558 * | PACKET
1559 * |------------------
1560 * | * Packet version: 0
1561 * | * Packet flags: 12
1562 * | * Packet seq number: 24
1563 * | | * Packet TLV Block
1564 * | | - TLV
1565 * | | Flags = 0
1566 * | | Type = 1; Value = (warning: parameter is NULL)
1567 * | ,-------------------
1568 * | | MESSAGE
1569 * | |-------------------
1570 * | | * Message type: 1
1571 * | | * Message flags: 0
1572 * | | * Message TLV Block
1573 * | | - TLV
1574 * | | Flags = 0
1575 * | | Type = 1; Value = (warning: parameter is NULL)
1576 * | `-------------------
1577 * |
1578 * | ,-------------------
1579 * | | MESSAGE
1580 * | |-------------------
1581 * | | * Message type: 2
1582 * | | * Message flags: 240
1583 * | | * Originator address: 10.0.0.1
1584 * | | * Hop limit: 255
1585 * | | * Hop count: 1
1586 * | | * Message seq number: 12345
1587 * | | - Address block (2 addresses)
1588 * | | - 10.0.0.2/32
1589 * | | - 10.1.1.2/32
1590 * | | - Flags = 192
1591 * | | - ADDRESS TLV block (0 TLVs)
1592 * | | - Address block (4 addresses)
1593 * | | - 10.0.0.0/32
1594 * | | - 11.0.0.0/32
1595 * | | - 10.0.0.5/16
1596 * | | - 10.0.0.6/24
1597 * | | - Flags = 8
1598 * | | - ADDRESS TLV block (1 TLVs)
1599 * | | - TLV
1600 * | | Flags = 0
1601 * | | Type = 1; Value = (warning: parameter is NULL)
1602 * | `-------------------
1603 * |
1604 * `------------------
1605 */
1606 {
1608 packet->SetSequenceNumber(24);
1609
1610 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1611 tlv1->SetType(1);
1612 packet->TlvPushBack(tlv1);
1613
1615 msg1->SetType(1);
1616
1617 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1618 msg1tlv1->SetType(1);
1619 msg1->TlvPushBack(msg1tlv1);
1620
1621 packet->MessagePushBack(msg1);
1622
1624 msg2->SetType(2);
1625 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1626 msg2->SetHopLimit(255);
1627 msg2->SetHopCount(1);
1628 msg2->SetSequenceNumber(12345);
1629
1631 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
1632 msg2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
1633 msg2->AddressBlockPushBack(msg2a1);
1634
1636 msg2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
1637 msg2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
1638 msg2a2->AddressPushBack(Ipv4Address("10.0.0.5"));
1639 msg2a2->AddressPushBack(Ipv4Address("10.0.0.6"));
1640
1641 msg2a2->PrefixPushBack(32);
1642 msg2a2->PrefixPushBack(32);
1643 msg2a2->PrefixPushBack(16);
1644 msg2a2->PrefixPushBack(24);
1645
1647 msg2a2tlv1->SetType(1);
1648 msg2a2->TlvPushBack(msg2a2tlv1);
1649
1650 msg2->AddressBlockPushBack(msg2a2);
1651
1652 packet->MessagePushBack(msg2);
1653
1654 uint8_t buffer[] = {
1655 0x0c, 0x00, 0x18, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00,
1656 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x34, 0x0a, /* [16] - 0xf0 */
1657 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02, 0xc0, 0x01,
1658 0x0a, 0x01, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04, 0x08, 0x0a,
1659 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x05, 0x0a,
1660 0x00, 0x00, 0x06, 0x20, 0x20, 0x10, 0x18, 0x00, 0x02, 0x01, 0x00,
1661 };
1662 AddTestCase(new PbbTestCase("24", packet, buffer, sizeof(buffer)),
1663 TestCase::Duration::QUICK);
1664 }
1665
1666 /* Test 25
1667 * ,------------------
1668 * | PACKET
1669 * |------------------
1670 * | * Packet version: 0
1671 * | * Packet flags: 12
1672 * | * Packet seq number: 25
1673 * | | * Packet TLV Block
1674 * | | - TLV
1675 * | | Flags = 0
1676 * | | Type = 1; Value = (warning: parameter is NULL)
1677 * | ,-------------------
1678 * | | MESSAGE
1679 * | |-------------------
1680 * | | * Message type: 1
1681 * | | * Message flags: 0
1682 * | | * Message TLV Block
1683 * | | - TLV
1684 * | | Flags = 0
1685 * | | Type = 1; Value = (warning: parameter is NULL)
1686 * | `-------------------
1687 * |
1688 * | ,-------------------
1689 * | | MESSAGE
1690 * | |-------------------
1691 * | | * Message type: 2
1692 * | | * Message flags: 240
1693 * | | * Originator address: 10.0.0.1
1694 * | | * Hop limit: 255
1695 * | | * Hop count: 1
1696 * | | * Message seq number: 12345
1697 * | | - Address block (2 addresses)
1698 * | | - 10.0.0.2/32
1699 * | | - 10.1.1.2/32
1700 * | | - Flags = 192
1701 * | | - ADDRESS TLV block (0 TLVs)
1702 * | | - Address block (4 addresses)
1703 * | | - 10.0.0.0/32
1704 * | | - 11.0.0.0/32
1705 * | | - 10.0.0.5/16
1706 * | | - 10.0.0.6/24
1707 * | | - Flags = 8
1708 * | | - ADDRESS TLV block (1 TLVs)
1709 * | | - TLV
1710 * | | Flags = 64
1711 * | | Index-start = 1
1712 * | | Type = 1; Value = (warning: parameter is NULL)
1713 * | `-------------------
1714 * |
1715 * `------------------
1716 */
1717 {
1719 packet->SetSequenceNumber(25);
1720
1721 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1722 tlv1->SetType(1);
1723 packet->TlvPushBack(tlv1);
1724
1726 msg1->SetType(1);
1727
1728 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1729 msg1tlv1->SetType(1);
1730 msg1->TlvPushBack(msg1tlv1);
1731
1732 packet->MessagePushBack(msg1);
1733
1735 msg2->SetType(2);
1736 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1737 msg2->SetHopLimit(255);
1738 msg2->SetHopCount(1);
1739 msg2->SetSequenceNumber(12345);
1740
1742 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
1743 msg2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
1744 msg2->AddressBlockPushBack(msg2a1);
1745
1747 msg2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
1748 msg2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
1749 msg2a2->AddressPushBack(Ipv4Address("10.0.0.5"));
1750 msg2a2->AddressPushBack(Ipv4Address("10.0.0.6"));
1751
1752 msg2a2->PrefixPushBack(32);
1753 msg2a2->PrefixPushBack(32);
1754 msg2a2->PrefixPushBack(16);
1755 msg2a2->PrefixPushBack(24);
1756
1758 msg2a2tlv1->SetType(1);
1759 msg2a2tlv1->SetIndexStart(1);
1760 msg2a2->TlvPushBack(msg2a2tlv1);
1761
1762 msg2->AddressBlockPushBack(msg2a2);
1763
1764 packet->MessagePushBack(msg2);
1765
1766 uint8_t buffer[] = {
1767 0x0c, 0x00, 0x19, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00,
1768 0x02, 0x01, 0x00, 0x02, 0xf3, 0x00, 0x35, 0x0a, /* [16] - 0xf0 */
1769 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02, 0xc0, 0x01,
1770 0x0a, 0x01, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04, 0x08, 0x0a,
1771 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x05, 0x0a,
1772 0x00, 0x00, 0x06, 0x20, 0x20, 0x10, 0x18, 0x00, 0x03, 0x01, 0x40, 0x01,
1773 };
1774 AddTestCase(new PbbTestCase("25", packet, buffer, sizeof(buffer)),
1775 TestCase::Duration::QUICK);
1776 }
1777
1778 /* Test 26
1779 * ,------------------
1780 * | PACKET
1781 * |------------------
1782 * | * Packet version: 0
1783 * | * Packet flags: 12
1784 * | * Packet seq number: 26
1785 * | | * Packet TLV Block
1786 * | | - TLV
1787 * | | Flags = 0
1788 * | | Type = 1; Value = (warning: parameter is NULL)
1789 * | ,-------------------
1790 * | | MESSAGE
1791 * | |-------------------
1792 * | | * Message type: 1
1793 * | | * Message flags: 0
1794 * | | * Message TLV Block
1795 * | | - TLV
1796 * | | Flags = 0
1797 * | | Type = 1; Value = (warning: parameter is NULL)
1798 * | `-------------------
1799 * |
1800 * | ,-------------------
1801 * | | MESSAGE
1802 * | |-------------------
1803 * | | * Message type: 2
1804 * | | * Message flags: 240
1805 * | | * Originator address: 10.0.0.1
1806 * | | * Hop limit: 255
1807 * | | * Hop count: 1
1808 * | | * Message seq number: 12345
1809 * | | - Address block (2 addresses)
1810 * | | - 10.0.0.2/32
1811 * | | - 10.1.1.2/32
1812 * | | - Flags = 192
1813 * | | - ADDRESS TLV block (0 TLVs)
1814 * | | - Address block (4 addresses)
1815 * | | - 10.0.0.0/32
1816 * | | - 11.0.0.0/32
1817 * | | - 10.0.0.5/16
1818 * | | - 10.0.0.6/24
1819 * | | - Flags = 8
1820 * | | - ADDRESS TLV block (1 TLVs)
1821 * | | - TLV
1822 * | | Flags = 32
1823 * | | Index-start = 1
1824 * | | Index-stop = 3
1825 * | | Type = 1; Value = (warning: parameter is NULL)
1826 * | `-------------------
1827 * |
1828 * `------------------
1829 */
1830 {
1832 packet->SetSequenceNumber(26);
1833
1834 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1835 tlv1->SetType(1);
1836 packet->TlvPushBack(tlv1);
1837
1839 msg1->SetType(1);
1840
1841 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1842 msg1tlv1->SetType(1);
1843 msg1->TlvPushBack(msg1tlv1);
1844
1845 packet->MessagePushBack(msg1);
1846
1848 msg2->SetType(2);
1849 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1850 msg2->SetHopLimit(255);
1851 msg2->SetHopCount(1);
1852 msg2->SetSequenceNumber(12345);
1853
1855 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
1856 msg2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
1857 msg2->AddressBlockPushBack(msg2a1);
1858
1860 msg2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
1861 msg2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
1862 msg2a2->AddressPushBack(Ipv4Address("10.0.0.5"));
1863 msg2a2->AddressPushBack(Ipv4Address("10.0.0.6"));
1864
1865 msg2a2->PrefixPushBack(32);
1866 msg2a2->PrefixPushBack(32);
1867 msg2a2->PrefixPushBack(16);
1868 msg2a2->PrefixPushBack(24);
1869
1871 msg2a2tlv1->SetType(1);
1872 msg2a2tlv1->SetIndexStart(1);
1873 msg2a2tlv1->SetIndexStop(3);
1874 msg2a2->TlvPushBack(msg2a2tlv1);
1875
1876 msg2->AddressBlockPushBack(msg2a2);
1877
1878 packet->MessagePushBack(msg2);
1879
1880 uint8_t buffer[] = {
1881 0x0c, 0x00, 0x1a, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00, 0x02,
1882 0x01, 0x00, 0x02, 0xf3, 0x00, 0x36, 0x0a, /* [16] - 0xf0 */
1883 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02, 0xc0, 0x01, 0x0a,
1884 0x01, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04, 0x08, 0x0a, 0x00, 0x00,
1885 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, 0x06,
1886 0x20, 0x20, 0x10, 0x18, 0x00, 0x04, 0x01, 0x20, 0x01, 0x03,
1887 };
1888 AddTestCase(new PbbTestCase("26", packet, buffer, sizeof(buffer)),
1889 TestCase::Duration::QUICK);
1890 }
1891
1892 /* Test 27
1893 * ,------------------
1894 * | PACKET
1895 * |------------------
1896 * | * Packet version: 0
1897 * | * Packet flags: 12
1898 * | * Packet seq number: 27
1899 * | | * Packet TLV Block
1900 * | | - TLV
1901 * | | Flags = 0
1902 * | | Type = 1; Value = (warning: parameter is NULL)
1903 * | ,-------------------
1904 * | | MESSAGE
1905 * | |-------------------
1906 * | | * Message type: 1
1907 * | | * Message flags: 0
1908 * | | * Message TLV Block
1909 * | | - TLV
1910 * | | Flags = 0
1911 * | | Type = 1; Value = (warning: parameter is NULL)
1912 * | `-------------------
1913 * |
1914 * | ,-------------------
1915 * | | MESSAGE
1916 * | |-------------------
1917 * | | * Message type: 2
1918 * | | * Message flags: 240
1919 * | | * Originator address: 10.0.0.1
1920 * | | * Hop limit: 255
1921 * | | * Hop count: 1
1922 * | | * Message seq number: 12345
1923 * | | - Address block (2 addresses)
1924 * | | - 10.0.0.2/32
1925 * | | - 10.1.1.2/32
1926 * | | - Flags = 192
1927 * | | - ADDRESS TLV block (0 TLVs)
1928 * | | - Address block (4 addresses)
1929 * | | - 10.0.0.0/32
1930 * | | - 11.0.0.0/32
1931 * | | - 10.0.0.5/16
1932 * | | - 10.0.0.6/24
1933 * | | - Flags = 8
1934 * | | - ADDRESS TLV block (1 TLVs)
1935 * | | - TLV
1936 * | | Flags = 52
1937 * | | Index-start = 1
1938 * | | Index-stop = 3
1939 * | | Type = 1; Value = 01 02 03
1940 * | `-------------------
1941 * |
1942 * `------------------
1943 */
1944 {
1946 packet->SetSequenceNumber(27);
1947
1948 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
1949 tlv1->SetType(1);
1950 packet->TlvPushBack(tlv1);
1951
1953 msg1->SetType(1);
1954
1955 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
1956 msg1tlv1->SetType(1);
1957 msg1->TlvPushBack(msg1tlv1);
1958
1959 packet->MessagePushBack(msg1);
1960
1962 msg2->SetType(2);
1963 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
1964 msg2->SetHopLimit(255);
1965 msg2->SetHopCount(1);
1966 msg2->SetSequenceNumber(12345);
1967
1969 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
1970 msg2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
1971 msg2->AddressBlockPushBack(msg2a1);
1972
1974 msg2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
1975 msg2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
1976 msg2a2->AddressPushBack(Ipv4Address("10.0.0.5"));
1977 msg2a2->AddressPushBack(Ipv4Address("10.0.0.6"));
1978
1979 msg2a2->PrefixPushBack(32);
1980 msg2a2->PrefixPushBack(32);
1981 msg2a2->PrefixPushBack(16);
1982 msg2a2->PrefixPushBack(24);
1983
1985 msg2a2tlv1->SetType(1);
1986 msg2a2tlv1->SetIndexStart(1);
1987 msg2a2tlv1->SetIndexStop(3);
1988
1989 uint8_t value[] = {1, 2, 3};
1990 msg2a2tlv1->SetValue(value, sizeof(value));
1991 msg2a2tlv1->SetMultivalue(true);
1992
1993 msg2a2->TlvPushBack(msg2a2tlv1);
1994
1995 msg2->AddressBlockPushBack(msg2a2);
1996
1997 packet->MessagePushBack(msg2);
1998
1999 uint8_t buffer[] = {
2000 0x0c, 0x00, 0x1b, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00, 0x02, 0x01,
2001 0x00, 0x02, 0xf3, 0x00, 0x3a, 0x0a, /* [16] - 0xf0 */
2002 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02, 0xc0, 0x01, 0x0a, 0x01,
2003 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04, 0x08, 0x0a, 0x00, 0x00, 0x00, 0x0b,
2004 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, 0x06, 0x20, 0x20, 0x10,
2005 0x18, 0x00, 0x08, 0x01, 0x34, 0x01, 0x03, 0x03, 0x01, 0x02, 0x03,
2006 };
2007 AddTestCase(new PbbTestCase("27", packet, buffer, sizeof(buffer)),
2008 TestCase::Duration::QUICK);
2009 }
2010
2011 /* Test 28
2012 * ,------------------
2013 * | PACKET
2014 * |------------------
2015 * | * Packet version: 0
2016 * | * Packet flags: 12
2017 * | * Packet seq number: 28
2018 * | | * Packet TLV Block
2019 * | | - TLV
2020 * | | Flags = 0
2021 * | | Type = 1; Value = (warning: parameter is NULL)
2022 * | ,-------------------
2023 * | | MESSAGE
2024 * | |-------------------
2025 * | | * Message type: 1
2026 * | | * Message flags: 0
2027 * | | * Message TLV Block
2028 * | | - TLV
2029 * | | Flags = 0
2030 * | | Type = 1; Value = (warning: parameter is NULL)
2031 * | `-------------------
2032 * |
2033 * | ,-------------------
2034 * | | MESSAGE
2035 * | |-------------------
2036 * | | * Message type: 2
2037 * | | * Message flags: 240
2038 * | | * Originator address: 10.0.0.1
2039 * | | * Hop limit: 255
2040 * | | * Hop count: 1
2041 * | | * Message seq number: 12345
2042 * | | - Address block (2 addresses)
2043 * | | - 10.0.0.2/32
2044 * | | - 10.1.1.2/32
2045 * | | - Flags = 192
2046 * | | - ADDRESS TLV block (0 TLVs)
2047 * | | - Address block (4 addresses)
2048 * | | - 10.0.0.0/32
2049 * | | - 11.0.0.0/32
2050 * | | - 10.0.0.5/16
2051 * | | - 10.0.0.6/24
2052 * | | - Flags = 8
2053 * | | - ADDRESS TLV block (1 TLVs)
2054 * | | - TLV
2055 * | | Flags = 56
2056 * | | Index-start = 1
2057 * | | Index-stop = 3
2058 * | | Type = 1; Value = 00 01 02 03
2059 * | | 04 05 06 07
2060 * | | 08 09 0a 0b
2061 * | | 0c 0d 0e 0f
2062 * | | 10 11 12 13
2063 * | | 14 15 16 17
2064 * | | 18 19 1a 1b
2065 * | | 1c 1d 1e 1f
2066 * | | 20 21 22 23
2067 * | | 24 25 26 27
2068 * | | 28 29 2a 2b
2069 * | | 2c 2d 2e 2f
2070 * | | 30 31 32 33
2071 * | | 34 35 36 37
2072 * | | 38 39 3a 3b
2073 * | | 3c 3d 3e 3f
2074 * | | 40 41 42 43
2075 * | | 44 45 46 47
2076 * | | 48 49 4a 4b
2077 * | | 4c 4d 4e 4f
2078 * | | 50 51 52 53
2079 * | | 54 55 56 57
2080 * | | 58 59 5a 5b
2081 * | | 5c 5d 5e 5f
2082 * | | 60 61 62 63
2083 * | | 64 65 66 67
2084 * | | 68 69 6a 6b
2085 * | | 6c 6d 6e 6f
2086 * | | 70 71 72 73
2087 * | | 74 75 76 77
2088 * | | 78 79 7a 7b
2089 * | | 7c 7d 7e 7f
2090 * | | 80 81 82 83
2091 * | | 84 85 86 87
2092 * | | 88 89 8a 8b
2093 * | | 8c 8d 8e 8f
2094 * | | 90 91 92 93
2095 * | | 94 95 96 97
2096 * | | 98 99 9a 9b
2097 * | | 9c 9d 9e 9f
2098 * | | a0 a1 a2 a3
2099 * | | a4 a5 a6 a7
2100 * | | a8 a9 aa ab
2101 * | | ac ad ae af
2102 * | | b0 b1 b2 b3
2103 * | | b4 b5 b6 b7
2104 * | | b8 b9 ba bb
2105 * | | bc bd be bf
2106 * | | c0 c1 c2 c3
2107 * | | c4 c5 c6 c7
2108 * | | c8 c9 ca cb
2109 * | | cc cd ce cf
2110 * | | d0 d1 d2 d3
2111 * | | d4 d5 d6 d7
2112 * | | d8 d9 da db
2113 * | | dc dd de df
2114 * | | e0 e1 e2 e3
2115 * | | e4 e5 e6 e7
2116 * | | e8 e9 ea eb
2117 * | | ec ed ee ef
2118 * | | f0 f1 f2 f3
2119 * | | f4 f5 f6 f7
2120 * | | f8 f9 fa fb
2121 * | | fc fd fe 00
2122 * | | 01 02 03 04
2123 * | | 05 06 07 08
2124 * | | 09 0a 0b 0c
2125 * | | 0d 0e 0f 10
2126 * | | 11 12 13 14
2127 * | | 15 16 17 18
2128 * | | 19 1a 1b 1c
2129 * | | 1d 1e 1f 20
2130 * | | 21 22 23 24
2131 * | | 25 26 27 28
2132 * | | 29 2a 2b 2c
2133 * | |
2134 * | `-------------------
2135 * |
2136 * `------------------
2137 */
2138 {
2140 packet->SetSequenceNumber(28);
2141
2142 Ptr<PbbTlv> tlv1 = Create<PbbTlv>();
2143 tlv1->SetType(1);
2144 packet->TlvPushBack(tlv1);
2145
2147 msg1->SetType(1);
2148
2149 Ptr<PbbTlv> msg1tlv1 = Create<PbbTlv>();
2150 msg1tlv1->SetType(1);
2151 msg1->TlvPushBack(msg1tlv1);
2152
2153 packet->MessagePushBack(msg1);
2154
2156 msg2->SetType(2);
2157 msg2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
2158 msg2->SetHopLimit(255);
2159 msg2->SetHopCount(1);
2160 msg2->SetSequenceNumber(12345);
2161
2163 msg2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
2164 msg2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
2165 msg2->AddressBlockPushBack(msg2a1);
2166
2168 msg2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
2169 msg2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
2170 msg2a2->AddressPushBack(Ipv4Address("10.0.0.5"));
2171 msg2a2->AddressPushBack(Ipv4Address("10.0.0.6"));
2172
2173 msg2a2->PrefixPushBack(32);
2174 msg2a2->PrefixPushBack(32);
2175 msg2a2->PrefixPushBack(16);
2176 msg2a2->PrefixPushBack(24);
2177
2179 msg2a2tlv1->SetType(1);
2180 msg2a2tlv1->SetIndexStart(1);
2181 msg2a2tlv1->SetIndexStop(3);
2182
2183 uint8_t value[] = {
2184 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
2185 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
2186 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
2187 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2188 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
2189 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
2190 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61,
2191 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
2192 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d,
2193 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b,
2194 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
2195 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
2196 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5,
2197 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3,
2198 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1,
2199 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
2200 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
2201 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,
2202 0xfc, 0xfd, 0xfe, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
2203 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
2204 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
2205 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,
2206 };
2207 msg2a2tlv1->SetValue(value, sizeof(value));
2208
2209 msg2a2->TlvPushBack(msg2a2tlv1);
2210
2211 msg2->AddressBlockPushBack(msg2a2);
2212
2213 packet->MessagePushBack(msg2);
2214
2215 uint8_t buffer[] = {
2216 0x0c, 0x00, 0x1c, 0x00, 0x02, 0x01, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00, 0x02, 0x01,
2217 0x00, 0x02, 0xf3, 0x01, 0x64, 0x0a, /* [16] - 0xf0 */
2218 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00, 0x00, 0x02, 0xc0, 0x01, 0x0a, 0x01,
2219 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04, 0x08, 0x0a, 0x00, 0x00, 0x00, 0x0b,
2220 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, 0x06, 0x20, 0x20, 0x10,
2221 0x18, 0x01, 0x32, 0x01, 0x38, 0x01, 0x03, 0x01, 0x2c, 0x00, 0x01, 0x02, 0x03, 0x04,
2222 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
2223 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
2224 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e,
2225 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c,
2226 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a,
2227 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
2228 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
2229 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74,
2230 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82,
2231 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90,
2232 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
2233 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac,
2234 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba,
2235 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8,
2236 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
2237 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4,
2238 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2,
2239 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x00, 0x01,
2240 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2241 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
2242 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
2243 0x2c,
2244 };
2245 AddTestCase(new PbbTestCase("28", packet, buffer, sizeof(buffer)),
2246 TestCase::Duration::QUICK);
2247 }
2248
2249 /* Test 29
2250 * ,------------------
2251 * | PACKET
2252 * |------------------
2253 * | * Packet version: 0
2254 * | * Packet flags: 0
2255 * | ,-------------------
2256 * | | MESSAGE
2257 * | |-------------------
2258 * | | * Message type: 1
2259 * | | * Message flags: 1
2260 * | `-------------------
2261 * |
2262 * `------------------
2263 */
2264 {
2266
2268 m1->SetType(1);
2269
2270 packet->MessagePushBack(m1);
2271
2272 uint8_t buffer[] = {
2273 0x00,
2274 0x01,
2275 0x0f,
2276 0x00,
2277 0x06,
2278 0x00,
2279 0x00,
2280 };
2281 AddTestCase(new PbbTestCase("29", packet, buffer, sizeof(buffer)),
2282 TestCase::Duration::QUICK);
2283 }
2284
2285 /* Test 30
2286 * ,------------------
2287 * | PACKET
2288 * |------------------
2289 * | * Packet version: 0
2290 * | * Packet flags: 0
2291 * | ,-------------------
2292 * | | MESSAGE
2293 * | |-------------------
2294 * | | * Message type: 1
2295 * | | * Message flags: 129
2296 * | | * Originator address: abcd::1
2297 * | `-------------------
2298 * |
2299 * `------------------
2300 */
2301 {
2303
2305 m1->SetType(1);
2306 m1->SetOriginatorAddress(Ipv6Address("abcd::1"));
2307
2308 packet->MessagePushBack(m1);
2309
2310 uint8_t buffer[] = {
2311 0x00, 0x01, 0x8f, 0x00, 0x16, 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00,
2312 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
2313 };
2314 AddTestCase(new PbbTestCase("30", packet, buffer, sizeof(buffer)),
2315 TestCase::Duration::QUICK);
2316 }
2317
2318 /* Test 31
2319 * ,------------------
2320 * | PACKET
2321 * |------------------
2322 * | * Packet version: 0
2323 * | * Packet flags: 0
2324 * | ,-------------------
2325 * | | MESSAGE
2326 * | |-------------------
2327 * | | * Message type: 1
2328 * | | * Message flags: 129
2329 * | | * Originator address: abcd::1
2330 * | | - Address block (1 addresses)
2331 * | | - 10::1/128
2332 * | | - Flags = 0
2333 * | | - ADDRESS TLV block (0 TLVs)
2334 * | `-------------------
2335 * |
2336 * `------------------
2337 */
2338 {
2340
2342 m1->SetType(1);
2343 m1->SetOriginatorAddress(Ipv6Address("abcd::1"));
2344
2346 m1a1->AddressPushBack(Ipv6Address("10::1"));
2347 m1->AddressBlockPushBack(m1a1);
2348
2349 packet->MessagePushBack(m1);
2350
2351 uint8_t buffer[] = {
2352 0x00, 0x01, 0x8f, 0x00, 0x2a, 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00,
2353 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
2354 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2355 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
2356 };
2357 AddTestCase(new PbbTestCase("31", packet, buffer, sizeof(buffer)),
2358 TestCase::Duration::QUICK);
2359 }
2360
2361 /* Test 32
2362 * ,------------------
2363 * | PACKET
2364 * |------------------
2365 * | * Packet version: 0
2366 * | * Packet flags: 0
2367 * | ,-------------------
2368 * | | MESSAGE
2369 * | |-------------------
2370 * | | * Message type: 1
2371 * | | * Message flags: 129
2372 * | | * Originator address: abcd::1
2373 * | | - Address block (2 addresses)
2374 * | | - 10::1/128
2375 * | | - 10::2/128
2376 * | | - Flags = 128
2377 * | | - ADDRESS TLV block (0 TLVs)
2378 * | `-------------------
2379 * |
2380 * `------------------
2381 */
2382 {
2384
2386 m1->SetType(1);
2387 m1->SetOriginatorAddress(Ipv6Address("abcd::1"));
2388
2390 m1a1->AddressPushBack(Ipv6Address("10::1"));
2391 m1a1->AddressPushBack(Ipv6Address("10::2"));
2392 m1->AddressBlockPushBack(m1a1);
2393
2394 packet->MessagePushBack(m1);
2395
2396 uint8_t buffer[] = {
2397 0x00, 0x01, 0x8f, 0x00, 0x2c, 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00,
2398 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02,
2399 0x80, 0x0f, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2400 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00,
2401 };
2402 AddTestCase(new PbbTestCase("32", packet, buffer, sizeof(buffer)),
2403 TestCase::Duration::QUICK);
2404 }
2405
2406 /* Test 33
2407 * ,------------------
2408 * | PACKET
2409 * |------------------
2410 * | * Packet version: 0
2411 * | * Packet flags: 0
2412 * | ,-------------------
2413 * | | MESSAGE
2414 * | |-------------------
2415 * | | * Message type: 1
2416 * | | * Message flags: 129
2417 * | | * Originator address: abcd::1
2418 * | | - Address block (2 addresses)
2419 * | | - 10::2/128
2420 * | | - 10::11:2/128
2421 * | | - Flags = 192
2422 * | | - ADDRESS TLV block (0 TLVs)
2423 * | `-------------------
2424 * |
2425 * `------------------
2426 */
2427 {
2429
2431 m1->SetType(1);
2432 m1->SetOriginatorAddress(Ipv6Address("abcd::1"));
2433
2435 m1a1->AddressPushBack(Ipv6Address("10::2"));
2436 m1a1->AddressPushBack(Ipv6Address("10::11:2"));
2437 m1->AddressBlockPushBack(m1a1);
2438
2439 packet->MessagePushBack(m1);
2440
2441 uint8_t buffer[] = {
2442 0x00, 0x01, 0x8f, 0x00, 0x2d, 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00,
2443 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02,
2444 0xc0, 0x0d, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2445 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x11, 0x00, 0x00,
2446 };
2447 AddTestCase(new PbbTestCase("33", packet, buffer, sizeof(buffer)),
2448 TestCase::Duration::QUICK);
2449 }
2450
2451 /* Test 34
2452 * ,------------------
2453 * | PACKET
2454 * |------------------
2455 * | * Packet version: 0
2456 * | * Packet flags: 0
2457 * | ,-------------------
2458 * | | MESSAGE
2459 * | |-------------------
2460 * | | * Message type: 1
2461 * | | * Message flags: 129
2462 * | | * Originator address: abcd::1
2463 * | | - Address block (2 addresses)
2464 * | | - 10::2/128
2465 * | | - 10::11:2/128
2466 * | | - Flags = 192
2467 * | | - ADDRESS TLV block (0 TLVs)
2468 * | | - Address block (2 addresses)
2469 * | | - 10::/128
2470 * | | - 11::/128
2471 * | | - Flags = 160
2472 * | | - ADDRESS TLV block (0 TLVs)
2473 * | `-------------------
2474 * |
2475 * `------------------
2476 */
2477 {
2479
2481 m1->SetType(1);
2482 m1->SetOriginatorAddress(Ipv6Address("abcd::1"));
2483
2485 m1a1->AddressPushBack(Ipv6Address("10::2"));
2486 m1a1->AddressPushBack(Ipv6Address("10::11:2"));
2487 m1->AddressBlockPushBack(m1a1);
2488
2490 m1a2->AddressPushBack(Ipv6Address("10::"));
2491 m1a2->AddressPushBack(Ipv6Address("11::"));
2492 m1->AddressBlockPushBack(m1a2);
2493
2494 packet->MessagePushBack(m1);
2495
2496 uint8_t buffer[] = {
2497 0x00, 0x01, 0x8f, 0x00, 0x36, 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2498 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xc0, 0x0d, 0x00, 0x10,
2499 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02,
2500 0x00, 0x11, 0x00, 0x00, 0x02, 0xa0, 0x01, 0x00, 0x0e, 0x10, 0x11, 0x00, 0x00,
2501 };
2502 AddTestCase(new PbbTestCase("34", packet, buffer, sizeof(buffer)),
2503 TestCase::Duration::QUICK);
2504 }
2505
2506 /* Test 35
2507 * ,------------------
2508 * | PACKET
2509 * |------------------
2510 * | * Packet version: 0
2511 * | * Packet flags: 0
2512 * | ,-------------------
2513 * | | MESSAGE
2514 * | |-------------------
2515 * | | * Message type: 1
2516 * | | * Message flags: 129
2517 * | | * Originator address: abcd::1
2518 * | | - Address block (2 addresses)
2519 * | | - 10::2/128
2520 * | | - 10::11:2/128
2521 * | | - Flags = 192
2522 * | | - ADDRESS TLV block (0 TLVs)
2523 * | | - Address block (4 addresses)
2524 * | | - 10::/128
2525 * | | - 11::/128
2526 * | | - 10::5/64
2527 * | | - 10::6/48
2528 * | | - Flags = 136
2529 * | | - ADDRESS TLV block (0 TLVs)
2530 * | `-------------------
2531 * |
2532 * `------------------
2533 */
2534 {
2536
2538 m1->SetType(1);
2539 m1->SetOriginatorAddress(Ipv6Address("abcd::1"));
2540
2542 m1a1->AddressPushBack(Ipv6Address("10::2"));
2543 m1a1->AddressPushBack(Ipv6Address("10::11:2"));
2544 m1->AddressBlockPushBack(m1a1);
2545
2547 m1a2->AddressPushBack(Ipv6Address("10::"));
2548 m1a2->AddressPushBack(Ipv6Address("11::"));
2549 m1a2->AddressPushBack(Ipv6Address("10::5"));
2550 m1a2->AddressPushBack(Ipv6Address("10::6"));
2551 m1a2->PrefixPushBack(128);
2552 m1a2->PrefixPushBack(128);
2553 m1a2->PrefixPushBack(64);
2554 m1a2->PrefixPushBack(48);
2555 m1->AddressBlockPushBack(m1a2);
2556
2557 packet->MessagePushBack(m1);
2558
2559 uint8_t buffer[] = {
2560 0x00, 0x01, 0x8f, 0x00, 0x73, 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2561 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xc0, 0x0d,
2562 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2563 0x02, 0x00, 0x02, 0x00, 0x11, 0x00, 0x00, 0x04, 0x88, 0x01, 0x00, 0x10, 0x00,
2564 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2565 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2566 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2567 0x00, 0x00, 0x00, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2568 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x40, 0x30, 0x00, 0x00,
2569 };
2570 AddTestCase(new PbbTestCase("35", packet, buffer, sizeof(buffer)),
2571 TestCase::Duration::QUICK);
2572 }
2573
2574 /* Test 36
2575 * ,------------------
2576 * | PACKET
2577 * |------------------
2578 * | * Packet version: 0
2579 * | * Packet flags: 12
2580 * | * Packet seq number: 29
2581 * | | * Packet TLV Block
2582 * | | - TLV
2583 * | | Flags = 0
2584 * | | Type = 1; Value = (warning: parameter is NULL)
2585 * | ,-------------------
2586 * | | MESSAGE
2587 * | |-------------------
2588 * | | * Message type: 1
2589 * | | * Message flags: 0
2590 * | | * Message TLV Block
2591 * | | - TLV
2592 * | | Flags = 0
2593 * | | Type = 1; Value = (warning: parameter is NULL)
2594 * | `-------------------
2595 * |
2596 * | ,-------------------
2597 * | | MESSAGE
2598 * | |-------------------
2599 * | | * Message type: 2
2600 * | | * Message flags: 240
2601 * | | * Originator address: 10.0.0.1
2602 * | | * Hop limit: 255
2603 * | | * Hop count: 1
2604 * | | * Message seq number: 12345
2605 * | | - Address block (2 addresses)
2606 * | | - 10.0.0.2/32
2607 * | | - 10.1.1.2/32
2608 * | | - Flags = 192
2609 * | | - ADDRESS TLV block (0 TLVs)
2610 * | | - Address block (4 addresses)
2611 * | | - 10.0.0.0/32
2612 * | | - 11.0.0.0/32
2613 * | | - 10.0.0.5/16
2614 * | | - 10.0.0.6/24
2615 * | | - Flags = 8
2616 * | | - ADDRESS TLV block (1 TLVs)
2617 * | | - TLV
2618 * | | Flags = 56
2619 * | | Index-start = 1
2620 * | | Index-stop = 3
2621 * | | Type = 1; Value = 00 01 02 03
2622 * | | 04 05 06 07
2623 * | | 08 09 0a 0b
2624 * | | 0c 0d 0e 0f
2625 * | | 10 11 12 13
2626 * | | 14 15 16 17
2627 * | | 18 19 1a 1b
2628 * | | 1c 1d 1e 1f
2629 * | | 20 21 22 23
2630 * | | 24 25 26 27
2631 * | | 28 29 2a 2b
2632 * | | 2c 2d 2e 2f
2633 * | | 30 31 32 33
2634 * | | 34 35 36 37
2635 * | | 38 39 3a 3b
2636 * | | 3c 3d 3e 3f
2637 * | | 40 41 42 43
2638 * | | 44 45 46 47
2639 * | | 48 49 4a 4b
2640 * | | 4c 4d 4e 4f
2641 * | | 50 51 52 53
2642 * | | 54 55 56 57
2643 * | | 58 59 5a 5b
2644 * | | 5c 5d 5e 5f
2645 * | | 60 61 62 63
2646 * | | 64 65 66 67
2647 * | | 68 69 6a 6b
2648 * | | 6c 6d 6e 6f
2649 * | | 70 71 72 73
2650 * | | 74 75 76 77
2651 * | | 78 79 7a 7b
2652 * | | 7c 7d 7e 7f
2653 * | | 80 81 82 83
2654 * | | 84 85 86 87
2655 * | | 88 89 8a 8b
2656 * | | 8c 8d 8e 8f
2657 * | | 90 91 92 93
2658 * | | 94 95 96 97
2659 * | | 98 99 9a 9b
2660 * | | 9c 9d 9e 9f
2661 * | | a0 a1 a2 a3
2662 * | | a4 a5 a6 a7
2663 * | | a8 a9 aa ab
2664 * | | ac ad ae af
2665 * | | b0 b1 b2 b3
2666 * | | b4 b5 b6 b7
2667 * | | b8 b9 ba bb
2668 * | | bc bd be bf
2669 * | | c0 c1 c2 c3
2670 * | | c4 c5 c6 c7
2671 * | | c8 c9 ca cb
2672 * | | cc cd ce cf
2673 * | | d0 d1 d2 d3
2674 * | | d4 d5 d6 d7
2675 * | | d8 d9 da db
2676 * | | dc dd de df
2677 * | | e0 e1 e2 e3
2678 * | | e4 e5 e6 e7
2679 * | | e8 e9 ea eb
2680 * | | ec ed ee ef
2681 * | | f0 f1 f2 f3
2682 * | | f4 f5 f6 f7
2683 * | | f8 f9 fa fb
2684 * | | fc fd fe 00
2685 * | | 01 02 03 04
2686 * | | 05 06 07 08
2687 * | | 09 0a 0b 0c
2688 * | | 0d 0e 0f 10
2689 * | | 11 12 13 14
2690 * | | 15 16 17 18
2691 * | | 19 1a 1b 1c
2692 * | | 1d 1e 1f 20
2693 * | | 21 22 23 24
2694 * | | 25 26 27 28
2695 * | | 29 2a 2b 2c
2696 * | |
2697 * | `-------------------
2698 * |
2699 * | ,-------------------
2700 * | | MESSAGE
2701 * | |-------------------
2702 * | | * Message type: 1
2703 * | | * Message flags: 129
2704 * | | * Originator address: abcd::1
2705 * | | - Address block (2 addresses)
2706 * | | - 10::2/128
2707 * | | - 10::11:2/128
2708 * | | - Flags = 192
2709 * | | - ADDRESS TLV block (0 TLVs)
2710 * | | - Address block (4 addresses)
2711 * | | - 10::/128
2712 * | | - 11::/128
2713 * | | - 10::5/64
2714 * | | - 10::6/48
2715 * | | - Flags = 136
2716 * | | - ADDRESS TLV block (0 TLVs)
2717 * | `-------------------
2718 * |
2719 * `------------------
2720 */
2721 {
2723 packet->SetSequenceNumber(29);
2724
2725 Ptr<PbbTlv> ptlv1 = Create<PbbTlv>();
2726 ptlv1->SetType(1);
2727 packet->TlvPushBack(ptlv1);
2728
2730 m1->SetType(1);
2731
2732 Ptr<PbbTlv> m1tlv1 = Create<PbbTlv>();
2733 m1tlv1->SetType(1);
2734 m1->TlvPushBack(m1tlv1);
2735 packet->MessagePushBack(m1);
2736
2738 m2->SetType(2);
2739 m2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
2740 m2->SetHopLimit(255);
2741 m2->SetHopCount(1);
2742 m2->SetSequenceNumber(12345);
2743
2745 m2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
2746 m2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
2747 m2->AddressBlockPushBack(m2a1);
2748
2750 m2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
2751 m2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
2752 m2a2->AddressPushBack(Ipv4Address("10.0.0.5"));
2753 m2a2->AddressPushBack(Ipv4Address("10.0.0.6"));
2754 m2a2->PrefixPushBack(32);
2755 m2a2->PrefixPushBack(32);
2756 m2a2->PrefixPushBack(16);
2757 m2a2->PrefixPushBack(24);
2758
2760 m2a2tlv1->SetType(1);
2761 m2a2tlv1->SetIndexStart(1);
2762 m2a2tlv1->SetIndexStop(3);
2763
2764 uint8_t value[] = {
2765 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
2766 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
2767 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
2768 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2769 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
2770 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
2771 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61,
2772 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
2773 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d,
2774 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b,
2775 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
2776 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
2777 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5,
2778 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3,
2779 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1,
2780 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
2781 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
2782 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,
2783 0xfc, 0xfd, 0xfe, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
2784 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
2785 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
2786 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,
2787 };
2788 m2a2tlv1->SetValue(value, sizeof(value));
2789 m2a2->TlvPushBack(m2a2tlv1);
2790
2791 m2->AddressBlockPushBack(m2a2);
2792 packet->MessagePushBack(m2);
2793
2795 m3->SetType(1);
2796 m3->SetOriginatorAddress(Ipv6Address("abcd::1"));
2797
2799 m3a1->AddressPushBack(Ipv6Address("10::2"));
2800 m3a1->AddressPushBack(Ipv6Address("10::11:2"));
2801 m3->AddressBlockPushBack(m3a1);
2802
2804 m3a2->AddressPushBack(Ipv6Address("10::"));
2805 m3a2->AddressPushBack(Ipv6Address("11::"));
2806 m3a2->AddressPushBack(Ipv6Address("10::5"));
2807 m3a2->AddressPushBack(Ipv6Address("10::6"));
2808 m3a2->PrefixPushBack(128);
2809 m3a2->PrefixPushBack(128);
2810 m3a2->PrefixPushBack(64);
2811 m3a2->PrefixPushBack(48);
2812
2813 m3->AddressBlockPushBack(m3a2);
2814 packet->MessagePushBack(m3);
2815
2816 uint8_t buffer[] = {
2817 0x0c, 0x00, 0x1d, 0x00, 0x02, 0x01, 0x00, 0x01, 0x0f, 0x00, 0x08, 0x00, 0x02, 0x01,
2818 0x00, 0x02, 0xf3, 0x01, 0x64, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00,
2819 0x00, 0x02, 0xc0, 0x01, 0x0a, 0x01, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04,
2820 0x08, 0x0a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x05, 0x0a,
2821 0x00, 0x00, 0x06, 0x20, 0x20, 0x10, 0x18, 0x01, 0x32, 0x01, 0x38, 0x01, 0x03, 0x01,
2822 0x2c, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
2823 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a,
2824 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
2825 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
2826 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44,
2827 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52,
2828 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
2829 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e,
2830 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c,
2831 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,
2832 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
2833 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
2834 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
2835 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2,
2836 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
2837 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde,
2838 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec,
2839 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa,
2840 0xfb, 0xfc, 0xfd, 0xfe, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
2841 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2842 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
2843 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x01, 0x8f, 0x00, 0x73, 0xab, 0xcd, 0x00,
2844 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
2845 0x00, 0x02, 0xc0, 0x0d, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2846 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x11, 0x00, 0x00, 0x04, 0x88, 0x01, 0x00,
2847 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2848 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2849 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2850 0x00, 0x00, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2851 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x40, 0x30, 0x00, 0x00,
2852 };
2853 AddTestCase(new PbbTestCase("36", packet, buffer, sizeof(buffer)),
2854 TestCase::Duration::QUICK);
2855 }
2856
2857 /* Test 37
2858 * ,------------------
2859 * | PACKET
2860 * |------------------
2861 * | * Packet version: 0
2862 * | * Packet flags: 12
2863 * | * Packet seq number: 30
2864 * | | * Packet TLV Block
2865 * | | - TLV
2866 * | | Flags = 0
2867 * | | Type = 1; Value = (warning: parameter is NULL)
2868 * | ,-------------------
2869 * | | MESSAGE
2870 * | |-------------------
2871 * | | * Message type: 1
2872 * | | * Message flags: 0
2873 * | | * Message TLV Block
2874 * | | - TLV
2875 * | | Flags = 0
2876 * | | Type = 1; Value = (warning: parameter is NULL)
2877 * | `-------------------
2878 * |
2879 * | ,-------------------
2880 * | | MESSAGE
2881 * | |-------------------
2882 * | | * Message type: 2
2883 * | | * Message flags: 240
2884 * | | * Originator address: 10.0.0.1
2885 * | | * Hop limit: 255
2886 * | | * Hop count: 1
2887 * | | * Message seq number: 12345
2888 * | | - Address block (2 addresses)
2889 * | | - 10.0.0.2/32
2890 * | | - 10.1.1.2/32
2891 * | | - Flags = 192
2892 * | | - ADDRESS TLV block (0 TLVs)
2893 * | | - Address block (4 addresses)
2894 * | | - 10.0.0.0/32
2895 * | | - 11.0.0.0/32
2896 * | | - 10.0.0.5/16
2897 * | | - 10.0.0.6/24
2898 * | | - Flags = 8
2899 * | | - ADDRESS TLV block (1 TLVs)
2900 * | | - TLV
2901 * | | Flags = 56
2902 * | | Index-start = 1
2903 * | | Index-stop = 3
2904 * | | Type = 1; Value = 00 01 02 03
2905 * | | 04 05 06 07
2906 * | | 08 09 0a 0b
2907 * | | 0c 0d 0e 0f
2908 * | | 10 11 12 13
2909 * | | 14 15 16 17
2910 * | | 18 19 1a 1b
2911 * | | 1c 1d 1e 1f
2912 * | | 20 21 22 23
2913 * | | 24 25 26 27
2914 * | | 28 29 2a 2b
2915 * | | 2c 2d 2e 2f
2916 * | | 30 31 32 33
2917 * | | 34 35 36 37
2918 * | | 38 39 3a 3b
2919 * | | 3c 3d 3e 3f
2920 * | | 40 41 42 43
2921 * | | 44 45 46 47
2922 * | | 48 49 4a 4b
2923 * | | 4c 4d 4e 4f
2924 * | | 50 51 52 53
2925 * | | 54 55 56 57
2926 * | | 58 59 5a 5b
2927 * | | 5c 5d 5e 5f
2928 * | | 60 61 62 63
2929 * | | 64 65 66 67
2930 * | | 68 69 6a 6b
2931 * | | 6c 6d 6e 6f
2932 * | | 70 71 72 73
2933 * | | 74 75 76 77
2934 * | | 78 79 7a 7b
2935 * | | 7c 7d 7e 7f
2936 * | | 80 81 82 83
2937 * | | 84 85 86 87
2938 * | | 88 89 8a 8b
2939 * | | 8c 8d 8e 8f
2940 * | | 90 91 92 93
2941 * | | 94 95 96 97
2942 * | | 98 99 9a 9b
2943 * | | 9c 9d 9e 9f
2944 * | | a0 a1 a2 a3
2945 * | | a4 a5 a6 a7
2946 * | | a8 a9 aa ab
2947 * | | ac ad ae af
2948 * | | b0 b1 b2 b3
2949 * | | b4 b5 b6 b7
2950 * | | b8 b9 ba bb
2951 * | | bc bd be bf
2952 * | | c0 c1 c2 c3
2953 * | | c4 c5 c6 c7
2954 * | | c8 c9 ca cb
2955 * | | cc cd ce cf
2956 * | | d0 d1 d2 d3
2957 * | | d4 d5 d6 d7
2958 * | | d8 d9 da db
2959 * | | dc dd de df
2960 * | | e0 e1 e2 e3
2961 * | | e4 e5 e6 e7
2962 * | | e8 e9 ea eb
2963 * | | ec ed ee ef
2964 * | | f0 f1 f2 f3
2965 * | | f4 f5 f6 f7
2966 * | | f8 f9 fa fb
2967 * | | fc fd fe 00
2968 * | | 01 02 03 04
2969 * | | 05 06 07 08
2970 * | | 09 0a 0b 0c
2971 * | | 0d 0e 0f 10
2972 * | | 11 12 13 14
2973 * | | 15 16 17 18
2974 * | | 19 1a 1b 1c
2975 * | | 1d 1e 1f 20
2976 * | | 21 22 23 24
2977 * | | 25 26 27 28
2978 * | | 29 2a 2b 2c
2979 * | |
2980 * | `-------------------
2981 * |
2982 * | ,-------------------
2983 * | | MESSAGE
2984 * | |-------------------
2985 * | | * Message type: 1
2986 * | | * Message flags: 129
2987 * | | * Originator address: abcd::1
2988 * | | - Address block (2 addresses)
2989 * | | - 10::2/128
2990 * | | - 10::11:2/128
2991 * | | - Flags = 192
2992 * | | - ADDRESS TLV block (0 TLVs)
2993 * | | - Address block (4 addresses)
2994 * | | - 10::/128
2995 * | | - 11::/128
2996 * | | - 10::5/64
2997 * | | - 10::6/48
2998 * | | - Flags = 136
2999 * | | - ADDRESS TLV block (0 TLVs)
3000 * | `-------------------
3001 * |
3002 * `------------------
3003 */
3004 {
3006 packet->SetSequenceNumber(30);
3007
3008 Ptr<PbbTlv> ptlv1 = Create<PbbTlv>();
3009 ptlv1->SetType(1);
3010 packet->TlvPushBack(ptlv1);
3011
3013 m1->SetType(1);
3014
3015 Ptr<PbbTlv> m1tlv1 = Create<PbbTlv>();
3016 m1tlv1->SetType(1);
3017 m1->TlvPushBack(m1tlv1);
3018 packet->MessagePushBack(m1);
3019
3021 m2->SetType(2);
3022 m2->SetOriginatorAddress(Ipv4Address("10.0.0.1"));
3023 m2->SetHopLimit(255);
3024 m2->SetHopCount(1);
3025 m2->SetSequenceNumber(12345);
3026
3028 m2a1->AddressPushBack(Ipv4Address("10.0.0.2"));
3029 m2a1->AddressPushBack(Ipv4Address("10.1.1.2"));
3030 m2->AddressBlockPushBack(m2a1);
3031
3033 m2a2->AddressPushBack(Ipv4Address("10.0.0.0"));
3034 m2a2->AddressPushBack(Ipv4Address("11.0.0.0"));
3035 m2a2->AddressPushBack(Ipv4Address("10.0.0.5"));
3036 m2a2->AddressPushBack(Ipv4Address("10.0.0.6"));
3037 m2a2->PrefixPushBack(32);
3038 m2a2->PrefixPushBack(32);
3039 m2a2->PrefixPushBack(16);
3040 m2a2->PrefixPushBack(24);
3041
3043 m2a2tlv1->SetType(1);
3044 m2a2tlv1->SetIndexStart(1);
3045 m2a2tlv1->SetIndexStop(3);
3046
3047 uint8_t value[] = {
3048 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
3049 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
3050 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
3051 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
3052 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
3053 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
3054 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61,
3055 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
3056 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d,
3057 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b,
3058 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
3059 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
3060 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5,
3061 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3,
3062 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1,
3063 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
3064 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
3065 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,
3066 0xfc, 0xfd, 0xfe, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
3067 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
3068 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
3069 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,
3070 };
3071 m2a2tlv1->SetValue(value, sizeof(value));
3072 m2a2->TlvPushBack(m2a2tlv1);
3073
3074 m2->AddressBlockPushBack(m2a2);
3075 packet->MessagePushBack(m2);
3076
3078 m3->SetType(1);
3079 m3->SetOriginatorAddress(Ipv6Address("abcd::1"));
3080
3082 m3a1->AddressPushBack(Ipv6Address("10::2"));
3083 m3a1->AddressPushBack(Ipv6Address("10::11:2"));
3084 m3->AddressBlockPushBack(m3a1);
3085
3087 m3a2->AddressPushBack(Ipv6Address("10::"));
3088 m3a2->AddressPushBack(Ipv6Address("11::"));
3089 m3a2->AddressPushBack(Ipv6Address("10::5"));
3090 m3a2->AddressPushBack(Ipv6Address("10::6"));
3091 m3a2->PrefixPushBack(128);
3092 m3a2->PrefixPushBack(128);
3093 m3a2->PrefixPushBack(64);
3094 m3a2->PrefixPushBack(48);
3095
3096 m3->AddressBlockPushBack(m3a2);
3097 packet->MessagePushBack(m3);
3098
3099 uint8_t buffer[] = {
3100 0x0c, 0x00, 0x1e, 0x00, 0x02, 0x01, 0x00, 0x01, 0x0f, 0x00, 0x08, 0x00, 0x02, 0x01,
3101 0x00, 0x02, 0xf3, 0x01, 0x64, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x01, 0x30, 0x39, 0x00,
3102 0x00, 0x02, 0xc0, 0x01, 0x0a, 0x01, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x04,
3103 0x08, 0x0a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x05, 0x0a,
3104 0x00, 0x00, 0x06, 0x20, 0x20, 0x10, 0x18, 0x01, 0x32, 0x01, 0x38, 0x01, 0x03, 0x01,
3105 0x2c, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
3106 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a,
3107 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
3108 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
3109 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44,
3110 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52,
3111 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
3112 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e,
3113 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c,
3114 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,
3115 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
3116 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
3117 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
3118 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2,
3119 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
3120 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde,
3121 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec,
3122 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa,
3123 0xfb, 0xfc, 0xfd, 0xfe, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
3124 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
3125 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
3126 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x01, 0x8f, 0x00, 0x73, 0xab, 0xcd, 0x00,
3127 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
3128 0x00, 0x02, 0xc0, 0x0d, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3129 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x11, 0x00, 0x00, 0x04, 0x88, 0x01, 0x00,
3130 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3131 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3132 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3133 0x00, 0x00, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3134 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x40, 0x30, 0x00, 0x00,
3135 };
3136 AddTestCase(new PbbTestCase("37", packet, buffer, sizeof(buffer)),
3137 TestCase::Duration::QUICK);
3138 }
3139}
3140
3141static PbbTestSuite pbbTestSuite; //!< Static variable for test initialization
PacketBb TestCase.
void DoRun() override
Implementation to actually run this TestCase.
void TestDeserialize()
Deserialization.
Ptr< PbbPacket > m_refPacket
Reference packet.
void TestSerialize()
Serialization.
Buffer m_refBuffer
Reference buffer.
PbbTestCase(std::string name, Ptr< PbbPacket > packet, uint8_t *buffer, uint32_t size)
Constructor.
~PbbTestCase() override
PacketBb TestSuite.
void Write(const uint8_t *buffer, uint32_t size)
Definition buffer.cc:937
automatically resized byte buffer
Definition buffer.h:83
uint32_t GetSize() const
Definition buffer.h:1057
void AddAtStart(uint32_t start)
Definition buffer.cc:303
Buffer::Iterator Begin() const
Definition buffer.h:1063
const uint8_t * PeekData() const
Definition buffer.cc:692
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
Smart pointer class similar to boost::intrusive_ptr.
encapsulates test code
Definition test.h:1050
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:292
A suite of tests to run.
Definition test.h:1267
Type
Type of test.
Definition test.h:1274
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition test.h:134
const double m1
First component modulus, 232 - 209.
Definition rng-stream.cc:49
const double m2
Second component modulus, 232 - 22853.
Definition rng-stream.cc:52
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static PbbTestSuite pbbTestSuite
Static variable for test initialization.