A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
radvd-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 Universita' di Firenze
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: Tommaso Pecorella <tommaso.pecorella@unifi.it>
18 */
19
20#ifndef RADVD_HELPER_H
21#define RADVD_HELPER_H
22
23#include "ns3/radvd-interface.h"
24#include <ns3/application-helper.h>
25
26#include <map>
27#include <stdint.h>
28
29namespace ns3
30{
31
32/**
33 * \ingroup radvd
34 * \brief Radvd application helper.
35 */
37{
38 public:
39 /**
40 * \brief Constructor.
41 */
43
44 /**
45 * \brief Add a new prefix to be announced through an interface.
46 * \param interface outgoing interface
47 * \param prefix announced IPv6 prefix
48 * \param prefixLength announced IPv6 prefix length
49 */
50 void AddAnnouncedPrefix(uint32_t interface, const Ipv6Address& prefix, uint32_t prefixLength);
51
52 /**
53 * \brief Enable the router as default router for the interface.
54 * The effect is to set the Router Lifetime to the default value (30 minutes)
55 * \param interface outgoing interface
56 */
58
59 /**
60 * \brief Disable the router as default router for the interface.
61 * The effect is to set the Router Lifetime to zero
62 * \param interface outgoing interface
63 */
65
66 /**
67 * \brief Get the low-level RadvdInterface specification for an interface.
68 * This method is provided to enable fine-grain parameter setup.
69 * \param interface outgoing interface
70 * \returns the RadvdInterface
71 */
73
74 /**
75 * \brief Clear the stored Prefixes
76 */
77 void ClearPrefixes();
78
79 private:
81
82 /// Container: interface index, RadvdInterface
83 typedef std::map<uint32_t, Ptr<RadvdInterface>> RadvdInterfaceMap;
84 /// Container Iterator: interface index, RadvdInterface
85 typedef std::map<uint32_t, Ptr<RadvdInterface>>::iterator RadvdInterfaceMapI;
86
87 RadvdInterfaceMap m_radvdInterfaces; //!< RadvdInterface(s)
88};
89
90} /* namespace ns3 */
91
92#endif /* RADVD_HELPER_H */
A helper to make it easier to instantiate an application on a set of nodes.
Describes an IPv6 address.
Definition: ipv6-address.h:49
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Radvd application helper.
Definition: radvd-helper.h:37
std::map< uint32_t, Ptr< RadvdInterface > >::iterator RadvdInterfaceMapI
Container Iterator: interface index, RadvdInterface.
Definition: radvd-helper.h:85
void EnableDefaultRouterForInterface(uint32_t interface)
Enable the router as default router for the interface.
Definition: radvd-helper.cc:78
void AddAnnouncedPrefix(uint32_t interface, const Ipv6Address &prefix, uint32_t prefixLength)
Add a new prefix to be announced through an interface.
Definition: radvd-helper.cc:39
RadvdHelper()
Constructor.
Definition: radvd-helper.cc:33
void DisableDefaultRouterForInterface(uint32_t interface)
Disable the router as default router for the interface.
Definition: radvd-helper.cc:89
std::map< uint32_t, Ptr< RadvdInterface > > RadvdInterfaceMap
Container: interface index, RadvdInterface.
Definition: radvd-helper.h:83
RadvdInterfaceMap m_radvdInterfaces
RadvdInterface(s)
Definition: radvd-helper.h:87
Ptr< Application > DoInstall(Ptr< Node > node) override
Install an application on the node configured with all the attributes set with SetAttribute.
Ptr< RadvdInterface > GetRadvdInterface(uint32_t interface)
Get the low-level RadvdInterface specification for an interface.
Definition: radvd-helper.cc:99
void ClearPrefixes()
Clear the stored Prefixes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.