A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv6-list-routing.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 University of Washington
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 
19 #ifndef IPV6_LIST_ROUTING_H
20 #define IPV6_LIST_ROUTING_H
21 
22 #include <list>
23 #include "ns3/ipv6-routing-protocol.h"
24 
25 namespace ns3 {
26 
48 {
49 public:
54  static TypeId GetTypeId (void);
55 
59  Ipv6ListRouting ();
60 
64  virtual ~Ipv6ListRouting ();
65 
72  virtual void AddRoutingProtocol (Ptr<Ipv6RoutingProtocol> routingProtocol, int16_t priority);
73 
78  virtual uint32_t GetNRoutingProtocols (void) const;
79 
91  virtual Ptr<Ipv6RoutingProtocol> GetRoutingProtocol (uint32_t index, int16_t& priority) const;
92 
93  // Below are from Ipv6RoutingProtocol
94  virtual Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr);
95 
96  virtual bool RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev,
99  virtual void NotifyInterfaceUp (uint32_t interface);
100  virtual void NotifyInterfaceDown (uint32_t interface);
101  virtual void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address);
102  virtual void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address);
103  virtual void NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ());
104  virtual void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ());
105  virtual void SetIpv6 (Ptr<Ipv6> ipv6);
106 
112  virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const;
113 
114 protected:
118  virtual void DoDispose (void);
119 
120 private:
121  typedef std::pair<int16_t, Ptr<Ipv6RoutingProtocol> > Ipv6RoutingProtocolEntry;
122  typedef std::list<Ipv6RoutingProtocolEntry> Ipv6RoutingProtocolList;
123 
130  static bool Compare (const Ipv6RoutingProtocolEntry& a, const Ipv6RoutingProtocolEntry& b);
131 
136 
141 };
142 
143 } // namespace ns3
144 
145 #endif /* IPV6_LIST_ROUTING_H */
146