constify
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 15 Oct 2008 09:49:39 +0200
changeset 3744 bb6876ea0851
parent 3743 d0cf214d050c
child 3745 73e7bb607014
child 3753 a84a48233eb3
child 3803 b1b55512f867
constify
src/internet-stack/ipv4-l3-protocol.cc
src/internet-stack/ipv4-l3-protocol.h
--- a/src/internet-stack/ipv4-l3-protocol.cc	Sun Oct 12 18:04:10 2008 +0100
+++ b/src/internet-stack/ipv4-l3-protocol.cc	Wed Oct 15 09:49:39 2008 +0200
@@ -96,9 +96,9 @@
   m_protocols.push_back (protocol);
 }
 Ptr<Ipv4L4Protocol>
-Ipv4L3Protocol::GetProtocol(int protocolNumber)
+Ipv4L3Protocol::GetProtocol(int protocolNumber) const
 {
-  for (L4List_t::iterator i = m_protocols.begin(); i != m_protocols.end(); ++i)
+  for (L4List_t::const_iterator i = m_protocols.begin(); i != m_protocols.end(); ++i)
     {
       if ((*i)->GetProtocolNumber () == protocolNumber)
 	{
--- a/src/internet-stack/ipv4-l3-protocol.h	Sun Oct 12 18:04:10 2008 +0100
+++ b/src/internet-stack/ipv4-l3-protocol.h	Wed Oct 15 09:49:39 2008 +0200
@@ -80,7 +80,7 @@
    * to forward packets up the stack to the right protocol.
    * It is also called from NodeImpl::GetUdp for example.
    */
-  Ptr<Ipv4L4Protocol> GetProtocol(int protocolNumber);
+  Ptr<Ipv4L4Protocol> GetProtocol(int protocolNumber) const;
   /**
    * \param protocol protocol to remove from this demux.
    *