Re: Welcome to the NTDEV Discussion List!

I am developing an NDIS intermediate driver for my application.

I want my NDIS IM Driver to select UDP Packets from the packets coming from
TCP/IP Stack and send them to another driver(Any Driver,can be another IM
Driver) and also send the remaining packets(Non-UDP) to the Driver NIC to be
sent to the network.

The UDP Packets received by the other driver should then be returned as it
is to the sending driver.

My question is how can i send packets from one driver to another driver and
receive them back?
And
Is it possible to send some packets to one driver and other to another
driver.?

Thanks in Advance.
Sunny

Checkout passthru samples in DDK and documentation about them.certainly the
only and best way to start.
but the doc also suggests the way the packets gets filtered, i mean where ur
driver sits,near the interface the better u get the hold of the packet or
so.

On 30/05/07, shobhit shingla wrote:
>
> I am developing an NDIS intermediate driver for my application.
>
> I want my NDIS IM Driver to select UDP Packets from the packets coming
> from TCP/IP Stack and send them to another driver(Any Driver,can be another
> IM Driver) and also send the remaining packets(Non-UDP) to the Driver NIC to
> be sent to the network.
>
> The UDP Packets received by the other driver should then be returned as it
> is to the sending driver.
>
> My question is how can i send packets from one driver to another driver
> and receive them back?
> And
> Is it possible to send some packets to one driver and other to another
> driver.?
>
> Thanks in Advance.
> Sunny
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
> Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer


‘‘The Blessed Lord said: Time I am, destroyer of the worlds, and I have come
to engage all people. With the exception of you, all the soldiers here on
both sides will be slain.’’
-Bhagwad Gita

Anand C. Iyer
Gsec1 Limited
Chennai, India | Manchester, UK
Mobile:0-9840250767
Fax: 91 44 5202 2606
www.gsec1.com

Out of curiosity, why can’t you process the UDP packets from within the same IM driver?

Have a nice day
GV

----- Original Message -----
From: shobhit shingla
To: Windows System Software Devs Interest List
Sent: Wednesday, May 30, 2007 6:07 AM
Subject: Re:[ntdev] Welcome to the NTDEV Discussion List!

I am developing an NDIS intermediate driver for my application.

I want my NDIS IM Driver to select UDP Packets from the packets coming from TCP/IP Stack and send them to another driver(Any Driver,can be another IM Driver) and also send the remaining packets(Non-UDP) to the Driver NIC to be sent to the network.

The UDP Packets received by the other driver should then be returned as it is to the sending driver.

My question is how can i send packets from one driver to another driver and receive them back?
And
Is it possible to send some packets to one driver and other to another driver.?

Thanks in Advance.

Sunny

— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I can but i just want to check whether it is feasible to pass UDP Packets to
another Driver and then get it back.

On 5/30/07, Gianluca Varenni wrote:
>
> Out of curiosity, why can’t you process the UDP packets from within the
> same IM driver?
>
> Have a nice day
> GV
>
>
> ----- Original Message -----
> From: shobhit shingla
> To: Windows System Software Devs Interest List
> Sent: Wednesday, May 30, 2007 6:07 AM
> Subject: Re:[ntdev] Welcome to the NTDEV Discussion List!
>
>
>
> I am developing an NDIS intermediate driver for my application.
>
> I want my NDIS IM Driver to select UDP Packets from the packets coming
> from TCP/IP Stack and send them to another driver(Any Driver,can be another
> IM Driver) and also send the remaining packets(Non-UDP) to the Driver NIC to
> be sent to the network.
>
> The UDP Packets received by the other driver should then be returned as it
> is to the sending driver.
>
> My question is how can i send packets from one driver to another driver
> and receive them back?
> And
> Is it possible to send some packets to one driver and other to another
> driver.?
>
> Thanks in Advance.
> Sunny
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256http:To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServerhttp:
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256http:
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServerhttp:
></http:></http:></http:></http:>

Your question is really too vague to be of help.

In you IM driver you can do anything you want with packets that are sent or
received. You can examine them, pas them through transparently (as in the
Passthru sample), or throw them away.

If your driver can communicate with another driver (a chore in itself…),
then you can exchange information between your IM driver and another driver.
One example of information that you could exchange between your IM driver
and another driver is the information contained within a packet.

At this point you need to carefully understand what a “NDIS packet” really
is. See the “NDIS Packet Discussion” at http://www.NDIS.com.

After you understand what a “NDIS packet” really is, then you will probably
learn that you can pass the packet information to another driver. However,
the other driver must understand the structure of a “NDIS packet” and also
understand who owns the “NDIS packet” and how it must be returned to its
owner when you no longer have need of it.

