A Discrete-Event Network Simulator
API
ipv6-pmtu-cache.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Universita' di Firenze
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19  */
20 
21 #ifndef IPV6_PMTU_CACHE_H
22 #define IPV6_PMTU_CACHE_H
23 
24 #include <map>
25 
26 #include "ns3/object.h"
27 #include "ns3/nstime.h"
28 #include "ns3/type-id.h"
29 #include "ns3/event-id.h"
30 #include "ns3/ipv6-address.h"
31 
32 namespace ns3 {
33 
47 class Ipv6PmtuCache : public Object
48 {
49 public:
50  class Entry;
51 
56  static TypeId GetTypeId ();
57 
61  Ipv6PmtuCache ();
62 
66  ~Ipv6PmtuCache ();
67 
71  virtual void DoDispose ();
72 
78  uint32_t GetPmtu (Ipv6Address dst);
79 
85  void SetPmtu (Ipv6Address dst, uint32_t pmtu);
86 
91  Time GetPmtuValidityTime () const;
92 
98  bool SetPmtuValidityTime (Time validity);
99 
100 private:
105  void ClearPmtu (Ipv6Address dst);
106 
110  std::map<Ipv6Address, uint32_t> m_pathMtu;
111 
115  typedef std::map<Ipv6Address, EventId>::iterator pathMtuTimerIter;
116 
120  std::map<Ipv6Address, EventId> m_pathMtuTimer;
121 
126 };
127 
128 }
129 
130 #endif /* IPV6_PMTU_CACHE_H */
Describes an IPv6 address.
Definition: ipv6-address.h:50
This class implements the Path MTU cache, as defined by RFC 1981.
std::map< Ipv6Address, uint32_t > m_pathMtu
Path MTU table.
std::map< Ipv6Address, EventId >::iterator pathMtuTimerIter
Container of the IPv6 PMTU data (Ipv6 destination address and expiration event).
void ClearPmtu(Ipv6Address dst)
Clears the Path MTU for the specific destination.
Ipv6PmtuCache()
Constructor.
std::map< Ipv6Address, EventId > m_pathMtuTimer
Path MTU Expiration table.
~Ipv6PmtuCache()
Destructor.
static TypeId GetTypeId()
Get the type ID.
Time GetPmtuValidityTime() const
Gets the Path MTU validity time.
Time m_validityTime
Path MTU entry validity time.
uint32_t GetPmtu(Ipv6Address dst)
Gets the known Path MTU for the specific destination.
virtual void DoDispose()
Dispose object.
bool SetPmtuValidityTime(Time validity)
Sets the Path MTU validity time (minimum is 5 minutes)
void SetPmtu(Ipv6Address dst, uint32_t pmtu)
Sets the Path MTU for the specific destination.
A base class which provides memory management and object aggregation.
Definition: object.h:88
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.