00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * This program is free software; you can redistribute it and/or modify 00004 * it under the terms of the GNU General Public License version 2 as 00005 * published by the Free Software Foundation; 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 */ 00016 #ifndef NSC_TCP_SOCKET_FACTORY_IMPL_H 00017 #define NSC_TCP_SOCKET_FACTORY_IMPL_H 00018 00019 #include "ns3/tcp-socket-factory.h" 00020 #include "ns3/ptr.h" 00021 00022 namespace ns3 { 00023 00024 class NscTcpL4Protocol; 00025 00026 /** 00027 * \ingroup internetStack 00028 * \defgroup nsctcp NscTcp 00029 * 00030 * An alternate implementation of TCP for ns-3 is provided by the 00031 * Network Simulation Cradle (NSC) project. NSC is a separately linked 00032 * library that provides ported TCP stacks from popular operating systems 00033 * such as Linux and FreeBSD. Glue code such as the ns-3 NSC code 00034 * allows users to delegate Internet stack processing to the logic 00035 * from these operating systems. This allows a user to reproduce 00036 * with high fidelity the behavior of a real TCP stack. 00037 */ 00038 00039 /** 00040 * \ingroup nsctcp 00041 * 00042 * \brief socket factory implementation for creating instances of NSC TCP 00043 */ 00044 class NscTcpSocketFactoryImpl : public TcpSocketFactory 00045 { 00046 public: 00047 NscTcpSocketFactoryImpl (); 00048 virtual ~NscTcpSocketFactoryImpl (); 00049 00050 void SetTcp (Ptr<NscTcpL4Protocol> tcp); 00051 00052 virtual Ptr<Socket> CreateSocket (void); 00053 00054 protected: 00055 virtual void DoDispose (void); 00056 private: 00057 Ptr<NscTcpL4Protocol> m_tcp; 00058 }; 00059 00060 } // namespace ns3 00061 00062 #endif /* NSC_TCP_SOCKET_FACTORY_IMPL_H */