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

(-)a/src/internet-stack/ipv4-raw-socket-impl.cc (+16 lines)
 Lines 1-3    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
1
#include <netinet/in.h>
2
#include <netinet/in.h>
2
#include "ipv4-raw-socket-impl.h"
3
#include "ipv4-raw-socket-impl.h"
3
#include "ipv4-l3-protocol.h"
4
#include "ipv4-l3-protocol.h"
 Lines 323-326    Link Here 
323
  return false;
324
  return false;
324
}
325
}
325
326
327
void
328
Ipv4RawSocketImpl::SetAllowBroadcast (bool allowBroadcast)
329
{
330
  if (!allowBroadcast)
331
    {
332
      NS_FATAL_ERROR ("not implemented");
333
    }
334
}
335
336
bool
337
Ipv4RawSocketImpl::GetAllowBroadcast () const
338
{
339
  return true;
340
}
341
326
} // namespace ns3
342
} // namespace ns3
(-)a/src/internet-stack/ipv4-raw-socket-impl.h (+4 lines)
 Lines 1-3    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
1
#ifndef IPV4_RAW_SOCKET_IMPL_H
2
#ifndef IPV4_RAW_SOCKET_IMPL_H
2
#define IPV4_RAW_SOCKET_IMPL_H
3
#define IPV4_RAW_SOCKET_IMPL_H
3
4
 Lines 41-46    Link Here 
41
42
42
  void SetProtocol (uint16_t protocol);
43
  void SetProtocol (uint16_t protocol);
43
  bool ForwardUp (Ptr<const Packet> p, Ipv4Header ipHeader, Ptr<NetDevice> device);
44
  bool ForwardUp (Ptr<const Packet> p, Ipv4Header ipHeader, Ptr<NetDevice> device);
45
  virtual void SetAllowBroadcast (bool allowBroadcast);
46
  virtual bool GetAllowBroadcast () const;
47
44
private:
48
private:
45
  virtual void DoDispose (void);
49
  virtual void DoDispose (void);
46
50
(-)a/src/internet-stack/ipv6-raw-socket-impl.cc (+15 lines)
 Lines 337-341    Link Here 
337
  return false;
337
  return false;
338
}
338
}
339
339
340
void
341
Ipv6RawSocketImpl::SetAllowBroadcast (bool allowBroadcast)
342
{
343
  if (!allowBroadcast) 
344
    {
345
      NS_FATAL_ERROR ("not implemented");
346
    }
347
}
348
349
bool
350
Ipv6RawSocketImpl::GetAllowBroadcast () const
351
{
352
  return true;
353
}
354
340
} /* namespace ns3 */
355
} /* namespace ns3 */
341
356
(-)a/src/internet-stack/ipv6-raw-socket-impl.h (+3 lines)
 Lines 186-191    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);
190
  virtual bool GetAllowBroadcast () const;
