Remove IcmpSocket class.
authorSebastien Vincent <vincent@clarinet.u-strasbg.fr>
Fri, 28 Nov 2008 14:24:09 +0100
changeset 3950 3d1e71561636
parent 3949 016c554c4f6d
child 3951 561a37800333
Remove IcmpSocket class.
bindings/python/ns3_module_node.py
src/node/icmp-socket.cc
src/node/icmp-socket.h
src/node/wscript
--- a/bindings/python/ns3_module_node.py	Wed Nov 26 14:00:05 2008 -0800
+++ b/bindings/python/ns3_module_node.py	Fri Nov 28 14:24:09 2008 +0100
@@ -113,8 +113,6 @@
     module.add_class('EthernetHeader', parent=root_module['ns3::Header'])
     ## ethernet-trailer.h: ns3::EthernetTrailer [class]
     module.add_class('EthernetTrailer', parent=root_module['ns3::Trailer'])
-    ## icmp-socket.h: ns3::IcmpSocket [class]
-    module.add_class('IcmpSocket', parent=root_module['ns3::Socket'])
     ## ipv4.h: ns3::Ipv4 [class]
     module.add_class('Ipv4', parent=root_module['ns3::Object'])
     ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory [class]
@@ -220,7 +218,6 @@
     register_Ns3DropTailQueue_methods(root_module, root_module['ns3::DropTailQueue'])
     register_Ns3EthernetHeader_methods(root_module, root_module['ns3::EthernetHeader'])
     register_Ns3EthernetTrailer_methods(root_module, root_module['ns3::EthernetTrailer'])
-    register_Ns3IcmpSocket_methods(root_module, root_module['ns3::IcmpSocket'])
     register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4'])
     register_Ns3Ipv4RawSocketFactory_methods(root_module, root_module['ns3::Ipv4RawSocketFactory'])
     register_Ns3Ipv4RoutingProtocol_methods(root_module, root_module['ns3::Ipv4RoutingProtocol'])
@@ -2504,98 +2501,6 @@
                    is_virtual=True)
     return
 
