fix build issue on radvd casts
authorTom Henderson <tomh@tomh.org>
Sun Aug 23 20:54:31 2009 -0700 (5 months ago)
changeset 47325ea754089561
parent 4731 510db8599bfb
child 4733 96a3881940c4
fix build issue on radvd casts
src/applications/radvd/radvd-interface.h
src/applications/radvd/radvd.cc
src/applications/radvd/radvd.h
     1.1 --- a/src/applications/radvd/radvd-interface.h	Sat Aug 22 14:36:55 2009 -0700
     1.2 +++ b/src/applications/radvd/radvd-interface.h	Sun Aug 23 20:54:31 2009 -0700
     1.3 @@ -44,8 +44,8 @@
     1.4      /**
     1.5       * \brief Constructor.
     1.6       * \param interface interface index
     1.7 -     * \param maxRtrAdvInterval maximum RA interval
     1.8 -     * \param minRtrAdvInterval minimum RA interval
     1.9 +     * \param maxRtrAdvInterval maximum RA interval (ms)
    1.10 +     * \param minRtrAdvInterval minimum RA interval (ms)
    1.11       */
    1.12      RadvdInterface (uint32_t interface, uint32_t maxRtrAdvInterval, uint32_t minRtrAdvInterval);
    1.13  
    1.14 @@ -86,37 +86,37 @@
    1.15  
    1.16      /**
    1.17       * \brief Get maximum RA interval.
    1.18 -     * \return RA interval
    1.19 +     * \return RA interval (ms)
    1.20       */
    1.21      uint32_t GetMaxRtrAdvInterval () const;
    1.22  
    1.23      /**
    1.24       * \brief Get maximum RA interval.
    1.25 -     * \param maxRtrAdvInterval RA interval
    1.26 +     * \param maxRtrAdvInterval RA interval (ms)
    1.27       */
    1.28      void SetMaxRtrAdvInterval (uint32_t maxRtrAdvInterval);
    1.29  
    1.30      /**
    1.31 -     * \brief Get minimum RA interval.
    1.32 -     * \return RA interval
    1.33 +     * \brief Get minimum RA interval 
    1.34 +     * \return RA interval (ms)
    1.35       */
    1.36      uint32_t GetMinRtrAdvInterval () const;
    1.37      
    1.38      /**
    1.39 -     * \brief Get minimum RA interval.
    1.40 -     * \param minRtrAdvInterval RA interval
    1.41 +     * \brief Get minimum RA interval 
    1.42 +     * \param minRtrAdvInterval RA interval (ms).
    1.43       */
    1.44      void SetMinRtrAdvInterval (uint32_t minRtrAdvInterval);
    1.45  
    1.46      /**
    1.47       * \brief Get minimum delay between RAs.
    1.48 -     * \return minimum delay
    1.49 +     * \return minimum delay (ms)
    1.50       */
    1.51      uint32_t GetMinDelayBetweenRAs () const;
    1.52      
    1.53      /**
    1.54       * \brief Set minimum delay between RAs.
    1.55 -     * \param minDelayBetweenRAs minimum delay
    1.56 +     * \param minDelayBetweenRAs minimum delay (ms)
    1.57       */
    1.58      void SetMinDelayBetweenRAs (uint32_t minDelayBetweenRAs);
    1.59  
     2.1 --- a/src/applications/radvd/radvd.cc	Sat Aug 22 14:36:55 2009 -0700
     2.2 +++ b/src/applications/radvd/radvd.cc	Sun Aug 23 20:54:31 2009 -0700
     2.3 @@ -213,7 +213,7 @@
     2.4    m_socket->Send (p, 0);
     2.5  
     2.6    UniformVariable rnd;
     2.7 -  uint32_t delay = rnd.GetValue (config->GetMinRtrAdvInterval (), config->GetMaxRtrAdvInterval ());
     2.8 +  uint64_t delay = static_cast<uint64_t> (rnd.GetValue (config->GetMinRtrAdvInterval (), config->GetMaxRtrAdvInterval ()) + 0.5);
     2.9    Time t = MilliSeconds (delay);
    2.10    ScheduleTransmit (t, config, m_eventIds[config->GetInterface ()]);
    2.11  }
    2.12 @@ -231,7 +231,7 @@
    2.13        Ipv6Header hdr;
    2.14        Icmpv6RS rsHdr;
    2.15        Inet6SocketAddress address = Inet6SocketAddress::ConvertFrom (from);
    2.16 -      uint32_t delay = 0;
    2.17 +      uint64_t delay = 0;
    2.18        UniformVariable rnd;
    2.19        Time t;
    2.20  
    2.21 @@ -244,13 +244,13 @@
    2.22            packet->RemoveHeader (rsHdr);
    2.23            NS_LOG_INFO ("Received ICMPv6 Router Solicitation from " << hdr.GetSourceAddress () << " code = " << (uint32_t)rsHdr.GetCode ());
    2.24  
    2.25 -          delay = rnd.GetValue (0, 500); /* default value for MAX_RA_DELAY_TIME */
    2.26 +          delay = static_cast<uint64_t> (rnd.GetValue (0, MAX_RA_DELAY_TIME) + 0.5); 
    2.27            t = Simulator::Now () + MilliSeconds (delay);
    2.28  
    2.29  #if 0
    2.30            NS_LOG_INFO ("schedule new RA : " << t.GetTimeStep () << " next scheduled RA" << (int64_t)m_sendEvent.GetTs ());
    2.31  
    2.32 -          if (t.GetTimeStep () < (int64_t)m_sendEvent.GetTs ())
    2.33 +          if (t.GetTimeStep () < static_cast<int64_t> (m_sendEvent.GetTs ()))
    2.34            {
    2.35              /* send multicast RA */
    2.36              /* maybe replace this by a unicast RA (it is a SHOULD in the RFC) */
     3.1 --- a/src/applications/radvd/radvd.h	Sat Aug 22 14:36:55 2009 -0700
     3.2 +++ b/src/applications/radvd/radvd.h	Sun Aug 23 20:54:31 2009 -0700
     3.3 @@ -57,6 +57,11 @@
     3.4      virtual ~Radvd ();
     3.5  
     3.6      /**
     3.7 +     * \brief Default value for maximum delay of RA (ms)
     3.8 +     */
     3.9 +    static const uint32_t MAX_RA_DELAY_TIME = 500;
    3.10 +
    3.11 +    /**
    3.12       * \brief Add configuration for an interface;
    3.13       * \param routerInterface configuration
    3.14       */