191
189
private:
192
private:
190
  /**
193
  /**
191
   * \struct Data
194
   * \struct Data
(-)a/src/internet-stack/nsc-tcp-socket-impl.cc (+15 lines)
 Lines 818-821    Link Here 
818
  return ERROR_INVAL;
818
  return ERROR_INVAL;
819
}
819
}
820
820
821
void
822
NscTcpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
823
{
824
  if (allowBroadcast)
825
    {
826
      NS_FATAL_ERROR ("not implemented");
827
    }
828
}
829
830
bool
831
NscTcpSocketImpl::GetAllowBroadcast () const
832
{
833
  return false;
834
}
835
821
}//namespace ns3
836
}//namespace ns3
(-)a/src/internet-stack/nsc-tcp-socket-impl.h (+2 lines)
 Lines 82-87    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);
86
  virtual bool GetAllowBroadcast () const;
85
87
86
private:
88
private:
87
  void NSCWakeup(void);
89
  void NSCWakeup(void);
(-)a/src/internet-stack/tcp-socket-impl.cc (+12 lines)
 Lines 1855-1860    Link Here 
1855
  return m_delAckMaxCount;
1855
  return m_delAckMaxCount;
1856
}
1856
}
1857
1857
1858
void
1859
TcpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
1860
{
1861
  NS_FATAL_ERROR ("not implemented");
1862
}
1863
1864
bool
1865
TcpSocketImpl::GetAllowBroadcast () const
1866
{
1867
  return false;
1868
}
1869
1858
}//namespace ns3
1870
}//namespace ns3
1859
1871
1860
1872
(-)a/src/internet-stack/tcp-socket-impl.h (+2 lines)
 Lines 96-101    Link Here 
96
    Address &fromAddress);
96
    Address &fromAddress);
97
  virtual int GetSockName (Address &address) const; 
97
  virtual int GetSockName (Address &address) const; 
98
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
98
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
99
  virtual void SetAllowBroadcast (bool allowBroadcast);
100
  virtual bool GetAllowBroadcast () const;
99
101
100
private:
102
private:
101
  friend class Tcp;
103
  friend class Tcp;
(-)a/src/internet-stack/udp-socket-impl.cc (+15 lines)
 Lines 703-707    Link Here 
703
  return m_mtuDiscover;
703
  return m_mtuDiscover;
704
}
704
}
705
705
706
void
707
UdpSocketImpl::SetAllowBroadcast (bool allowBroadcast)
708
{
709
  if (!allowBroadcast)
710
    {
711
      NS_FATAL_ERROR ("not implemented");
712
    }
713
}
714
715
bool
716
UdpSocketImpl::GetAllowBroadcast () const
717
{
718
  return true;
719
}
720
706
721
707
} //namespace ns3
722
} //namespace ns3
(-)a/src/internet-stack/udp-socket-impl.h (+2 lines)
 Lines 78-83    Link Here 
78
  virtual int MulticastJoinGroup (uint32_t interfaceIndex, const Address &groupAddress);
78
  virtual int MulticastJoinGroup (uint32_t interfaceIndex, const Address &groupAddress);
79
  virtual int MulticastLeaveGroup (uint32_t interfaceIndex, const Address &groupAddress);
79
  virtual int MulticastLeaveGroup (uint32_t interfaceIndex, const Address &groupAddress);
80
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
80
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
81
  virtual void SetAllowBroadcast (bool allowBroadcast);
82
  virtual bool GetAllowBroadcast () const;
81
83
82
private:
84
private:
83
  // Attributes set through UdpSocket base class 
85
  // Attributes set through UdpSocket base class 
(-)a/src/node/socket.h (+24 lines)
 Lines 546-551    Link Here 
546
   * \returns Pointer to interface.
546
   * \returns Pointer to interface.
547
   */
547
   */
548
  Ptr<NetDevice> GetBoundNetDevice (); 
548
  Ptr<NetDevice> GetBoundNetDevice (); 
549
550
551
  /**
552
   * \brief Configure whether broadcast datagram transmissions are allowed
553
   *
554
   * This method corresponds to using setsockopt() SO_BROADCAST of
555
   * real network or BSD sockets.  If set on a socket, this option
556
   * will enable or disable packets to be transmitted to broadcast
557
   * destination addresses.
558
   *
559
   * \param allowBroadcast Whether broadcast is allowed
560
   */
561
  virtual void SetAllowBroadcast (bool allowBroadcast) = 0;
562
563
  /**
564
   * \brief Query whether broadcast datagram transmissions are allowed
565
   *
566
   * This method corresponds to using getsockopt() SO_BROADCAST of
567
   * real network or BSD sockets.
568
   *
569
   * \returns true if broadcast is allowed, false otherwise
570
   */
571
  virtual bool GetAllowBroadcast () const = 0;
572
549
 
573
 
550
protected:
574
protected:
551
  void NotifyConnectionSucceeded (void);
575
  void NotifyConnectionSucceeded (void);

Return to bug 943