A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
dsr-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Yufei Cheng
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Yufei Cheng <yfcheng@ittc.ku.edu>
18 *
19 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
20 * ResiliNets Research Group https://resilinets.org/
21 * Information and Telecommunication Technology Center (ITTC)
22 * and Department of Electrical Engineering and Computer Science
23 * The University of Kansas Lawrence, KS USA.
24 *
25 * Work supported in part by NSF FIND (Future Internet Design) Program
26 * under grant CNS-0626918 (Postmodern Internet Architecture),
27 * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
28 * US Department of Defense (DoD), and ITTC at The University of Kansas.
29 */
30
31#ifndef DSR_HELPER_H
32#define DSR_HELPER_H
33
34#include "ns3/dsr-routing.h"
35#include "ns3/icmpv4-l4-protocol.h"
36#include "ns3/node-container.h"
37#include "ns3/node.h"
38#include "ns3/object-factory.h"
39#include "ns3/tcp-l4-protocol.h"
40#include "ns3/udp-l4-protocol.h"
41
42namespace ns3
43{
44
45/**
46 * \ingroup dsr
47 *
48 * \brief DSR helper class to manage creation of DSR routing instance and
49 * to insert it on a node as a sublayer between transport and
50 * IP layers.
51 */
53{
54 public:
55 /**
56 * Create an DsrHelper that makes life easier for people who want to install
57 * Dsr routing to nodes.
58 */
59 DsrHelper();
60 ~DsrHelper();
61
62 // Delete assignment operator to avoid misuse
63 DsrHelper& operator=(const DsrHelper&) = delete;
64
65 /**
66 * \brief Construct an DsrHelper from another previously initialized instance
67 * (Copy Constructor).
68 * \param o object to copy from
69 */
70 DsrHelper(const DsrHelper& o);
71 /**
72 * \returns pointer to clone of this DsrHelper
73 *
74 * This method is mainly for internal use by the other helpers;
75 * clients are expected to free the dynamic memory allocated by this method
76 */
77 DsrHelper* Copy() const;
78 /**
79 * \param node the node on which the routing protocol will run
80 * \returns a newly-created L4 protocol
81 */
83 /**
84 * Set attribute values for future instances of DSR that this helper creates
85 * \param name the node on which the routing protocol will run
86 * \param value newly-created L4 protocol
87 */
88 void Set(std::string name, const AttributeValue& value);
89
90 private:
91 ObjectFactory m_agentFactory; ///< DSR factory
92};
93
94} // namespace ns3
95
96#endif // DSR_HELPER_H
Hold a value for an Attribute.
Definition: attribute.h:70
DSR helper class to manage creation of DSR routing instance and to insert it on a node as a sublayer ...
Definition: dsr-helper.h:53
ObjectFactory m_agentFactory
DSR factory.
Definition: dsr-helper.h:91
DsrHelper * Copy() const
Definition: dsr-helper.cc:69
Ptr< ns3::dsr::DsrRouting > Create(Ptr< Node > node) const
Definition: dsr-helper.cc:76
DsrHelper & operator=(const DsrHelper &)=delete
DsrHelper()
Create an DsrHelper that makes life easier for people who want to install Dsr routing to nodes.
Definition: dsr-helper.cc:51
void Set(std::string name, const AttributeValue &value)
Set attribute values for future instances of DSR that this helper creates.
Definition: dsr-helper.cc:93
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Every class exported by the ns3 library is enclosed in the ns3 namespace.