-def register_Ns3IcmpSocket_methods(root_module, cls):
-    ## icmp-socket.h: ns3::IcmpSocket::IcmpSocket(ns3::IcmpSocket const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::IcmpSocket const &', 'arg0')])
-    ## icmp-socket.h: static ns3::TypeId ns3::IcmpSocket::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## icmp-socket.h: ns3::IcmpSocket::IcmpSocket() [constructor]
-    cls.add_constructor([])
-    ## icmp-socket.h: ns3::Socket::SocketErrno ns3::IcmpSocket::GetErrno() const [member function]
-    cls.add_method('GetErrno', 
-                   'ns3::Socket::SocketErrno', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## icmp-socket.h: ns3::Ptr<ns3::Node> ns3::IcmpSocket::GetNode() const [member function]
-    cls.add_method('GetNode', 
-                   'ns3::Ptr< ns3::Node >', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## icmp-socket.h: int ns3::IcmpSocket::Bind() [member function]
-    cls.add_method('Bind', 
-                   'int', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: int ns3::IcmpSocket::Bind(ns3::Address const & addr) [member function]
-    cls.add_method('Bind', 
-                   'int', 
-                   [param('ns3::Address const &', 'addr')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: int ns3::IcmpSocket::Close() [member function]
-    cls.add_method('Close', 
-                   'int', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: int ns3::IcmpSocket::ShutdownSend() [member function]
-    cls.add_method('ShutdownSend', 
-                   'int', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: int ns3::IcmpSocket::ShutdownRecv() [member function]
-    cls.add_method('ShutdownRecv', 
-                   'int', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: int ns3::IcmpSocket::Connect(ns3::Address const & addr) [member function]
-    cls.add_method('Connect', 
-                   'int', 
-                   [param('ns3::Address const &', 'addr')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: int ns3::IcmpSocket::Send(ns3::Ptr<ns3::Packet> p, uint32_t flags) [member function]
-    cls.add_method('Send', 
-                   'int', 
-                   [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: uint32_t ns3::IcmpSocket::GetTxAvailable() const [member function]
-    cls.add_method('GetTxAvailable', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## icmp-socket.h: int ns3::IcmpSocket::SendTo(ns3::Ptr<ns3::Packet> p, uint32_t flags, ns3::Address const & addr) [member function]
-    cls.add_method('SendTo', 
-                   'int', 
-                   [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'addr')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: ns3::Ptr<ns3::Packet> ns3::IcmpSocket::Recv(uint32_t maxSize, uint32_t flags) [member function]
-    cls.add_method('Recv', 
-                   'ns3::Ptr< ns3::Packet >', 
-                   [param('uint32_t', 'maxSize'), param('uint32_t', 'flags')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: ns3::Ptr<ns3::Packet> ns3::IcmpSocket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function]
-    cls.add_method('RecvFrom', 
-                   'ns3::Ptr< ns3::Packet >', 
-                   [param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## icmp-socket.h: uint32_t ns3::IcmpSocket::GetRxAvailable() const [member function]
-    cls.add_method('GetRxAvailable', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## icmp-socket.h: uint32_t ns3::IcmpSocket::GetRcvBufSize() const [member function]
-    cls.add_method('GetRcvBufSize', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
-    ## icmp-socket.h: void ns3::IcmpSocket::SetRcvBufSize(uint32_t rcvBufSize) [member function]
-    cls.add_method('SetRcvBufSize', 
-                   'void', 
-                   [param('uint32_t', 'rcvBufSize')], 
-                   is_pure_virtual=True, visibility='private', is_virtual=True)
-    return
-
 def register_Ns3Ipv4_methods(root_module, cls):
     ## ipv4.h: ns3::Ipv4::Ipv4(ns3::Ipv4 const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::Ipv4 const &', 'arg0')])
--- a/src/node/icmp-socket.cc	Wed Nov 26 14:00:05 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2008 Louis Pasteur University
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
- */
-
-#include "ns3/object.h"
-#include "ns3/log.h"
-#include "ns3/uinteger.h"
-#include "ns3/trace-source-accessor.h"
-#include "icmp-socket.h"
-
-NS_LOG_COMPONENT_DEFINE ("IcmpSocket");
-
-namespace ns3 {
-
-  NS_OBJECT_ENSURE_REGISTERED (IcmpSocket);
-
-  TypeId IcmpSocket::GetTypeId (void)
-  {
-    static TypeId tid = TypeId ("ns3::IcmpSocket")
-      .SetParent<Socket> ()
-      .AddAttribute ("RcvBufSize",
-          "IcmpSocket maximum receive buffer size (bytes)",
-          UintegerValue (0xffffffffl),
-          MakeUintegerAccessor (&IcmpSocket::GetRcvBufSize,
-            &IcmpSocket::SetRcvBufSize),
-          MakeUintegerChecker<uint32_t> ())
-      ;
-    return tid;
-  }
-
-  IcmpSocket::IcmpSocket (void)
-  {
-    NS_LOG_FUNCTION_NOARGS ();
-  }
-
-  IcmpSocket::~IcmpSocket (void)
-  {
-    NS_LOG_FUNCTION_NOARGS ();
-  }
-
-}; /* namespace ns3 */
-
--- a/src/node/icmp-socket.h	Wed Nov 26 14:00:05 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2008 Louis Pasteur University
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Authors: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
- */
-
-#ifndef ICMP_SOCKET_H
-#define ICMP_SOCKET_H
-
-#include "socket.h"
-#include "ns3/traced-callback.h"
-#include "ns3/callback.h"
-#include "ns3/ptr.h"
-#include "ns3/object.h"
-
-namespace ns3 {
-
-class Node;
-class Packet;
-
-/**
- * \brief (abstract) base class of all IcmpSockets (for IPv4 or IPv6).
- *
- * This class exists solely for hosting IcmpSocket attributes that can
- * be reused across different implementations.
- */
-class IcmpSocket : public Socket
-{
-  public:
-    /**
-     * \brief Get the UID of this class.
-     * \return UID
-     */
-    static TypeId GetTypeId (void);
-
-    /**
-     * \brief Constructor.
-     */
-    IcmpSocket (void);
-
-    /**
-     * \brief Destructor.
-     */
-    virtual ~IcmpSocket (void);
-
-    /**
-     * \brief Get the error.
-     * \return the error.
-     */
-    virtual enum Socket::SocketErrno GetErrno (void) const = 0;
-
-    /**
-     * \brief Get the node.
-     * \return the node
-     */
-    virtual Ptr<Node> GetNode (void) const = 0;
-
-    /**
-     * \brief Bind the socket.
-     * \return 0 if OK, -1 otherwise
-     */
-    virtual int Bind (void) = 0;
-
-    /**
-     * \brief Bind the socket on "addr".
-     * \param addr address
-     * \return 0 if OK, -1 otherwise
-     */
-    virtual int Bind (const Address &addr) = 0;
-
-    /**
-     * \brief Close the socket.
-     * \return 0 if OK, -1 otherwise
-     */
-    virtual int Close (void) = 0;
-
-    /**
-     * \brief Shutdown the socket on send.
-     * \return 0 if OK, -1 otherwise
-     */
-    virtual int ShutdownSend (void) = 0;
-
-    /**
-     * \brief Shutdown the socket on receive.
-     * \return 0 if OK, -1 otherwise
-     */
-    virtual int ShutdownRecv (void) = 0;
-
-    /**
-     * \brief Connect to another node.
-     * \param addr address
-     * \return 0 if OK, -1 otherwise
-     */
-    virtual int Connect (const Address &addr) = 0;
-
-    /**
-     * \brief Send a packet.
-     * \param p the packet to send
-     * \param flags flags
-     * \return 0 if OK, -1 otherwise
-     */		
-    virtual int Send (Ptr<Packet> p, uint32_t flags) = 0;
-
-    /**
-     * \brief Get the maximum message size available.
-     * \return maximum message size
-     * \warning size of a message that could be sent is limited by the link MTU.
-     */
-    virtual uint32_t GetTxAvailable (void) const = 0;
-
-    /**
-     * \brief Send a packet to a node.
-     * \param addr the address of the node
-     * \param flags flags
-     * \param p the packet to send
-     * \return 0 if OK, -1 otherwise
-     */
-    virtual int SendTo (Ptr<Packet> p, uint32_t flags, const Address &addr) = 0;
-
-    /**
-     * \brief Receive method.
-     * \param maxSize maximum size we want to return
-     * \param flags flags
-     * \return a packet with at maximum maxSize size
-     */
-    virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags) = 0;
-
-    /**
-     * \brief Receive method.
-     * \param maxSize maximum size we want to return
-     * \param flags flags
-     * \param fromAddress sender address
-     * \return a packet with at maximum maxSize size
-     */
-    virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress) = 0;
-
-    /**
-     * \brief Get the size we could receive.
-     * \return size we could receive at one moment
-     */
-    virtual uint32_t GetRxAvailable (void) const = 0;
-
-  private:
-    /**
-     * \brief Get the receive buffer size.
-     * \return receive buffer size
-     */
-    virtual uint32_t GetRcvBufSize (void) const = 0;
-
-    /**
-     * \brief Set the receive buffer size.
-     * \param rcvBufSize size to set
-     */
-    virtual void SetRcvBufSize (uint32_t rcvBufSize) = 0;
-
-    /* FIXME : add ICMP basic attribute for socket */
-    /* Indirect the attribute setting and getting through private virtual methods */
-};
-
-} /* namespace ns3 */
-
-#endif /* ICMP_SOCKET_H */
-
--- a/src/node/wscript	Wed Nov 26 14:00:05 2008 -0800
+++ b/src/node/wscript	Fri Nov 28 14:24:09 2008 +0100
@@ -37,7 +37,6 @@
         'inet6-socket-address.cc',
         'ipv6-address.cc',
         'ipv6-header.cc',
-        'icmp-socket.cc',
         'ipv4-raw-socket-factory.cc',
         ]
 
@@ -77,6 +76,5 @@
         'inet6-socket-address.h',
         'ipv6-address.h',
         'ipv6-header.h',
-        'icmp-socket.h',
         'ipv4-raw-socket-factory.h',
         ]