View | Details | Raw Unified | Return to bug 943
Collapse All | Expand All

(-)a/src/applications/onoff/onoff-application.cc (-4 / +1 lines)
 Lines 133-142    Link Here 
133
      m_socket = Socket::CreateSocket (GetNode(), m_tid);
133
      m_socket = Socket::CreateSocket (GetNode(), m_tid);
134
      m_socket->Bind ();
134
      m_socket->Bind ();
135
      m_socket->Connect (m_peer);
135
      m_socket->Connect (m_peer);
136
      if (m_socket->GetAllowBroadcast ())
136
      m_socket->SetAllowBroadcast (true);
137
        {
138
          m_socket->SetAllowBroadcast (true);
139
        }
140
      m_socket->ShutdownRecv ();
137
      m_socket->ShutdownRecv ();
141
    }
138
    }
142
  // Insure no pending event
139
  // Insure no pending event
(-)a/src/internet-stack/ipv4-raw-socket-impl.cc (-2 / +3 lines)
 Lines 335-347    Link Here 
335
  return false;
335
  return false;
336
}
336
}
337
337
338
void
338
bool
339
Ipv4RawSocketImpl::SetAllowBroadcast (bool allowBroadcast)
339
Ipv4RawSocketImpl::SetAllowBroadcast (bool allowBroadcast)
340
{
340
{
341
  if (!allowBroadcast)
341
  if (!allowBroadcast)
342
    {
342
    {
343
      NS_FATAL_ERROR ("not implemented");
343
      return false;
344
    }
344
    }
345
  return true;
345
}
346
}
346
347
347
bool
348
bool
(-)a/src/internet-stack/ipv4-raw-socket-impl.h (-1 / +1 lines)
 Lines 43-49    Link Here 
43
43
44
  void SetProtocol (uint16_t protocol);
44
  void SetProtocol (uint16_t protocol);
45
  bool ForwardUp (Ptr<const Packet> p, Ipv4Header ipHeader, Ptr<Ipv4Interface> incomingInterface);
45
  bool ForwardUp (Ptr<const Packet> p, Ipv4Header ipHeader, Ptr<Ipv4Interface> incomingInterface);
46
  virtual void SetAllowBroadcast (bool allowBroadcast);
46
  virtual bool SetAllowBroadcast (bool allowBroadcast);
47
  virtual bool GetAllowBroadcast () const;
47
  virtual bool GetAllowBroadcast () const;
48
48
49
private:
49
private:
(-)a/src/internet-stack/ipv6-raw-socket-impl.cc (-3 / +4 lines)
 Lines 347-359    Link Here 
347
  return false;
347
  return false;
348
}
348
}
349
349
350
void
350
bool
351
Ipv6RawSocketImpl::SetAllowBroadcast (bool allowBroadcast)
351
Ipv6RawSocketImpl::SetAllowBroadcast (bool allowBroadcast)
352
{
352
{
353
  if (!allowBroadcast) 
353
  if (!allowBroadcast)
354
    {
354
    {
355
      NS_FATAL_ERROR ("not implemented");
355
      return false;
356
    }
356
    }
357
  return true;
357
}
358
}
358
359
359
bool
360
bool
(-)a/src/internet-stack/ipv6-raw-socket-impl.h (-1 / +1 lines)
 Lines 186-192    Link Here 
186
   */
186
   */
187
  bool ForwardUp (Ptr<const Packet> p, Ipv6Header hdr, Ptr<NetDevice> device);
187
  bool ForwardUp (Ptr<const Packet> p, Ipv6Header hdr, Ptr<NetDevice> device);
188
188
189
  virtual void SetAllowBroadcast (bool allowBroadcast);
189
  virtual bool SetAllowBroadcast (bool allowBroadcast);
190
  virtual bool GetAllowBroadcast () const;
190
  virtual bool GetAllowBroadcast () const;
191
191
192
private:
192
private:
(-)a/src/internet-stack/nsc-tcp-socket-impl.cc (-2 / +3 lines)
 Lines 819-831    Link Here 
819
  return ERROR_INVAL;
819
  return ERROR_INVAL;
820
}
820
}
821
821
822
void
822
bool
823
NscTcpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
823
NscTcpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
824
{
824
{
825
  if (allowBroadcast)
825
  if (allowBroadcast)
826
    {
826
    {
827
      NS_FATAL_ERROR ("not implemented");
827
      return false;
828
    }
828
    }
829
  return true;
829
}
830
}
830
831
831
bool
832
bool
(-)a/src/internet-stack/nsc-tcp-socket-impl.h (-1 / +1 lines)
 Lines 82-88    Link Here 
82
  virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags,
82
  virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags,
83
    Address &fromAddress);
83
    Address &fromAddress);
84
  virtual int GetSockName (Address &address) const; 
84
  virtual int GetSockName (Address &address) const; 
