Patches to allow modifying packets when the packets are being routed. diff -r c000fa32b2bf src/node/ipv4-routing-protocol.h --- a/src/node/ipv4-routing-protocol.h Mon Jul 06 12:09:48 2009 +0800 +++ b/src/node/ipv4-routing-protocol.h Mon Jul 06 12:58:12 2009 +0800 @@ -92,7 +92,7 @@ * \returns true if the Ipv4RoutingProtocol takes responsibility for * forwarding or delivering the packet, false otherwise */ - virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) = 0; diff -r c000fa32b2bf src/routing/global-routing/ipv4-global-routing.cc --- a/src/routing/global-routing/ipv4-global-routing.cc Mon Jul 06 12:09:48 2009 +0800 +++ b/src/routing/global-routing/ipv4-global-routing.cc Mon Jul 06 12:58:12 2009 +0800 @@ -288,7 +288,7 @@ } bool -Ipv4GlobalRouting::RouteInput (Ptr p, const Ipv4Header &ipHeader, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, +Ipv4GlobalRouting::RouteInput (Ptr p, const Ipv4Header &ipHeader, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) { diff -r c000fa32b2bf src/routing/global-routing/ipv4-global-routing.h --- a/src/routing/global-routing/ipv4-global-routing.h Mon Jul 06 12:09:48 2009 +0800 +++ b/src/routing/global-routing/ipv4-global-routing.h Mon Jul 06 12:58:12 2009 +0800 @@ -82,7 +82,7 @@ virtual Ptr RouteOutput (Ptr p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr); - virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb); virtual void NotifyInterfaceUp (uint32_t interface); diff -r c000fa32b2bf src/routing/list-routing/ipv4-list-routing.cc --- a/src/routing/list-routing/ipv4-list-routing.cc Mon Jul 06 12:09:48 2009 +0800 +++ b/src/routing/list-routing/ipv4-list-routing.cc Mon Jul 06 12:58:12 2009 +0800 @@ -95,7 +95,7 @@ // Patterned after Linux ip_route_input and ip_route_input_slow bool -Ipv4ListRouting::RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, +Ipv4ListRouting::RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) { @@ -324,7 +324,7 @@ class Ipv4ARouting : public Ipv4RoutingProtocol { public: Ptr RouteOutput (Ptr p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr) { return 0;} - bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) {return false;} void NotifyInterfaceUp (uint32_t interface) {} @@ -337,7 +337,7 @@ class Ipv4BRouting : public Ipv4RoutingProtocol { public: Ptr RouteOutput (Ptr p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr) { return 0;} - bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) {return false;} void NotifyInterfaceUp (uint32_t interface) {} diff -r c000fa32b2bf src/routing/list-routing/ipv4-list-routing.h --- a/src/routing/list-routing/ipv4-list-routing.h Mon Jul 06 12:09:48 2009 +0800 +++ b/src/routing/list-routing/ipv4-list-routing.h Mon Jul 06 12:58:12 2009 +0800 @@ -73,7 +73,7 @@ // Below are from Ipv4RoutingProtocol virtual Ptr RouteOutput (Ptr p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr); - virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb); virtual void NotifyInterfaceUp (uint32_t interface); diff -r c000fa32b2bf src/routing/olsr/olsr-routing-protocol.cc --- a/src/routing/olsr/olsr-routing-protocol.cc Mon Jul 06 12:09:48 2009 +0800 +++ b/src/routing/olsr/olsr-routing-protocol.cc Mon Jul 06 12:58:12 2009 +0800 @@ -2598,7 +2598,7 @@ return rtentry; } -bool RoutingProtocol::RouteInput (Ptr p, +bool RoutingProtocol::RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) { diff -r c000fa32b2bf src/routing/olsr/olsr-routing-protocol.h --- a/src/routing/olsr/olsr-routing-protocol.h Mon Jul 06 12:09:48 2009 +0800 +++ b/src/routing/olsr/olsr-routing-protocol.h Mon Jul 06 12:58:12 2009 +0800 @@ -120,7 +120,7 @@ // From Ipv4RoutingProtocol virtual Ptr RouteOutput (Ptr p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr); - virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb); virtual void NotifyInterfaceUp (uint32_t interface); diff -r c000fa32b2bf src/routing/static-routing/ipv4-static-routing.cc --- a/src/routing/static-routing/ipv4-static-routing.cc Mon Jul 06 12:09:48 2009 +0800 +++ b/src/routing/static-routing/ipv4-static-routing.cc Mon Jul 06 12:58:12 2009 +0800 @@ -469,7 +469,7 @@ // XXX this method not robust enough to work outside of ListRouting context // because it will not perform local delivery bool -Ipv4StaticRouting::RouteInput (Ptr p, const Ipv4Header &ipHeader, Ptr idev, +Ipv4StaticRouting::RouteInput (Ptr p, const Ipv4Header &ipHeader, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) { diff -r c000fa32b2bf src/routing/static-routing/ipv4-static-routing.h --- a/src/routing/static-routing/ipv4-static-routing.h Mon Jul 06 12:09:48 2009 +0800 +++ b/src/routing/static-routing/ipv4-static-routing.h Mon Jul 06 12:58:12 2009 +0800 @@ -72,7 +72,7 @@ virtual Ptr RouteOutput (Ptr p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr); - virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, + virtual bool RouteInput (Ptr p, const Ipv4Header &header, Ptr idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb);