Rajesh
Tue Jul 20 16:08:53 CDT 2004
Thanks everyone.
I was having problem with NDIS Task Offload. It works now.
Thanks everyone, if someone has the same problem, hope it helps.
"Rajesh Gupta" <guptar@gmail.com> wrote in message
news:eiEtv5nbEHA.2940@TK2MSFTNGP10.phx.gbl...
> Maxim,
>
> I have modified the Passthru sample.
>
> If i do not change anything in my packet(packet and buffer allocated by
me).
> Then everything works fine. So i think my created packet and allocated
> buffer is fine.
>
> I am modifing the received packet as well. Receive packet modification
> works. I am using the same code to modify the receive packet.
> I am facing the problem only when i am modifing the send packet. I am not
> sure, what is happening.
>
> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> news:OoqTSonbEHA.636@TK2MSFTNGP12.phx.gbl...
> > See the PASSTHRU and MUX samples for details in this procedure.
> >
> > --
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > maxim@storagecraft.com
> >
http://www.storagecraft.com
> >
> > "Rajesh Gupta" <guptar@gmail.com> wrote in message
> > news:%23GOOtknbEHA.3596@tk2msftngp13.phx.gbl...
> > > Hi Maxim,
> > >
> > > Thanks a lot for your response. I did not modify the NDIS_PACKET in
> place.
> > >
> > > 1. Allocate a send Packet buffer.
> > > 2. Allocate the buffer, i got this buffer size by quering the NDIS
> buffer.
> > > (i am chaining only one buffer, even if original NDIS-PACKET has more
> than
> > > one)
> > > 3. Copy all the data into this allocated buffer.
> > > 4. Modified the desired buffer contains.
> > > 5. Copied all the OOB, and other information.
> > > 6. Chained the buffer in the packet
> > > 7. and send it.
> > >
> > > i did follow all these steps. Only while using the Network Stacking in
> 5.1,
> > > i am trying to modify the NDIS-PACKET. I tested both, i am not sure
why
> it
> > > does not work for Intel adapter and it works for VIA adapter.
> > >
> > > Thanks
> > > Rajesh
> > >
> > > "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> > > news:OblZJ%23mbEHA.2468@TK2MSFTNGP09.phx.gbl...
> > > > You cannot modify NDIS_PACKET in place.
> > > >
> > > > You will need to allocate another NDIS_PACKET and another
> > > NDIS_BUFFER+the
> > > > data area for the update data, and re-link the buffer chain to the
new
> > > > NDIS_PACKET.
> > > >
> > > > --
> > > > Maxim Shatskih, Windows DDK MVP
> > > > StorageCraft Corporation
> > > > maxim@storagecraft.com
> > > >
http://www.storagecraft.com
> > > >
> > > >
> > > > "Rajesh Gupta" <guptar@gmail.com> wrote in message
> > > > news:%23gmxgymbEHA.252@TK2MSFTNGP10.phx.gbl...
> > > > > Hi All,
> > > > >
> > > > > I am trying to modify the NDIS packet. I want to redirect the
packet
> > > from
> > > > > destined for 172.10.10.10 to 172.10.10.10.
> > > > > steps taken to modify the packets.
> > > > >
> > > > > 1. Modify the Destination IP address.
> > > > > 2. Calculate the Checksum.
> > > > > 3. Modify the Destination MAC address.
> > > > > 4. Send the packet.
> > > > >
> > > > > I have used both Network stacking and own NDIS packets.
> > > > >
> > > > > When i tested my code, it worked on One Ethernet Adapter and it
did
> not
> > > work
> > > > > on another adapters. I do not know why.
> > > > > When i captured the packet with Etherreal, it shows that the
> Checksum is
> > > 0
> > > > > at the destination. Everything else is fine. I checked the IP
> address,
> > > MAC
> > > > > address, then are updated.
> > > > > I am calculating the right checksum and i made sure i am updating
> the
> > > > > checksum after i modified the packet.
> > > > > I am not sure, when Checksum became 0.
> > > > >
> > > > > I do not know, if Miniport driver made it 0. Is that the
posibility?
> if
> > > yes
> > > > > then why? Is my checksum wrong? I am attaching the code to
calculate
> > > > > checksum here. Thanks in advance for your help.
> > > > >
> > > > > Regards
> > > > > Rajesh
> > > > >
> > > > >
> > > > > /*
> > > > >
> > > > >
> > >
> **************************************************************************
> > > > >
> > > > > Function: FltIPSumCalculation
> > > > >
> > > > > Description: Calculate the 16 bit IP sum.
> > > > >
> > > > >
> > >
>
***************************************************************************
> > > > >
> > > > > */
> > > > >
> > > > > USHORT FltIPSumCalculation(USHORT len, PUSHORT pbuf)
> > > > >
> > > > > {
> > > > >
> > > > > ULONG sum=0;
> > > > >
> > > > >
> > > > > while(len > 1){
> > > > >
> > > > > sum += *pbuf++;
> > > > >
> > > > > len -= sizeof(USHORT);
> > > > >
> > > > > }
> > > > >
> > > > > if(len)
> > > > >
> > > > > sum += *(UCHAR*)pbuf;
> > > > >
> > > > > sum = (sum >> 16) + (sum & 0xffff);
> > > > >
> > > > > sum += (sum >> 16);
> > > > >
> > > > > // one's complement the result
> > > > >
> > > > > sum = ~sum;
> > > > >
> > > > > return ((USHORT) sum);
> > > > >
> > > > > }
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>