85
  virtual void SetAllowBroadcast (bool allowBroadcast);
85
  virtual bool SetAllowBroadcast (bool allowBroadcast);
86
  virtual bool GetAllowBroadcast () const;
86
  virtual bool GetAllowBroadcast () const;
87
87
88
private:
88
private:
(-)a/src/internet-stack/tcp-socket-impl.cc (-2 / +6 lines)
 Lines 1856-1865    Link Here 
1856
  return m_delAckMaxCount;
1856
  return m_delAckMaxCount;
1857
}
1857
}
1858
1858
1859
void
1859
bool
1860
TcpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
1860
TcpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
1861
{
1861
{
1862
  NS_FATAL_ERROR ("not implemented");
1862
  if (allowBroadcast)
1863
    {
1864
      return false;
1865
    }
1866
  return true;
1863
}
1867
}
1864
1868
1865
bool
1869
bool
(-)a/src/internet-stack/tcp-socket-impl.h (-1 / +1 lines)
 Lines 98-104    Link Here 
98
    Address &fromAddress);
98
    Address &fromAddress);
99
  virtual int GetSockName (Address &address) const; 
99
  virtual int GetSockName (Address &address) const; 
100
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
100
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
101
  virtual void SetAllowBroadcast (bool allowBroadcast);
101
  virtual bool SetAllowBroadcast (bool allowBroadcast);
102
  virtual bool GetAllowBroadcast () const;
102
  virtual bool GetAllowBroadcast () const;
103
103
104
private:
104
private:
(-)a/src/internet-stack/udp-socket-impl.cc (-1 / +2 lines)
 Lines 736-745    Link Here 
736
  return m_mtuDiscover;
736
  return m_mtuDiscover;
737
}
737
}
738
738
739
void
739
bool
740
UdpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
740
UdpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
741
{
741
{
742
  m_allowBroadcast = allowBroadcast;
742
  m_allowBroadcast = allowBroadcast;
743
  return true;
743
}
744
}
744
745
745
bool
746
bool
(-)a/src/internet-stack/udp-socket-impl.h (-1 / +1 lines)
 Lines 79-85    Link Here 
79
  virtual int MulticastJoinGroup (uint32_t interfaceIndex, const Address &groupAddress);
79
  virtual int MulticastJoinGroup (uint32_t interfaceIndex, const Address &groupAddress);
80
  virtual int MulticastLeaveGroup (uint32_t interfaceIndex, const Address &groupAddress);
80
  virtual int MulticastLeaveGroup (uint32_t interfaceIndex, const Address &groupAddress);
81
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
81
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
82
  virtual void SetAllowBroadcast (bool allowBroadcast);
82
  virtual bool SetAllowBroadcast (bool allowBroadcast);
83
  virtual bool GetAllowBroadcast () const;
83
  virtual bool GetAllowBroadcast () const;
84
84
85
private:
85
private:
(-)a/src/node/packet-socket.cc (-2 / +6 lines)
 Lines 463-472    Link Here 
463
  return 0;
463
  return 0;
464
}
464
}
465
465
466
void
466
bool
467
PacketSocket::SetAllowBroadcast (bool allowBroadcast)
467
PacketSocket::SetAllowBroadcast (bool allowBroadcast)
468
{
468
{
469
  NS_FATAL_ERROR ("not implemented");
469
  if (allowBroadcast)
470
    {
471
      return false;
472
    }
473
  return true;
470
}
474
}
471
475
472
bool
476
bool
(-)a/src/node/packet-socket.h (-1 / +1 lines)
 Lines 102-108    Link Here 
102
  virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags,
102
  virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags,
103
    Address &fromAddress);
103
    Address &fromAddress);
104
  virtual int GetSockName (Address &address) const; 
104
  virtual int GetSockName (Address &address) const; 
105
  virtual void SetAllowBroadcast (bool allowBroadcast);
105
  virtual bool SetAllowBroadcast (bool allowBroadcast);
106
  virtual bool GetAllowBroadcast () const;
106
  virtual bool GetAllowBroadcast () const;
107
107
108
private:
108
private:
(-)a/src/node/socket.h (-1 / +2 lines)
 Lines 557-564    Link Here 
557
   * destination addresses.
557
   * destination addresses.
558
   *
558
   *
559
   * \param allowBroadcast Whether broadcast is allowed
559
   * \param allowBroadcast Whether broadcast is allowed
560
   * \return true if operation succeeds
560
   */
561
   */
561
  virtual void SetAllowBroadcast (bool allowBroadcast) = 0;
562
  virtual bool SetAllowBroadcast (bool allowBroadcast) = 0;
562
563
563
  /**
564
  /**
564
   * \brief Query whether broadcast datagram transmissions are allowed
565
   * \brief Query whether broadcast datagram transmissions are allowed

Return to bug 943