A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv6-routing-protocol.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 /* taken from src/node/ipv4-routing-protocol.h and adapted to IPv6 */
20 
21 #ifndef IPV6_ROUTING_PROTOCOL_H
22 #define IPV6_ROUTING_PROTOCOL_H
23 
24 #include "ns3/packet.h"
25 #include "ns3/callback.h"
26 #include "ns3/object.h"
27 #include "ns3/socket.h"
28 
29 #include "ipv6-header.h"
30 #include "ipv6-interface-address.h"
31 #include "ipv6.h"
32 #include "ns3/output-stream-wrapper.h"
33 
34 namespace ns3 {
35 
36 class Ipv6MulticastRoute;
37 class Ipv6Route;
38 class NetDevice;
39 
55 {
56 public:
61  static TypeId GetTypeId (void);
62 
65 
68 
71 
74 
91  virtual Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) = 0;
92 
114  virtual bool RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev,
116  LocalDeliverCallback lcb, ErrorCallback ecb) = 0;
117 
125  virtual void NotifyInterfaceUp (uint32_t interface) = 0;
126 
134  virtual void NotifyInterfaceDown (uint32_t interface) = 0;
135 
145  virtual void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) = 0;
146 
156  virtual void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) = 0;
157 
169  virtual void NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ()) = 0;
170 
179  virtual void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ()) = 0;
180 
185  virtual void SetIpv6 (Ptr<Ipv6> ipv6) = 0;
186 
192  virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const = 0;
193 };
194 
195 } // namespace ns3
196 
197 #endif /* IPV6_ROUTING_PROTOCOL_H */
198 
virtual Ptr< Ipv6Route > RouteOutput(Ptr< Packet > p, const Ipv6Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)=0
Query routing cache for an existing route, for an outbound packet.
Doxygen introspection did not find any typical Config paths.
Definition: ipv6-header.h:33
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
Callback template class.
Definition: callback.h:920
virtual void NotifyAddAddress(uint32_t interface, Ipv6InterfaceAddress address)=0
Notify when specified interface add an address.
virtual void SetIpv6(Ptr< Ipv6 > ipv6)=0
Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.
IPv6 address associated with an interface.
SocketErrno
Enumeration of the possible errors returned by a socket.
Definition: socket.h:82
Callback< void, Ptr< const NetDevice >, Ptr< Ipv6Route >, Ptr< const Packet >, const Ipv6Header & > UnicastForwardCallback
Callback for unicast packets to be forwarded.
Callback< void, Ptr< const Packet >, const Ipv6Header &, Socket::SocketErrno > ErrorCallback
Callback for routing errors (e.g., no route found)
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
virtual void NotifyInterfaceDown(uint32_t interface)=0
Notify when specified interface goes DOWN.
virtual void NotifyInterfaceUp(uint32_t interface)=0
Notify when specified interface goes UP.
Describes an IPv6 address.
Definition: ipv6-address.h:46
Callback< void, Ptr< const Packet >, const Ipv6Header &, uint32_t > LocalDeliverCallback
Callback for packets to be locally delivered.
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream) const =0
Print the Routing Table entries.
Callback< void, Ptr< const NetDevice >, Ptr< Ipv6MulticastRoute >, Ptr< const Packet >, const Ipv6Header & > MulticastForwardCallback
Callback for multicast packets to be forwarded.
virtual void NotifyAddRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero())=0
Notify a new route.
Describes an IPv6 prefix.
Definition: ipv6-address.h:387
virtual void NotifyRemoveRoute(Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address::GetZero())=0
Notify route removing.
a base class which provides memory management and object aggregation
Definition: object.h:63
tuple address
Definition: first.py:37
Abstract base class for Ipv6 routing protocols.
virtual void NotifyRemoveAddress(uint32_t interface, Ipv6InterfaceAddress address)=0
Notify when specified interface add an address.
a unique identifier for an interface.
Definition: type-id.h:49
static TypeId GetTypeId(void)
Get the type ID.
virtual bool RouteInput(Ptr< const Packet > p, const Ipv6Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)=0
Route an input packet (to be forwarded or locally delivered)