A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
udp-socket.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006 Georgia Tech Research Corporation
4  * 2007 INRIA
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: George F. Riley<riley@ece.gatech.edu>
20  * Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
21  */
22 
23 #ifndef UDP_SOCKET_H
24 #define UDP_SOCKET_H
25 
26 #include "ns3/socket.h"
27 #include "ns3/traced-callback.h"
28 #include "ns3/callback.h"
29 #include "ns3/ptr.h"
30 #include "ns3/object.h"
31 
32 namespace ns3 {
33 
34 class Node;
35 class Packet;
36 
46 class UdpSocket : public Socket
47 {
48 public:
54  static TypeId GetTypeId (void);
55 
56  UdpSocket (void);
57  virtual ~UdpSocket (void);
58 
83  virtual int MulticastJoinGroup (uint32_t interface, const Address &groupAddress) = 0;
84 
103  virtual int MulticastLeaveGroup (uint32_t interface, const Address &groupAddress) = 0;
104 
105 private:
106  // Indirect the attribute setting and getting through private virtual methods
111  virtual void SetRcvBufSize (uint32_t size) = 0;
116  virtual uint32_t GetRcvBufSize (void) const = 0;
121  virtual void SetIpMulticastTtl (uint8_t ipTtl) = 0;
126  virtual uint8_t GetIpMulticastTtl (void) const = 0;
131  virtual void SetIpMulticastIf (int32_t ipIf) = 0;
136  virtual int32_t GetIpMulticastIf (void) const = 0;
146  virtual void SetIpMulticastLoop (bool loop) = 0;
156  virtual bool GetIpMulticastLoop (void) const = 0;
162  virtual void SetMtuDiscover (bool discover) = 0;
168  virtual bool GetMtuDiscover (void) const = 0;
169 };
170 
171 } // namespace ns3
172 
173 #endif /* UDP_SOCKET_H */
174 
175 
(abstract) base class of all UdpSockets
Definition: udp-socket.h:46
virtual uint8_t GetIpMulticastTtl(void) const =0
Get the IP multicast TTL.
virtual void SetIpMulticastTtl(uint8_t ipTtl)=0
Set the IP multicast TTL.
virtual bool GetIpMulticastLoop(void) const =0
Get the IP multicast loop capability.
a polymophic address class
Definition: address.h:86
static TypeId GetTypeId(void)
Get the type ID.
Definition: udp-socket.cc:37
virtual void SetIpMulticastIf(int32_t ipIf)=0
Set the IP multicast interface.
A low-level Socket API based loosely on the BSD Socket API.
Definition: socket.h:66
virtual int MulticastJoinGroup(uint32_t interface, const Address &groupAddress)=0
Corresponds to socket option MCAST_JOIN_GROUP.
virtual int MulticastLeaveGroup(uint32_t interface, const Address &groupAddress)=0
Corresponds to socket option MCAST_LEAVE_GROUP.
virtual int32_t GetIpMulticastIf(void) const =0
Get the IP multicast interface.
virtual void SetRcvBufSize(uint32_t size)=0
Set the receiving buffer size.
virtual uint32_t GetRcvBufSize(void) const =0
Get the receiving buffer size.
virtual bool GetMtuDiscover(void) const =0
Get the MTU discover capability.
virtual ~UdpSocket(void)
Definition: udp-socket.cc:85
virtual void SetIpMulticastLoop(bool loop)=0
Set the IP multicast loop capability.
virtual void SetMtuDiscover(bool discover)=0
Set the MTU discover capability.
a unique identifier for an interface.
Definition: type-id.h:49