route IP using TDI

In NDIS intermediate driver i capture IP packet,after doing sth,i need
route “New packet” again.
i want to use TDI to finish the routing, so i create
“\Devide\RawIp\#protocol”, build TDI IRP,IocallDriver…
ok, it is working!

unfortunately,i can’t get any way to include iphead, TCP/IP build a iphead
for my “New packet”.

When an application sends a datagram it may or may not include the IP
header at the front of the outgoing datagrams depending on the IP_HDRINCL
option set for the socket.

As TDI client, how do i send a datagram it may include the IP header?

> When an application sends a datagram it may or may not include the IP

header at the front of the outgoing datagrams depending on the IP_HDRINCL
option set for the socket.

Find the DDK’s WSHSMPLE code, which has the illustration of how setsockopt()
for TCP and IP options is implemented at TDI level.
Then find AO_OPTION_xxx flags there.

The IP_HDRINCL option is not listed there, so, add it yourself as:

#define AO_OPTION_HDRINCL 11

and run SetTdiInformation routine from WSHSMPLE. The data type is BOOLEAN.

Max

Max,
If AO_OPTION_HDRINCL is 11(I believe you meant decimal). Which
option value is 0x0C (12)?
I was under the impression that AO_OPTION_HDRINCL is 0x0C.

-Srin.

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Monday, July 21, 2003 2:26 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: route IP using TDI

> When an application sends a datagram it may or may not include the
IP
> header at the front of the outgoing datagrams depending on the
IP_HDRINCL
> option set for the socket.

Find the DDK’s WSHSMPLE code, which has the illustration of how
setsockopt()
for TCP and IP options is implemented at TDI level.
Then find AO_OPTION_xxx flags there.

The IP_HDRINCL option is not listed there, so, add it yourself as:

#define AO_OPTION_HDRINCL 11

and run SetTdiInformation routine from WSHSMPLE. The data type is
BOOLEAN.

Max


You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Dunno, I have found that IP_HDRINCL is AO option 11 (0xb) by experiments.

Max

----- Original Message -----
From:
To: “Windows System Software Developers Interest List”
Sent: Tuesday, July 22, 2003 5:50 AM
Subject: [ntdev] Re: route IP using TDI

> Max,
> If AO_OPTION_HDRINCL is 11(I believe you meant decimal). Which
> option value is 0x0C (12)?
> I was under the impression that AO_OPTION_HDRINCL is 0x0C.
>
> -Srin.
>
> > -----Original Message-----
> > From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> > Sent: Monday, July 21, 2003 2:26 AM
> > To: Windows System Software Developers Interest List
> > Subject: [ntdev] Re: route IP using TDI
> >
> > > When an application sends a datagram it may or may not include the
> IP
> > > header at the front of the outgoing datagrams depending on the
> > IP_HDRINCL
> > > option set for the socket.
> >
> > Find the DDK’s WSHSMPLE code, which has the illustration of how
> > setsockopt()
> > for TCP and IP options is implemented at TDI level.
> > Then find AO_OPTION_xxx flags there.
> >
> > The IP_HDRINCL option is not listed there, so, add it yourself as:
> >
> > #define AO_OPTION_HDRINCL 11
> >
> > and run SetTdiInformation routine from WSHSMPLE. The data type is
> BOOLEAN.
> >
> > Max
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@nai.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>