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