00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright (c) 2006 Georgia Tech Research Corporation 00004 * 2007 INRIA 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License version 2 as 00008 * published by the Free Software Foundation; 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * Authors: George F. Riley<riley@ece.gatech.edu> 00020 * Mathieu Lacage <mathieu.lacage@sophia.inria.fr> 00021 */ 00022 00023 #ifndef __UDP_SOCKET_H__ 00024 #define __UDP_SOCKET_H__ 00025 00026 #include "socket.h" 00027 #include "ns3/traced-callback.h" 00028 #include "ns3/callback.h" 00029 #include "ns3/ptr.h" 00030 #include "ns3/object.h" 00031 00032 namespace ns3 { 00033 00034 class Node; 00035 class Packet; 00036 00037 /** 00038 * \ingroup socket 00039 * 00040 * \brief (abstract) base class of all UdpSockets 00041 * 00042 * This class exists solely for hosting UdpSocket attributes that can 00043 * be reused across different implementations. 00044 */ 00045 class UdpSocket : public Socket 00046 { 00047 public: 00048 static TypeId GetTypeId (void); 00049 00050 UdpSocket (void); 00051 virtual ~UdpSocket (void); 00052 00053 private: 00054 // Indirect the attribute setting and getting through private virtual methods 00055 virtual void SetRcvBufSize (uint32_t size) = 0; 00056 virtual uint32_t GetRcvBufSize (void) const = 0; 00057 virtual void SetIpTtl (uint32_t ipTtl) = 0; 00058 virtual uint32_t GetIpTtl (void) const = 0; 00059 virtual void SetIpMulticastTtl (uint32_t ipTtl) = 0; 00060 virtual uint32_t GetIpMulticastTtl (void) const = 0; 00061 virtual void SetMtuDiscover (bool discover) = 0; 00062 virtual bool GetMtuDiscover (void) const = 0; 00063 }; 00064 00065 } //namespace ns3 00066 00067 #endif /* UDP_SOCKET_H */ 00068 00069