Bug Summary

File:/tmp/asd-nat/home/nat/Work/ns-3-dev-git/build/../src/olsr/model/olsr-header.cc
Location:line 61, column 3
Description:The result of the '<<' expression is undefined

Annotated Source Code

1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2007 INESC Porto
4 *
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
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
19 */
20
21#include <cmath>
22
23#include "ns3/assert.h"
24#include "ns3/log.h"
25
26#include "olsr-header.h"
27
28#define IPV4_ADDRESS_SIZE4 4
29#define OLSR_MSG_HEADER_SIZE12 12
30#define OLSR_PKT_HEADER_SIZE4 4
31
32namespace ns3 {
33
34NS_LOG_COMPONENT_DEFINE ("OlsrHeader")static ns3::LogComponent g_log = ns3::LogComponent ("OlsrHeader"
, "../src/olsr/model/olsr-header.cc")
;
35
36namespace olsr {
37
38
39/// Scaling factor used in RFC 3626.
40#define OLSR_C0.0625 0.0625
41
42///
43/// \brief Converts a decimal number of seconds to the mantissa/exponent format.
44///
45/// \param seconds decimal number of seconds we want to convert.
46/// \return the number of seconds in mantissa/exponent format.
47///
48uint8_t
49SecondsToEmf (double seconds)
50{
51 int a, b = 0;
52
53 NS_ASSERT_MSG (seconds >= OLSR_C, "SecondsToEmf - Can not convert a value less than OLSR_C")do { if (!(seconds >= 0.0625)) { std::cerr << "assert failed. cond=\""
<< "seconds >= OLSR_C" << "\", "; do { std::cerr
<< "msg=\"" << "SecondsToEmf - Can not convert a value less than OLSR_C"
<< "\", "; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 53 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } while (false); } } while (false)
;
54
55 // find the largest integer 'b' such that: T/C >= 2^b
56 for (b = 0; (seconds / OLSR_C0.0625) >= (1 << b); ++b)
1
Loop condition is false. Execution continues on line 59
57 {
58 }
59 NS_ASSERT ((seconds / OLSR_C) < (1 << b))do { if (!((seconds / 0.0625) < (1 << b))) { std::cerr
<< "assert failed. cond=\"" << "(seconds / OLSR_C) < (1 << b)"
<< "\", "; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 59 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
60 b--;
61 NS_ASSERT ((seconds / OLSR_C) >= (1 << b))do { if (!((seconds / 0.0625) >= (1 << b))) { std::cerr
<< "assert failed. cond=\"" << "(seconds / OLSR_C) >= (1 << b)"
<< "\", "; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 61 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
2
Within the expansion of the macro 'NS_ASSERT':
a
The result of the '<<' expression is undefined
62
63 // compute the expression 16*(T/(C*(2^b))-1), which may not be a integer
64 double tmp = 16 * (seconds / (OLSR_C0.0625 * (1 << b)) - 1);
65
66 // round it up. This results in the value for 'a'
67 a = (int) std::ceil (tmp - 0.5);
68
69 // if 'a' is equal to 16: increment 'b' by one, and set 'a' to 0
70 if (a == 16)
71 {
72 b += 1;
73 a = 0;
74 }
75
76 // now, 'a' and 'b' should be integers between 0 and 15,
77 NS_ASSERT (a >= 0 && a < 16)do { if (!(a >= 0 && a < 16)) { std::cerr <<
"assert failed. cond=\"" << "a >= 0 && a < 16"
<< "\", "; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 77 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
78 NS_ASSERT (b >= 0 && b < 16)do { if (!(b >= 0 && b < 16)) { std::cerr <<
"assert failed. cond=\"" << "b >= 0 && b < 16"
<< "\", "; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 78 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
79
80 // the field will be a byte holding the value a*16+b
81 return (uint8_t)((a << 4) | b);
82}
83
84///
85/// \brief Converts a number of seconds in the mantissa/exponent format to a decimal number.
86///
87/// \param olsr_format number of seconds in mantissa/exponent format.
88/// \return the decimal number of seconds.
89///
90double
91EmfToSeconds (uint8_t olsrFormat)
92{
93 int a = (olsrFormat >> 4);
94 int b = (olsrFormat & 0xf);
95 // value = C*(1+a/16)*2^b [in seconds]
96 return OLSR_C0.0625 * (1 + a / 16.0) * (1 << b);
97}
98
99
100
101// ---------------- OLSR Packet -------------------------------
102
103NS_OBJECT_ENSURE_REGISTERED (PacketHeader)static struct ObjectPacketHeaderRegistrationClass { ObjectPacketHeaderRegistrationClass
() { ns3::TypeId tid = PacketHeader::GetTypeId (); tid.SetSize
(sizeof (PacketHeader)); tid.GetParent (); } } ObjectPacketHeaderRegistrationVariable
;
104
105PacketHeader::PacketHeader ()
106{
107}
108
109PacketHeader::~PacketHeader ()
110{
111}
112
113TypeId
114PacketHeader::GetTypeId (void)
115{
116 static TypeId tid = TypeId ("ns3::olsr::PacketHeader")
117 .SetParent<Header> ()
118 .SetGroupName ("Olsr")
119 .AddConstructor<PacketHeader> ()
120 ;
121 return tid;
122}
123TypeId
124PacketHeader::GetInstanceTypeId (void) const
125{
126 return GetTypeId ();
127}
128
129uint32_t
130PacketHeader::GetSerializedSize (void) const
131{
132 return OLSR_PKT_HEADER_SIZE4;
133}
134
135void
136PacketHeader::Print (std::ostream &os) const
137{
138 /// \todo
139}
140
141void
142PacketHeader::Serialize (Buffer::Iterator start) const
143{
144 Buffer::Iterator i = start;
145 i.WriteHtonU16 (m_packetLength);
146 i.WriteHtonU16 (m_packetSequenceNumber);
147}
148
149uint32_t
150PacketHeader::Deserialize (Buffer::Iterator start)
151{
152 Buffer::Iterator i = start;
153 m_packetLength = i.ReadNtohU16 ();
154 m_packetSequenceNumber = i.ReadNtohU16 ();
155 return GetSerializedSize ();
156}
157
158
159// ---------------- OLSR Message -------------------------------
160
161NS_OBJECT_ENSURE_REGISTERED (MessageHeader)static struct ObjectMessageHeaderRegistrationClass { ObjectMessageHeaderRegistrationClass
() { ns3::TypeId tid = MessageHeader::GetTypeId (); tid.SetSize
(sizeof (MessageHeader)); tid.GetParent (); } } ObjectMessageHeaderRegistrationVariable
;
162
163MessageHeader::MessageHeader ()
164 : m_messageType (MessageHeader::MessageType (0))
165{
166}
167
168MessageHeader::~MessageHeader ()
169{
170}
171
172TypeId
173MessageHeader::GetTypeId (void)
174{
175 static TypeId tid = TypeId ("ns3::olsr::MessageHeader")
176 .SetParent<Header> ()
177 .SetGroupName ("Olsr")
178 .AddConstructor<MessageHeader> ()
179 ;
180 return tid;
181}
182TypeId
183MessageHeader::GetInstanceTypeId (void) const
184{
185 return GetTypeId ();
186}
187
188uint32_t
189MessageHeader::GetSerializedSize (void) const
190{
191 uint32_t size = OLSR_MSG_HEADER_SIZE12;
192 switch (m_messageType)
193 {
194 case MID_MESSAGE:
195 size += m_message.mid.GetSerializedSize ();
196 break;
197 case HELLO_MESSAGE:
198 NS_LOG_DEBUG ("Hello Message Size: " << size << " + " << m_message.hello.GetSerializedSize ())do { if (g_log.IsEnabled (ns3::LOG_DEBUG)) { if (g_log.IsEnabled
(ns3::LOG_PREFIX_TIME)) { ns3::LogTimePrinter printer = ns3::
LogGetTimePrinter (); if (printer != 0) { (*printer)(std::clog
); std::clog << " "; } }; if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE
)) { ns3::LogNodePrinter printer = ns3::LogGetNodePrinter ();
if (printer != 0) { (*printer)(std::clog); std::clog <<
" "; } }; ; if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) { std
::clog << g_log.Name () << ":" << __FUNCTION__
<< "(): "; }; if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL
)) { std::clog << "[" << g_log.GetLevelLabel (ns3
::LOG_DEBUG) << "] "; }; std::clog << "Hello Message Size: "
<< size << " + " << m_message.hello.GetSerializedSize
() << std::endl; } } while (false)
;
199 size += m_message.hello.GetSerializedSize ();
200 break;
201 case TC_MESSAGE:
202 size += m_message.tc.GetSerializedSize ();
203 break;
204 case HNA_MESSAGE:
205 size += m_message.hna.GetSerializedSize ();
206 break;
207 default:
208 NS_ASSERT (false)do { if (!(false)) { std::cerr << "assert failed. cond=\""
<< "false" << "\", "; do { std::cerr << "file="
<< "../src/olsr/model/olsr-header.cc" << ", line="
<< 208 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
209 }
210 return size;
211}
212
213void
214MessageHeader::Print (std::ostream &os) const
215{
216 /// \todo
217}
218
219void
220MessageHeader::Serialize (Buffer::Iterator start) const
221{
222 Buffer::Iterator i = start;
223 i.WriteU8 (m_messageType);
224 i.WriteU8 (m_vTime);
225 i.WriteHtonU16 (GetSerializedSize ());
226 i.WriteHtonU32 (m_originatorAddress.Get ());
227 i.WriteU8 (m_timeToLive);
228 i.WriteU8 (m_hopCount);
229 i.WriteHtonU16 (m_messageSequenceNumber);
230
231 switch (m_messageType)
232 {
233 case MID_MESSAGE:
234 m_message.mid.Serialize (i);
235 break;
236 case HELLO_MESSAGE:
237 m_message.hello.Serialize (i);
238 break;
239 case TC_MESSAGE:
240 m_message.tc.Serialize (i);
241 break;
242 case HNA_MESSAGE:
243 m_message.hna.Serialize (i);
244 break;
245 default:
246 NS_ASSERT (false)do { if (!(false)) { std::cerr << "assert failed. cond=\""
<< "false" << "\", "; do { std::cerr << "file="
<< "../src/olsr/model/olsr-header.cc" << ", line="
<< 246 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
247 }
248
249}
250
251uint32_t
252MessageHeader::Deserialize (Buffer::Iterator start)
253{
254 uint32_t size;
255 Buffer::Iterator i = start;
256 m_messageType = (MessageType) i.ReadU8 ();
257 NS_ASSERT (m_messageType >= HELLO_MESSAGE && m_messageType <= HNA_MESSAGE)do { if (!(m_messageType >= HELLO_MESSAGE && m_messageType
<= HNA_MESSAGE)) { std::cerr << "assert failed. cond=\""
<< "m_messageType >= HELLO_MESSAGE && m_messageType <= HNA_MESSAGE"
<< "\", "; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 257 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
258 m_vTime = i.ReadU8 ();
259 m_messageSize = i.ReadNtohU16 ();
260 m_originatorAddress = Ipv4Address (i.ReadNtohU32 ());
261 m_timeToLive = i.ReadU8 ();
262 m_hopCount = i.ReadU8 ();
263 m_messageSequenceNumber = i.ReadNtohU16 ();
264 size = OLSR_MSG_HEADER_SIZE12;
265 switch (m_messageType)
266 {
267 case MID_MESSAGE:
268 size += m_message.mid.Deserialize (i, m_messageSize - OLSR_MSG_HEADER_SIZE12);
269 break;
270 case HELLO_MESSAGE:
271 size += m_message.hello.Deserialize (i, m_messageSize - OLSR_MSG_HEADER_SIZE12);
272 break;
273 case TC_MESSAGE:
274 size += m_message.tc.Deserialize (i, m_messageSize - OLSR_MSG_HEADER_SIZE12);
275 break;
276 case HNA_MESSAGE:
277 size += m_message.hna.Deserialize (i, m_messageSize - OLSR_MSG_HEADER_SIZE12);
278 break;
279 default:
280 NS_ASSERT (false)do { if (!(false)) { std::cerr << "assert failed. cond=\""
<< "false" << "\", "; do { std::cerr << "file="
<< "../src/olsr/model/olsr-header.cc" << ", line="
<< 280 << std::endl; ::ns3::FatalImpl::FlushStreams
(); if (true) std::terminate (); } while (false); } } while (
false)
;
281 }
282 return size;
283}
284
285
286// ---------------- OLSR MID Message -------------------------------
287
288uint32_t
289MessageHeader::Mid::GetSerializedSize (void) const
290{
291 return this->interfaceAddresses.size () * IPV4_ADDRESS_SIZE4;
292}
293
294void
295MessageHeader::Mid::Print (std::ostream &os) const
296{
297 /// \todo
298}
299
300void
301MessageHeader::Mid::Serialize (Buffer::Iterator start) const
302{
303 Buffer::Iterator i = start;
304
305 for (std::vector<Ipv4Address>::const_iterator iter = this->interfaceAddresses.begin ();
306 iter != this->interfaceAddresses.end (); iter++)
307 {
308 i.WriteHtonU32 (iter->Get ());
309 }
310}
311
312uint32_t
313MessageHeader::Mid::Deserialize (Buffer::Iterator start, uint32_t messageSize)
314{
315 Buffer::Iterator i = start;
316
317 this->interfaceAddresses.clear ();
318 NS_ASSERT (messageSize % IPV4_ADDRESS_SIZE == 0)do { if (!(messageSize % 4 == 0)) { std::cerr << "assert failed. cond=\""
<< "messageSize % IPV4_ADDRESS_SIZE == 0" << "\", "
; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 318 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
319
320 int numAddresses = messageSize / IPV4_ADDRESS_SIZE4;
321 this->interfaceAddresses.erase (this->interfaceAddresses.begin (),
322 this->interfaceAddresses.end ());
323 for (int n = 0; n < numAddresses; ++n)
324 {
325 this->interfaceAddresses.push_back (Ipv4Address (i.ReadNtohU32 ()));
326 }
327 return GetSerializedSize ();
328}
329
330
331
332// ---------------- OLSR HELLO Message -------------------------------
333
334uint32_t
335MessageHeader::Hello::GetSerializedSize (void) const
336{
337 uint32_t size = 4;
338 for (std::vector<LinkMessage>::const_iterator iter = this->linkMessages.begin ();
339 iter != this->linkMessages.end (); iter++)
340 {
341 const LinkMessage &lm = *iter;
342 size += 4;
343 size += IPV4_ADDRESS_SIZE4 * lm.neighborInterfaceAddresses.size ();
344 }
345 return size;
346}
347
348void
349MessageHeader::Hello::Print (std::ostream &os) const
350{
351 /// \todo
352}
353
354void
355MessageHeader::Hello::Serialize (Buffer::Iterator start) const
356{
357 Buffer::Iterator i = start;
358
359 i.WriteU16 (0); // Reserved
360 i.WriteU8 (this->hTime);
361 i.WriteU8 (this->willingness);
362
363 for (std::vector<LinkMessage>::const_iterator iter = this->linkMessages.begin ();
364 iter != this->linkMessages.end (); iter++)
365 {
366 const LinkMessage &lm = *iter;
367
368 i.WriteU8 (lm.linkCode);
369 i.WriteU8 (0); // Reserved
370
371 // The size of the link message, counted in bytes and measured
372 // from the beginning of the "Link Code" field and until the
373 // next "Link Code" field (or - if there are no more link types
374 // - the end of the message).
375 i.WriteHtonU16 (4 + lm.neighborInterfaceAddresses.size () * IPV4_ADDRESS_SIZE4);
376
377 for (std::vector<Ipv4Address>::const_iterator neigh_iter = lm.neighborInterfaceAddresses.begin ();
378 neigh_iter != lm.neighborInterfaceAddresses.end (); neigh_iter++)
379 {
380 i.WriteHtonU32 (neigh_iter->Get ());
381 }
382 }
383}
384
385uint32_t
386MessageHeader::Hello::Deserialize (Buffer::Iterator start, uint32_t messageSize)
387{
388 Buffer::Iterator i = start;
389
390 NS_ASSERT (messageSize >= 4)do { if (!(messageSize >= 4)) { std::cerr << "assert failed. cond=\""
<< "messageSize >= 4" << "\", "; do { std::cerr
<< "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 390 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
391
392 this->linkMessages.clear ();
393
394 uint16_t helloSizeLeft = messageSize;
395
396 i.ReadNtohU16 (); // Reserved
397 this->hTime = i.ReadU8 ();
398 this->willingness = i.ReadU8 ();
399
400 helloSizeLeft -= 4;
401
402 while (helloSizeLeft)
403 {
404 LinkMessage lm;
405 NS_ASSERT (helloSizeLeft >= 4)do { if (!(helloSizeLeft >= 4)) { std::cerr << "assert failed. cond=\""
<< "helloSizeLeft >= 4" << "\", "; do { std::
cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 405 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
406 lm.linkCode = i.ReadU8 ();
407 i.ReadU8 (); // Reserved
408 uint16_t lmSize = i.ReadNtohU16 ();
409 NS_ASSERT ((lmSize - 4) % IPV4_ADDRESS_SIZE == 0)do { if (!((lmSize - 4) % 4 == 0)) { std::cerr << "assert failed. cond=\""
<< "(lmSize - 4) % IPV4_ADDRESS_SIZE == 0" << "\", "
; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 409 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
410 for (int n = (lmSize - 4) / IPV4_ADDRESS_SIZE4; n; --n)
411 {
412 lm.neighborInterfaceAddresses.push_back (Ipv4Address (i.ReadNtohU32 ()));
413 }
414 helloSizeLeft -= lmSize;
415 this->linkMessages.push_back (lm);
416 }
417
418 return messageSize;
419}
420
421
422
423// ---------------- OLSR TC Message -------------------------------
424
425uint32_t
426MessageHeader::Tc::GetSerializedSize (void) const
427{
428 return 4 + this->neighborAddresses.size () * IPV4_ADDRESS_SIZE4;
429}
430
431void
432MessageHeader::Tc::Print (std::ostream &os) const
433{
434 /// \todo
435}
436
437void
438MessageHeader::Tc::Serialize (Buffer::Iterator start) const
439{
440 Buffer::Iterator i = start;
441
442 i.WriteHtonU16 (this->ansn);
443 i.WriteHtonU16 (0); // Reserved
444
445 for (std::vector<Ipv4Address>::const_iterator iter = this->neighborAddresses.begin ();
446 iter != this->neighborAddresses.end (); iter++)
447 {
448 i.WriteHtonU32 (iter->Get ());
449 }
450}
451
452uint32_t
453MessageHeader::Tc::Deserialize (Buffer::Iterator start, uint32_t messageSize)
454{
455 Buffer::Iterator i = start;
456
457 this->neighborAddresses.clear ();
458 NS_ASSERT (messageSize >= 4)do { if (!(messageSize >= 4)) { std::cerr << "assert failed. cond=\""
<< "messageSize >= 4" << "\", "; do { std::cerr
<< "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 458 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
459
460 this->ansn = i.ReadNtohU16 ();
461 i.ReadNtohU16 (); // Reserved
462
463 NS_ASSERT ((messageSize - 4) % IPV4_ADDRESS_SIZE == 0)do { if (!((messageSize - 4) % 4 == 0)) { std::cerr << "assert failed. cond=\""
<< "(messageSize - 4) % IPV4_ADDRESS_SIZE == 0" <<
"\", "; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 463 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
464 int numAddresses = (messageSize - 4) / IPV4_ADDRESS_SIZE4;
465 this->neighborAddresses.clear ();
466 for (int n = 0; n < numAddresses; ++n)
467 {
468 this->neighborAddresses.push_back (Ipv4Address (i.ReadNtohU32 ()));
469 }
470
471 return messageSize;
472}
473
474
475// ---------------- OLSR HNA Message -------------------------------
476
477uint32_t
478MessageHeader::Hna::GetSerializedSize (void) const
479{
480 return 2 * this->associations.size () * IPV4_ADDRESS_SIZE4;
481}
482
483void
484MessageHeader::Hna::Print (std::ostream &os) const
485{
486 /// \todo
487}
488
489void
490MessageHeader::Hna::Serialize (Buffer::Iterator start) const
491{
492 Buffer::Iterator i = start;
493
494 for (size_t n = 0; n < this->associations.size (); ++n)
495 {
496 i.WriteHtonU32 (this->associations[n].address.Get ());
497 i.WriteHtonU32 (this->associations[n].mask.Get ());
498 }
499}
500
501uint32_t
502MessageHeader::Hna::Deserialize (Buffer::Iterator start, uint32_t messageSize)
503{
504 Buffer::Iterator i = start;
505
506 NS_ASSERT (messageSize % (IPV4_ADDRESS_SIZE * 2) == 0)do { if (!(messageSize % (4 * 2) == 0)) { std::cerr << "assert failed. cond=\""
<< "messageSize % (IPV4_ADDRESS_SIZE * 2) == 0" <<
"\", "; do { std::cerr << "file=" << "../src/olsr/model/olsr-header.cc"
<< ", line=" << 506 << std::endl; ::ns3::FatalImpl
::FlushStreams (); if (true) std::terminate (); } while (false
); } } while (false)
;
507 int numAddresses = messageSize / IPV4_ADDRESS_SIZE4 / 2;
508 this->associations.clear ();
509 for (int n = 0; n < numAddresses; ++n)
510 {
511 Ipv4Address address (i.ReadNtohU32 ());
512 Ipv4Mask mask (i.ReadNtohU32 ());
513 this->associations.push_back ((Association) { address, mask});
514 }
515 return messageSize;
516}
517
518}
519} // namespace olsr, ns3
520