The idea you are thinking of will be difficult to implement. I am sure that
most of the experienced NDIS developers on this list would avoid this
architecture at almost any cost.

Rethink your design approach. Try to follow GV’s advice: Process the packets
from within your IM driver!

Thomas F. Divine

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of shobhit shingla
Sent: Thursday, May 31, 2007 12:15 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] Welcome to the NTDEV Discussion List!

I can but i just want to check whether it is feasible to pass UDP Packets to
another Driver and then get it back.

On 5/30/07, Gianluca Varenni wrote:

Out of curiosity, why can’t you process the UDP packets from within the same
IM driver?

Have a nice day

GV

----- Original Message -----

From: shobhit shingla mailto:xxxxx

To: Windows mailto:xxxxx System Software Devs Interest List

Sent: Wednesday, May 30, 2007 6:07 AM

Subject: Re:[ntdev] Welcome to the NTDEV Discussion List!

I am developing an NDIS intermediate driver for my application.

I want my NDIS IM Driver to select UDP Packets from the packets coming from
TCP/IP Stack and send them to another driver(Any Driver,can be another IM
Driver) and also send the remaining packets(Non-UDP) to the Driver NIC to be
sent to the network.

The UDP Packets received by the other driver should then be returned as it
is to the sending driver.

My question is how can i send packets from one driver to another driver and
receive them back?
And
Is it possible to send some packets to one driver and other to another
driver.?

Thanks in Advance.

Sunny

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
http:pvih/article.cfm?id=256> To unsubscribe, visit the List Server section of
OSR Online at http://www.osronline.com/page.cfm?name=ListServer
http:pvih/page.cfm?name=ListServer>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
http:pvih/article.cfm?id=256>

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
http:pvih/page.cfm?name=ListServer>

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</http:></http:></http:></http:></mailto:xxxxx></mailto:xxxxx>

I know that it is difficult but i just want to know that whether it is
feasible or not.if not can you please explain me the reason for the same.

Thanks in adnvance

On 5/31/07, Thomas F. Divine wrote:
>
> Your question is really too vague to be of help.
>
>
>
> In you IM driver you can do anything you want with packets that are sent
> or received. You can examine them, pas them through transparently (as in the
> Passthru sample), or throw them away.
>
>
>
> If your driver can communicate with another driver (a chore in itself…),
> then you can exchange information between your IM driver and another driver.
> One example of information that you could exchange between your IM driver
> and another driver is the information contained within a packet.
>
>
>
> At this point you need to carefully understand what a “NDIS packet” really
> is. See the “NDIS Packet Discussion” at http://www.NDIS.comhttp:</http:>
> .
>
>
>
> After you understand what a “NDIS packet” really is, then you will
> probably learn that you can pass the packet information to another driver.
> However, the other driver must understand the structure of a “NDIS packet”
> and also understand who owns the “NDIS packet” and how it must be returned
> to its owner when you no longer have need of it.
>
>
>
> The idea you are thinking of will be difficult to implement. I am sure
> that most of the experienced NDIS developers on this list would avoid this
> architecture at almost any cost.
>
>
>
> Rethink your design approach. Try to follow GV’s advice: Process the
> packets from within your IM driver!
>
>
>
> Thomas F. Divine
>
>
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *shobhit shingla
> Sent: Thursday, May 31, 2007 12:15 AM
> To: Windows System Software Devs Interest List
> Subject: Re: Re:[ntdev] Welcome to the NTDEV Discussion List!
>
>
>
> I can but i just want to check whether it is feasible to pass UDP Packets
> to another Driver and then get it back.
>
> On 5/30/07, Gianluca Varenni wrote:
>
> Out of curiosity, why can’t you process the UDP packets from within the
> same IM driver?
>
>
>
> Have a nice day
>
> GV
>
>
>
> ----- Original Message -----
>
> From: shobhit shingla
>
> To: Windows System Software Devs Interest List
>
> Sent: Wednesday, May 30, 2007 6:07 AM
>
> Subject: Re:[ntdev] Welcome to the NTDEV Discussion List!
>
>
>
>
> I am developing an NDIS intermediate driver for my application.
>
> I want my NDIS IM Driver to select UDP Packets from the packets coming
> from TCP/IP Stack and send them to another driver(Any Driver,can be another
> IM Driver) and also send the remaining packets(Non-UDP) to the Driver NIC to
> be sent to the network.
>
> The UDP Packets received by the other driver should then be returned as it
> is to the sending driver.
>
> My question is how can i send packets from one driver to another driver
> and receive them back?
> And
> Is it possible to send some packets to one driver and other to another
> driver.?
>
> Thanks in Advance.
>
> Sunny
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256http:To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServerhttp:
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256http:
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServerhttp:
>
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
> Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
></http:></http:></http:></http:>

