OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2010 Andrey Churin |
| 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: Andrey Churin <aachurin@gmail.com> |
| 19 */ |
| 20 |
| 21 #ifndef IPV4_TO_MPLS_ROUTING_PROTOCOL_H |
| 22 #define IPV4_TO_MPLS_ROUTING_PROTOCOL_H |
| 23 |
| 24 #include "ns3/ptr.h" |
| 25 #include "ns3/net-device.h" |
| 26 #include "ns3/packet.h" |
| 27 #include "ns3/ipv4.h" |
| 28 #include "ns3/ipv4-address.h" |
| 29 #include "ns3/ipv4-header.h" |
| 30 #include "ns3/ipv4-route.h" |
| 31 #include "ns3/ipv4-interface-address.h" |
| 32 #include "ns3/ipv4-routing-protocol.h" |
| 33 #include "ns3/socket.h" |
| 34 |
| 35 #include "mpls-routing-protocol.h" |
| 36 |
| 37 namespace ns3 { |
| 38 namespace mpls { |
| 39 |
| 40 class Ipv4ToMplsRoutingProtocol : public Ipv4RoutingProtocol |
| 41 { |
| 42 public: |
| 43 static TypeId GetTypeId (void); |
| 44 |
| 45 Ipv4ToMplsRoutingProtocol (); |
| 46 virtual ~Ipv4ToMplsRoutingProtocol (); |
| 47 |
| 48 virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, |
| 49 Ptr<NetDevice> oif, Socket::SocketErrno &s
ockerr); |
| 50 |
| 51 virtual bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<co
nst NetDevice> idev, |
| 52 UnicastForwardCallback ucb, MulticastForwardCallback
mcb, |
| 53 LocalDeliverCallback lcb, ErrorCallback ecb); |
| 54 |
| 55 virtual void NotifyInterfaceUp (uint32_t interface); |
| 56 virtual void NotifyInterfaceDown (uint32_t interface); |
| 57 virtual void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress addres
s); |
| 58 virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress add
ress); |
| 59 |
| 60 virtual void SetIpv4 (Ptr<Ipv4> ipv4); |
| 61 virtual void SetMpls (Ptr<MplsRoutingProtocol> mpls); |
| 62 |
| 63 // set underlying ipv4 routing protocol |
| 64 void SetRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol); |
| 65 // get underlying ipv4 routing protocol |
| 66 Ptr<Ipv4RoutingProtocol> GetRoutingProtocol (void) const; |
| 67 |
| 68 protected: |
| 69 virtual void DoDispose (void); |
| 70 |
| 71 private: |
| 72 Ptr<Ipv4> m_ipv4; |
| 73 Ptr<MplsRoutingProtocol> m_mpls; |
| 74 Ptr<Ipv4RoutingProtocol> m_routingProtocol; |
| 75 |
| 76 }; |
| 77 |
| 78 } // namespace mpls |
| 79 } // namespace ns3 |
| 80 |
| 81 #endif /* IPV4_TO_MPLS_ROUTING_PROTOCOL_H */ |
OLD | NEW |