LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2007 INESC Porto | 3 * Copyright (c) 2007 INESC Porto |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 addresses.push_back (Ipv4Address ("2.2.3.5")); | 105 addresses.push_back (Ipv4Address ("2.2.3.5")); |
106 } | 106 } |
107 | 107 |
108 msg2.SetTimeToLive (254); | 108 msg2.SetTimeToLive (254); |
109 msg2.SetOriginatorAddress (Ipv4Address ("12.22.33.44")); | 109 msg2.SetOriginatorAddress (Ipv4Address ("12.22.33.44")); |
110 msg2.SetVTime (Seconds (10)); | 110 msg2.SetVTime (Seconds (10)); |
111 msg2.SetMessageType (olsr::MessageHeader::MID_MESSAGE); | 111 msg2.SetMessageType (olsr::MessageHeader::MID_MESSAGE); |
112 msg2.SetMessageSequenceNumber (7); | 112 msg2.SetMessageSequenceNumber (7); |
113 | 113 |
114 // Build an OLSR packet header | 114 // Build an OLSR packet header |
115 hdr.SetPacketLength ((uint16_t)(hdr.GetSerializedSize () + msg1.GetSerialize
dSize () + msg2.GetSerializedSize ())); | 115 hdr.SetPacketLength (static_cast<uint16_t> (hdr.GetSerializedSize () + msg1.
GetSerializedSize () + msg2.GetSerializedSize ())); |
116 hdr.SetPacketSequenceNumber (123); | 116 hdr.SetPacketSequenceNumber (123); |
117 | 117 |
118 | 118 |
119 // Now add all the headers in the correct order | 119 // Now add all the headers in the correct order |
120 packet.AddHeader (msg2); | 120 packet.AddHeader (msg2); |
121 packet.AddHeader (msg1); | 121 packet.AddHeader (msg1); |
122 packet.AddHeader (hdr); | 122 packet.AddHeader (hdr); |
123 } | 123 } |
124 | 124 |
125 { | 125 { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 AddTestCase (new OlsrHnaTestCase (), TestCase::QUICK); | 350 AddTestCase (new OlsrHnaTestCase (), TestCase::QUICK); |
351 AddTestCase (new OlsrTcTestCase (), TestCase::QUICK); | 351 AddTestCase (new OlsrTcTestCase (), TestCase::QUICK); |
352 AddTestCase (new OlsrHelloTestCase (), TestCase::QUICK); | 352 AddTestCase (new OlsrHelloTestCase (), TestCase::QUICK); |
353 AddTestCase (new OlsrMidTestCase (), TestCase::QUICK); | 353 AddTestCase (new OlsrMidTestCase (), TestCase::QUICK); |
354 AddTestCase (new OlsrEmfTestCase (), TestCase::QUICK); | 354 AddTestCase (new OlsrEmfTestCase (), TestCase::QUICK); |
355 } | 355 } |
356 | 356 |
357 static OlsrTestSuite g_olsrTestSuite; //!< Static variable for test initializati
on | 357 static OlsrTestSuite g_olsrTestSuite; //!< Static variable for test initializati
on |
358 | 358 |
359 | 359 |
LEFT | RIGHT |