Yes, it’s feasible to create two drivers that communicate and pass data between each other.

And as Thomas already said, it’s jst discouraged because

  1. inter-driver communication is complex. The problem is not the data flowing between the two drivers, the problem is the infrastracture you need to set up in order to guarantee that the one driver acts properly when the other one gets loaded/unloaded.
  2. NDIS IM drivers are complicated on their own (they are already quite two drivers, a miniport and a protocol driver, bundled within the same binary). Add to that the communication with another driver, and you can get into trouble.

Hope it helps
GV

----- Original Message -----
From: shobhit shingla
To: Windows System Software Devs Interest List
Sent: Thursday, May 31, 2007 6:02 AM
Subject: Re: Re:[ntdev] Welcome to the NTDEV Discussion List!

I know that it is difficult but i just want to know that whether it is feasible or not.if not can you please explain me the reason for the same.

Thanks in adnvance

On 5/31/07, Thomas F. Divine wrote:
Your question is really too vague to be of help.

In you IM driver you can do anything you want with packets that are sent or received. You can examine them, pas them through transparently (as in the Passthru sample), or throw them away.

If your driver can communicate with another driver (a chore in itself…), then you can exchange information between your IM driver and another driver. One example of information that you could exchange between your IM driver and another driver is the information contained within a packet.

At this point you need to carefully understand what a “NDIS packet” really is. See the “NDIS Packet Discussion” at http://www.NDIS.com.

After you understand what a “NDIS packet” really is, then you will probably learn that you can pass the packet information to another driver. However, the other driver must understand the structure of a “NDIS packet” and also understand who owns the “NDIS packet” and how it must be returned to its owner when you no longer have need of it.

The idea you are thinking of will be difficult to implement. I am sure that most of the experienced NDIS developers on this list would avoid this architecture at almost any cost.

Rethink your design approach. Try to follow GV’s advice: Process the packets from within your IM driver!

Thomas F. Divine

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of shobhit shingla
Sent: Thursday, May 31, 2007 12:15 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] Welcome to the NTDEV Discussion List!

I can but i just want to check whether it is feasible to pass UDP Packets to another Driver and then get it back.

On 5/30/07, Gianluca Varenni wrote:

Out of curiosity, why can’t you process the UDP packets from within the same IM driver?

Have a nice day

GV

----- Original Message -----

From: shobhit shingla

To: Windows System Software Devs Interest List

Sent: Wednesday, May 30, 2007 6:07 AM

Subject: Re:[ntdev] Welcome to the NTDEV Discussion List!

I am developing an NDIS intermediate driver for my application.

I want my NDIS IM Driver to select UDP Packets from the packets coming from TCP/IP Stack and send them to another driver(Any Driver,can be another IM Driver) and also send the remaining packets(Non-UDP) to the Driver NIC to be sent to the network.

The UDP Packets received by the other driver should then be returned as it is to the sending driver.

My question is how can i send packets from one driver to another driver and receive them back?
And
Is it possible to send some packets to one driver and other to another driver.?

Thanks in Advance.

Sunny

— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Sorry the attachment is not allowed.

Here is the module structure

TCP/IP Protocol Stack
|
| All packets
| UDP Packets
NDIS IM Driver 1
<-----------------------------------> NDIS IM Driver 2
| UDP Packets
returned
|
|
|
Driver NIC

I have the following queries regarding this module structure

  1. How can i bind *NDIS IM Driver 1* to both the underlying NIC and to
    NDIS IM Driver 2?

  2. How will NDIS IM Driver 1 differentiate between packet coming from
    TCP/IP Stack and from NDIS IM Driver 2.?(Do i need to create a separate
    interface for NDIS IM Driver 2).

