Bugzilla – Bug 932
Support IP_HDRINCL option for Ipv4RawSocket
Last modified: 2012-03-17 19:39:55 UTC
Created attachment 905 [details] support IP_HDRINCL option into ipv4 raw socket This patch support IP_HDRINCL socket option for ipv4 raw socket. Users can specify IPv4 header by themselves, without depending on the network stack. It will introduce - New attribute "IpHeaderInclude" into Ipv4RawSocketImpl - new method Ipv4L3Protocol::Send (Ptr<Packet> packet, Ipv4Header ipHeader, Ptr<Ipv4Route> route); to support this.
> > void > Ipv4L3Protocol::Send (Ptr<Packet> packet, > + Ipv4Header ipHeader, > + Ptr<Ipv4Route> route) > +{ > + NS_LOG_FUNCTION (this << packet << ipHeader << route); > + Ipv4Header hdr; > + packet->RemoveHeader (hdr); > + SendRealOut (route, packet, hdr); ^^^^ ipHeader? > +} > + > +void > +Ipv4L3Protocol::Send (Ptr<Packet> packet, > Ipv4Address source, > Ipv4Address destination, > uint8_t protocol, > diff -r 74fab02c0751 src/internet-stack/ipv4-l3-protocol.h > --- a/src/internet-stack/ipv4-l3-protocol.h Tue Jun 01 10:45:08 2010 +0900 > +++ b/src/internet-stack/ipv4-l3-protocol.h Tue Jun 01 13:27:37 2010 +0900 > @@ -162,6 +162,15 @@ > */ > void Send (Ptr<Packet> packet, Ipv4Address source, > Ipv4Address destination, uint8_t protocol, Ptr<Ipv4Route> route); > + /** > + * \param packet packet to send > + * \param ipHeader IP Heeader ^^^^^^ Header (typo) Otherwise, I am fine with the patch.
(In reply to comment #1) > > > > void > > Ipv4L3Protocol::Send (Ptr<Packet> packet, > > + Ipv4Header ipHeader, > > + Ptr<Ipv4Route> route) > > +{ > > + NS_LOG_FUNCTION (this << packet << ipHeader << route); > > + Ipv4Header hdr; > > + packet->RemoveHeader (hdr); > > + SendRealOut (route, packet, hdr); > ^^^^ > ipHeader? Modified. > > +} > > + > > +void > > +Ipv4L3Protocol::Send (Ptr<Packet> packet, > > Ipv4Address source, > > Ipv4Address destination, > > uint8_t protocol, > > diff -r 74fab02c0751 src/internet-stack/ipv4-l3-protocol.h > > --- a/src/internet-stack/ipv4-l3-protocol.h Tue Jun 01 10:45:08 2010 +0900 > > +++ b/src/internet-stack/ipv4-l3-protocol.h Tue Jun 01 13:27:37 2010 +0900 > > @@ -162,6 +162,15 @@ > > */ > > void Send (Ptr<Packet> packet, Ipv4Address source, > > Ipv4Address destination, uint8_t protocol, Ptr<Ipv4Route> route); > > + /** > > + * \param packet packet to send > > + * \param ipHeader IP Heeader > ^^^^^^ > Header (typo) > > Otherwise, I am fine with the patch. thanks. pushed into ns-3-dev. changeset 6334 c9373f264dfe
(In reply to comment #2) > pushed into ns-3-dev. > changeset 6334 c9373f264dfe I'm sorry, I had mistaken to apply a patch. #Using mercurial queue across several branches makes me bad..... I've pushed again. http://code.nsnam.org/ns-3-dev/rev/464e8093700d changeset 6336 464e8093700d