Packet *p_in = p->clone(); WritablePacket *p_in = p->uniqueify(); Anyway you can change the content and header.
I'm a beginner. 2011/5/5 <[email protected]> > Send click mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > https://amsterdam.lcs.mit.edu/mailman/listinfo/click > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of click digest..." > > > Today's Topics: > > 1. changing both data and header (Jessica Shahper) > 2. changing both data and header (Jessica Shahper) > 3. Re: changing both data and header (Eddie Kohler) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 4 May 2011 12:50:45 +0100 (BST) > From: Jessica Shahper <[email protected]> > Subject: [Click] changing both data and header > To: [email protected] > Cc: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > Hi all! > > I want to change the packet data and place some indication about that > change in > the header data, but click does not allow simultaneous change in the packet > data > and the packet header since it has to be either Packet or WritablePacket?, > would > it be a good way if I declare the packets as writable packets first and > encode > the contents?and then change them to Packets before embedding the > information in > the header?? > > Regards, > Jessica > > ------------------------------ > > Message: 2 > Date: Wed, 4 May 2011 12:50:45 +0100 (BST) > From: Jessica Shahper <[email protected]> > Subject: [Click] changing both data and header > To: [email protected] > Cc: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > Hi all! > > I want to change the packet data and place some indication about that > change in > the header data, but click does not allow simultaneous change in the packet > data > and the packet header since it has to be either Packet or WritablePacket?, > would > it be a good way if I declare the packets as writable packets first and > encode > the contents?and then change them to Packets before embedding the > information in > the header?? > > Regards, > Jessica > > ------------------------------ > > Message: 3 > Date: Wed, 04 May 2011 06:02:01 -0700 > From: Eddie Kohler <[email protected]> > Subject: Re: [Click] changing both data and header > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi Jessica, > > That's a misunderstanding: a WritablePacket is a type of Packet, so all the > header changes you want can be made to the WritablePacket (which you get by > calling uniqueify()). > > Eddie > > > On 05/04/2011 04:50 AM, Jessica Shahper wrote: > > Hi all! > > > > I want to change the packet data and place some indication about that > change in > > the header data, but click does not allow simultaneous change in the > packet data > > and the packet header since it has to be either Packet or WritablePacket > , would > > it be a good way if I declare the packets as writable packets first and > encode > > the contents and then change them to Packets before embedding the > information in > > the header? > > > > Regards, > > Jessica > > _______________________________________________ > > click mailing list > > [email protected] > > https://amsterdam.lcs.mit.edu/mailman/listinfo/click > > > ------------------------------ > > _______________________________________________ > click mailing list > [email protected] > https://amsterdam.lcs.mit.edu/mailman/listinfo/click > > > End of click Digest, Vol 95, Issue 4 > ************************************ > -- --------------------- 孙士民 _______________________________________________ click mailing list [email protected] https://amsterdam.lcs.mit.edu/mailman/listinfo/click