On 5/31/07, Gianluca Varenni < xxxxx@gmail.com> wrote:
>
> Yes, it’s feasible to create two drivers that communicate and pass data
> between each other.
>
> And as Thomas already said, it’s jst discouraged because
> 1. inter-driver communication is complex. The problem is not the data
> flowing between the two drivers, the problem is the infrastracture you need
> to set up in order to guarantee that the one driver acts properly when the
> other one gets loaded/unloaded.
> 2. NDIS IM drivers are complicated on their own (they are already quite
> two drivers, a miniport and a protocol driver, bundled within the same
> binary). Add to that the communication with another driver, and you can get
> into trouble.
>
> Hope it helps
> GV
>
>
> ----- Original Message -----
> *From:* shobhit shingla
> > To: Windows System Software Devs Interest List
> > Sent: Thursday, May 31, 2007 6:02 AM
> > Subject: Re: Re:[ntdev] Welcome to the NTDEV Discussion List!
> >
> >
> > I know that it is difficult but i just want to know that whether it is
> > feasible or not.if not can you please explain me the reason for the
> > same.
> >
> > Thanks in adnvance
> >
> >
> > On 5/31/07, Thomas F. Divine wrote:
> > >
> > > Your question is really too vague to be of help.
> > >
> > >
> > >
> > > In you IM driver you can do anything you want with packets that are
> > > sent or received. You can examine them, pas them through transparently (as
> > > in the Passthru sample), or throw them away.
> > >
> > >
> > >
> > > If your driver can communicate with another driver (a chore in
> > > itself…), then you can exchange information between your IM driver and
> > > another driver. One example of information that you could exchange between
> > > your IM driver and another driver is the information contained within a
> > > packet.
> > >
> > >
> > >
> > > At this point you need to carefully understand what a “NDIS packet”
> > > really is. See the “NDIS Packet Discussion” at
> > > http://www.christcollege.edu.ms/servlet/redirect.srv/p5.p1.pbcd.pwnte.pqdc/http:</http:>
> > > .
> > >
> > >
> > >
> > > After you understand what a “NDIS packet” really is, then you will
> > > probably learn that you can pass the packet information to another driver.
> > > However, the other driver must understand the structure of a “NDIS packet”
> > > and also understand who owns the “NDIS packet” and how it must be returned
> > > to its owner when you no longer have need of it.
> > >
> > >
> > >
> > > The idea you are thinking of will be difficult to implement. I am sure
> > > that most of the experienced NDIS developers on this list would avoid this
> > > architecture at almost any cost.
> > >
> > >
> > >
> > > Rethink your design approach. Try to follow GV’s advice: Process the
> > > packets from within your IM driver!
> > >
> > >
> > >
> > > Thomas F. Divine
> > >
> > >
> > >
> > >
> > >
> > > From: xxxxx@lists.osr.com [mailto:
> > > xxxxx@lists.osr.com] *On Behalf Of *shobhit shingla
> > > *Sent: *Thursday, May 31, 2007 12:15 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re: Re:[ntdev] Welcome to the NTDEV Discussion List!
> > >
> > >
> > >
> > > I can but i just want to check whether it is feasible to pass UDP
> > > Packets to another Driver and then get it back.
> > >
> > > On 5/30/07, Gianluca Varenni wrote:
> > >
> > > Out of curiosity, why can’t you process the UDP packets from within
> > > the same IM driver?
> > >
> > >
> > >
> > > Have a nice day
> > >
> > > GV
> > >
> > >
> > >
> > > ----- Original Message -----
> > >
> > > From: shobhit shingla
> > >
> > > To: Windows System Software Devs Interest List
> > >
> > > Sent: Wednesday, May 30, 2007 6:07 AM
> > >
> > > Subject: Re:[ntdev] Welcome to the NTDEV Discussion List!
> > >
> > >
> > >
> > >
> > > I am developing an NDIS intermediate driver for my application.
> > >
> > > I want my NDIS IM Driver to select UDP Packets from the packets coming
> > > from TCP/IP Stack and send them to another driver(Any Driver,can be another
> > > IM Driver) and also send the remaining packets(Non-UDP) to the Driver NIC to
> > > be sent to the network.
> > >
> > > The UDP Packets received by the other driver should then be returned
> > > as it is to the sending driver.
> > >
> > > My question is how can i send packets from one driver to another
> > > driver and receive them back?
> > > And
> > > Is it possible to send some packets to one driver and other to another
> > > driver.?
> > >
> > > Thanks in Advance.
> > >
> > > Sunny
> > >
> > > — Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256http:To unsubscribe, visit the List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServerhttp:
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.christcollege.edu.ms/servlet/redirect.srv/p5.p1.pbcd.pxccaazxdv.pvih//article.cfm?id=256http:
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServerhttp:
> > >
> > >
> > > — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
> > >
> > > http:To
> > > unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
> > >
> > > http:
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256http:
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServerhttp:
> > >
> >
> > — Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256http:To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServerhttp:
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256http:
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServerhttp:
> >
>
>
></http:></http:></http:></http:></http:></http:></http:></http:></http:></http:></http:></http:>