author | tjkopena@cs.drexel.edu |
Fri, 29 Aug 2008 13:22:09 -0400 | |
changeset 3570 | 44b0bc6817c6 |
parent 3183 | fc3b2e03e61e |
permissions | -rw-r--r-- |
619
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2007 INRIA |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
747
65afca7824d7
i-socket-factory.h -> socket-factory.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
710
diff
changeset
|
20 |
#ifndef SOCKET_FACTORY_H |
65afca7824d7
i-socket-factory.h -> socket-factory.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
710
diff
changeset
|
21 |
#define SOCKET_FACTORY_H |
619
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
710
2a9c061219a7
port code from Interface to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
619
diff
changeset
|
23 |
#include "ns3/object.h" |
619
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include "ns3/ptr.h" |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
|
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
namespace ns3 { |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
class Socket; |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
|
2179
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
30 |
/** |
3183 | 31 |
* \ingroup socket |
32 |
* |
|
2179
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
33 |
* \brief Object to create transport layer instances that provide a |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
34 |
* socket API to applications. |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
35 |
* |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
36 |
* This base class defines the API for creating sockets. |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
37 |
* The socket factory also can hold the global variables used to |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
38 |
* initialize newly created sockets, such as values that are |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
39 |
* set through the sysctl or proc interfaces in Linux. |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
40 |
|
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
41 |
* If you want to write a new transport protocol accessible through |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
42 |
* sockets, you need to subclass this factory class, implement CreateSocket, |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
43 |
* instantiate the object, and aggregate it to the node. |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
44 |
* |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
45 |
* \see Udp |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
46 |
* \see UdpImpl |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
47 |
*/ |
748
381b884929c4
ISocketFactory -> SocketFactory
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
747
diff
changeset
|
48 |
class SocketFactory : public Object |
619
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
49 |
{ |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
50 |
public: |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
51 |
static TypeId GetTypeId (void); |
619
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
52 |
|
748
381b884929c4
ISocketFactory -> SocketFactory
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
747
diff
changeset
|
53 |
SocketFactory (); |
619
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
54 |
|
2179
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
55 |
/** |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
56 |
* \return smart pointer to Socket |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
57 |
* |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
58 |
* Base class method for creating socket instances. |
9b58bef0a7ff
Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents:
748
diff
changeset
|
59 |
*/ |
619
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
60 |
virtual Ptr<Socket> CreateSocket (void) = 0; |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
61 |
}; |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
62 |
|
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
63 |
} // namespace ns3 |
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
64 |
|
528f0554b677
make OnOffApplication not depend on IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
65 |
|
747
65afca7824d7
i-socket-factory.h -> socket-factory.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
710
diff
changeset
|
66 |
#endif /* SOCKET_FACTORY_H */ |