OLD | NEW |
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) 2009 IITP RAS | 3 * Copyright (c) 2009 IITP RAS |
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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 { | 371 { |
372 os << " prefix size " << m_prefixSize; | 372 os << " prefix size " << m_prefixSize; |
373 } | 373 } |
374 os << " source ipv4 " << m_origin << " lifetime " << m_lifeTime | 374 os << " source ipv4 " << m_origin << " lifetime " << m_lifeTime |
375 << " acknowledgment required flag " << (*this).GetAckRequired (); | 375 << " acknowledgment required flag " << (*this).GetAckRequired (); |
376 } | 376 } |
377 | 377 |
378 void | 378 void |
379 RrepHeader::SetLifeTime (Time t) | 379 RrepHeader::SetLifeTime (Time t) |
380 { | 380 { |
381 m_lifeTime = t.GetMilliSeconds (); | 381 m_lifeTime = static_cast<uint32_t> (t.GetMilliSeconds ()); |
382 } | 382 } |
383 | 383 |
384 Time | 384 Time |
385 RrepHeader::GetLifeTime () const | 385 RrepHeader::GetLifeTime () const |
386 { | 386 { |
387 Time t (MilliSeconds (m_lifeTime)); | 387 Time t (MilliSeconds (m_lifeTime)); |
388 return t; | 388 return t; |
389 } | 389 } |
390 | 390 |
391 void | 391 void |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 void | 430 void |
431 RrepHeader::SetHello (Ipv4Address origin, uint32_t srcSeqNo, Time lifetime) | 431 RrepHeader::SetHello (Ipv4Address origin, uint32_t srcSeqNo, Time lifetime) |
432 { | 432 { |
433 m_flags = 0; | 433 m_flags = 0; |
434 m_prefixSize = 0; | 434 m_prefixSize = 0; |
435 m_hopCount = 0; | 435 m_hopCount = 0; |
436 m_dst = origin; | 436 m_dst = origin; |
437 m_dstSeqNo = srcSeqNo; | 437 m_dstSeqNo = srcSeqNo; |
438 m_origin = origin; | 438 m_origin = origin; |
439 m_lifeTime = lifetime.GetMilliSeconds (); | 439 m_lifeTime = static_cast<uint32_t> (lifetime.GetMilliSeconds ()); |
440 } | 440 } |
441 | 441 |
442 std::ostream & | 442 std::ostream & |
443 operator<< (std::ostream & os, RrepHeader const & h) | 443 operator<< (std::ostream & os, RrepHeader const & h) |
444 { | 444 { |
445 h.Print (os); | 445 h.Print (os); |
446 return os; | 446 return os; |
447 } | 447 } |
448 | 448 |
449 //----------------------------------------------------------------------------- | 449 //----------------------------------------------------------------------------- |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 Buffer::Iterator i = start; | 492 Buffer::Iterator i = start; |
493 m_reserved = i.ReadU8 (); | 493 m_reserved = i.ReadU8 (); |
494 uint32_t dist = i.GetDistanceFrom (start); | 494 uint32_t dist = i.GetDistanceFrom (start); |
495 NS_ASSERT (dist == GetSerializedSize ()); | 495 NS_ASSERT (dist == GetSerializedSize ()); |
496 return dist; | 496 return dist; |
497 } | 497 } |
498 | 498 |
499 void | 499 void |
500 RrepAckHeader::Print (std::ostream &os ) const | 500 RrepAckHeader::Print (std::ostream &os ) const |
501 { | 501 { |
| 502 NS_UNUSED (os); |
502 } | 503 } |
503 | 504 |
504 bool | 505 bool |
505 RrepAckHeader::operator== (RrepAckHeader const & o ) const | 506 RrepAckHeader::operator== (RrepAckHeader const & o ) const |
506 { | 507 { |
507 return m_reserved == o.m_reserved; | 508 return m_reserved == o.m_reserved; |
508 } | 509 } |
509 | 510 |
510 std::ostream & | 511 std::ostream & |
511 operator<< (std::ostream & os, RrepAckHeader const & h ) | 512 operator<< (std::ostream & os, RrepAckHeader const & h ) |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 674 } |
674 | 675 |
675 std::ostream & | 676 std::ostream & |
676 operator<< (std::ostream & os, RerrHeader const & h ) | 677 operator<< (std::ostream & os, RerrHeader const & h ) |
677 { | 678 { |
678 h.Print (os); | 679 h.Print (os); |
679 return os; | 680 return os; |
680 } | 681 } |
681 } | 682 } |
682 } | 683 } |
OLD | NEW |