A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
radvd.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 Telecom Bretagne
4  * Copyright (c) 2009 Strasbourg University
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
20  * Mehdi Benamor <benamor.mehdi@ensi.rnu.tn>
21  */
22 
23 #ifndef RADVD_H
24 #define RADVD_H
25 
26 #include <map>
27 
28 #include "ns3/application.h"
29 #include "ns3/socket.h"
30 #include "ns3/random-variable-stream.h"
31 
32 #include "radvd-interface.h"
33 
34 namespace ns3
35 {
36 
47 class Radvd : public Application
48 {
49 public:
54  static TypeId GetTypeId (void);
55 
59  Radvd ();
60 
64  virtual ~Radvd ();
65 
69  static const uint32_t MAX_RA_DELAY_TIME = 500;
70 
75  void AddConfiguration (Ptr<RadvdInterface> routerInterface);
76 
85  int64_t AssignStreams (int64_t stream);
86 
87 protected:
91  virtual void DoDispose ();
92 
93 private:
94  typedef std::list<Ptr<RadvdInterface> > RadvdInterfaceList;
95  typedef std::list<Ptr<RadvdInterface> >::iterator RadvdInterfaceListI;
96  typedef std::list<Ptr<RadvdInterface> >::const_iterator RadvdInterfaceListCI;
97 
98  typedef std::map<uint32_t, EventId> EventIdMap;
99  typedef std::map<uint32_t, EventId>::iterator EventIdMapI;
100  typedef std::map<uint32_t, EventId>::const_iterator EventIdMapCI;
101 
105  virtual void StartApplication ();
106 
110  virtual void StopApplication ();
111 
120  void ScheduleTransmit (Time dt, Ptr<RadvdInterface> config, EventId& eventId, Ipv6Address dst = Ipv6Address::GetAllNodesMulticast (), bool reschedule = false);
121 
128  void Send (Ptr<RadvdInterface> config, Ipv6Address dst = Ipv6Address::GetAllNodesMulticast (), bool reschedule = false);
129 
134  void HandleRead (Ptr<Socket> socket);
135 
140 
145 
150 
155 };
156 
157 } /* namespace ns3 */
158 
159 #endif /* RADVD_H */
160