diff -r 21219d90245e src/applications/onoff/onoff-application.cc --- a/src/applications/onoff/onoff-application.cc Thu Jul 15 21:45:01 2010 -0700 +++ b/src/applications/onoff/onoff-application.cc Fri Jul 16 16:45:04 2010 +0100 @@ -133,10 +133,7 @@ m_socket = Socket::CreateSocket (GetNode(), m_tid); m_socket->Bind (); m_socket->Connect (m_peer); - if (m_socket->GetAllowBroadcast ()) - { - m_socket->SetAllowBroadcast (true); - } + m_socket->SetAllowBroadcast (true); m_socket->ShutdownRecv (); } // Insure no pending event diff -r 21219d90245e src/internet-stack/ipv4-raw-socket-impl.cc --- a/src/internet-stack/ipv4-raw-socket-impl.cc Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/ipv4-raw-socket-impl.cc Fri Jul 16 16:45:04 2010 +0100 @@ -335,13 +335,14 @@ return false; } -void +bool Ipv4RawSocketImpl::SetAllowBroadcast (bool allowBroadcast) { if (!allowBroadcast) { - NS_FATAL_ERROR ("not implemented"); + return false; } + return true; } bool diff -r 21219d90245e src/internet-stack/ipv4-raw-socket-impl.h --- a/src/internet-stack/ipv4-raw-socket-impl.h Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/ipv4-raw-socket-impl.h Fri Jul 16 16:45:04 2010 +0100 @@ -43,7 +43,7 @@ void SetProtocol (uint16_t protocol); bool ForwardUp (Ptr p, Ipv4Header ipHeader, Ptr incomingInterface); - virtual void SetAllowBroadcast (bool allowBroadcast); + virtual bool SetAllowBroadcast (bool allowBroadcast); virtual bool GetAllowBroadcast () const; private: diff -r 21219d90245e src/internet-stack/ipv6-raw-socket-impl.cc --- a/src/internet-stack/ipv6-raw-socket-impl.cc Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/ipv6-raw-socket-impl.cc Fri Jul 16 16:45:04 2010 +0100 @@ -347,13 +347,14 @@ return false; } -void +bool Ipv6RawSocketImpl::SetAllowBroadcast (bool allowBroadcast) { - if (!allowBroadcast) + if (!allowBroadcast) { - NS_FATAL_ERROR ("not implemented"); + return false; } + return true; } bool diff -r 21219d90245e src/internet-stack/ipv6-raw-socket-impl.h --- a/src/internet-stack/ipv6-raw-socket-impl.h Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/ipv6-raw-socket-impl.h Fri Jul 16 16:45:04 2010 +0100 @@ -186,7 +186,7 @@ */ bool ForwardUp (Ptr p, Ipv6Header hdr, Ptr device); - virtual void SetAllowBroadcast (bool allowBroadcast); + virtual bool SetAllowBroadcast (bool allowBroadcast); virtual bool GetAllowBroadcast () const; private: diff -r 21219d90245e src/internet-stack/nsc-tcp-socket-impl.cc --- a/src/internet-stack/nsc-tcp-socket-impl.cc Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/nsc-tcp-socket-impl.cc Fri Jul 16 16:45:04 2010 +0100 @@ -819,13 +819,14 @@ return ERROR_INVAL; } -void +bool NscTcpSocketImpl::SetAllowBroadcast (bool allowBroadcast) { if (allowBroadcast) { - NS_FATAL_ERROR ("not implemented"); + return false; } + return true; } bool diff -r 21219d90245e src/internet-stack/nsc-tcp-socket-impl.h --- a/src/internet-stack/nsc-tcp-socket-impl.h Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/nsc-tcp-socket-impl.h Fri Jul 16 16:45:04 2010 +0100 @@ -82,7 +82,7 @@ virtual Ptr RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress); virtual int GetSockName (Address &address) const; - virtual void SetAllowBroadcast (bool allowBroadcast); + virtual bool SetAllowBroadcast (bool allowBroadcast); virtual bool GetAllowBroadcast () const; private: diff -r 21219d90245e src/internet-stack/tcp-socket-impl.cc --- a/src/internet-stack/tcp-socket-impl.cc Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/tcp-socket-impl.cc Fri Jul 16 16:45:04 2010 +0100 @@ -1856,10 +1856,14 @@ return m_delAckMaxCount; } -void +bool TcpSocketImpl::SetAllowBroadcast (bool allowBroadcast) { - NS_FATAL_ERROR ("not implemented"); + if (allowBroadcast) + { + return false; + } + return true; } bool diff -r 21219d90245e src/internet-stack/tcp-socket-impl.h --- a/src/internet-stack/tcp-socket-impl.h Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/tcp-socket-impl.h Fri Jul 16 16:45:04 2010 +0100 @@ -98,7 +98,7 @@ Address &fromAddress); virtual int GetSockName (Address &address) const; virtual void BindToNetDevice (Ptr netdevice); - virtual void SetAllowBroadcast (bool allowBroadcast); + virtual bool SetAllowBroadcast (bool allowBroadcast); virtual bool GetAllowBroadcast () const; private: diff -r 21219d90245e src/internet-stack/udp-socket-impl.cc --- a/src/internet-stack/udp-socket-impl.cc Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/udp-socket-impl.cc Fri Jul 16 16:45:04 2010 +0100 @@ -736,10 +736,11 @@ return m_mtuDiscover; } -void +bool UdpSocketImpl::SetAllowBroadcast (bool allowBroadcast) { m_allowBroadcast = allowBroadcast; + return true; } bool diff -r 21219d90245e src/internet-stack/udp-socket-impl.h --- a/src/internet-stack/udp-socket-impl.h Thu Jul 15 21:45:01 2010 -0700 +++ b/src/internet-stack/udp-socket-impl.h Fri Jul 16 16:45:04 2010 +0100 @@ -79,7 +79,7 @@ virtual int MulticastJoinGroup (uint32_t interfaceIndex, const Address &groupAddress); virtual int MulticastLeaveGroup (uint32_t interfaceIndex, const Address &groupAddress); virtual void BindToNetDevice (Ptr netdevice); - virtual void SetAllowBroadcast (bool allowBroadcast); + virtual bool SetAllowBroadcast (bool allowBroadcast); virtual bool GetAllowBroadcast () const; private: diff -r 21219d90245e src/node/packet-socket.cc --- a/src/node/packet-socket.cc Thu Jul 15 21:45:01 2010 -0700 +++ b/src/node/packet-socket.cc Fri Jul 16 16:45:04 2010 +0100 @@ -463,10 +463,14 @@ return 0; } -void +bool PacketSocket::SetAllowBroadcast (bool allowBroadcast) { - NS_FATAL_ERROR ("not implemented"); + if (allowBroadcast) + { + return false; + } + return true; } bool diff -r 21219d90245e src/node/packet-socket.h --- a/src/node/packet-socket.h Thu Jul 15 21:45:01 2010 -0700 +++ b/src/node/packet-socket.h Fri Jul 16 16:45:04 2010 +0100 @@ -102,7 +102,7 @@ virtual Ptr RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress); virtual int GetSockName (Address &address) const; - virtual void SetAllowBroadcast (bool allowBroadcast); + virtual bool SetAllowBroadcast (bool allowBroadcast); virtual bool GetAllowBroadcast () const; private: diff -r 21219d90245e src/node/socket.h --- a/src/node/socket.h Thu Jul 15 21:45:01 2010 -0700 +++ b/src/node/socket.h Fri Jul 16 16:45:04 2010 +0100 @@ -557,8 +557,9 @@ * destination addresses. * * \param allowBroadcast Whether broadcast is allowed + * \return true if operation succeeds */ - virtual void SetAllowBroadcast (bool allowBroadcast) = 0; + virtual bool SetAllowBroadcast (bool allowBroadcast) = 0; /** * \brief Query whether broadcast datagram transmissions are allowed