I am doing a tag-based routing. My attempt is to add a tag to a packet
in
Ipv4RoutingProtocol::RouteOutput (), and the tag is read and modified
by
Ipv4RoutingProtocol::RouteInput () in all the subsequence hops the
packet is
traversing.
However, several issues prevent this from happening.
- Ipv4RoutingProtocol::RouteInput () receives Ptr<const Packet> as its
input
argument. This prevents me from using Packet::RemovePacketTag () to
remove the
original tag and add back a modified tag into the packet.
- Packet::PeekPacketTag (Tag &tag) only copies the tag to its output
argument,
instead of returning the reference to the actually tag. Thus, any
changes to
the "peeked" tag has no effect to the actual tag that is being
"peeked".
On Sun, 2009-07-05 at 05:45 -0700, Wilson Thong wrote: > - Packet::PeekPacketTag (Tag &tag) only copies the tag to its output > argument, > instead of returning the reference to the actually tag. Thus, any > changes to > the "peeked" tag has no effect to the actual tag that is being > "peeked".
Yes, this is on purpose: PeekPacketTag creates a copy of the tag. I guess that the real problem for you is that RouteInput should take a non-const packet pointer.
On Jul 5, 4:02 pm, Mathieu Lacage <mathieu.lac...@sophia.inria.fr>
wrote:
> Yes, this is on purpose: PeekPacketTag creates a copy of the tag. I
> guess that the real problem for you is that RouteInput should take a
> non-const packet pointer.
> > Yes, this is on purpose: PeekPacketTag creates a copy of the tag. I
> > guess that the real problem for you is that RouteInput should take a
> > non-const packet pointer.
> > > Yes, this is on purpose: PeekPacketTag creates a copy of the tag. I
> > > guess that the real problem for you is that RouteInput should take a
> > > non-const packet pointer.
> > > > Yes, this is on purpose: PeekPacketTag creates a copy of the tag. I
> > > > guess that the real problem for you is that RouteInput should take a
> > > > non-const packet pointer.