comp.lang.ada
 help / color / mirror / Atom feed
* Questions about Gnat.sockets and raw socket
@ 2015-04-23  9:21 loïc maury
  2015-04-23 12:19 ` Dmitry A. Kazakov
  2015-04-28 10:21 ` loïc maury
  0 siblings, 2 replies; 7+ messages in thread
From: loïc maury @ 2015-04-23  9:21 UTC (permalink / raw)



Hello,

For a personal project, I want to create  a packet analyzer.

Can I use Gnat.socket, for raw socket programming ? it is not clear

for me, and unfortunately I didn't found any answers in the ada groups.

I will use it under Windows.

Thank you

Best

Loic


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Questions about Gnat.sockets and raw socket
  2015-04-23  9:21 Questions about Gnat.sockets and raw socket loïc maury
@ 2015-04-23 12:19 ` Dmitry A. Kazakov
  2015-04-23 12:52   ` loïc maury
  2015-04-28 10:21 ` loïc maury
  1 sibling, 1 reply; 7+ messages in thread
From: Dmitry A. Kazakov @ 2015-04-23 12:19 UTC (permalink / raw)


On Thu, 23 Apr 2015 02:21:00 -0700 (PDT), loïc maury wrote:

> For a personal project, I want to create a packet analyzer.
> Can I use Gnat.socket, for raw socket programming ? it is not clear
> for me, and unfortunately I didn't found any answers in the ada groups.
> 
> I will use it under Windows.

The short answer is no, it would not go.

Windows does not support raw sockets (naturally GNAT.Sockets does not do
either). Under Windows you will need a so-called NDIS driver to handle
packets away of the network stack, and Ada bindings to.

I can recommend an inexpensive NDIS driver we are successfully using under
Windows:

   http://www.rawether.net

We also have Windows bindings to it, but they are proprietary.

P.S. Under Linux you would use raw sockets. GNAT.Sockets does not support
them, but it is relatively simple to adapt.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Questions about Gnat.sockets and raw socket
  2015-04-23 12:19 ` Dmitry A. Kazakov
@ 2015-04-23 12:52   ` loïc maury
  2015-04-23 15:41     ` loïc maury
  0 siblings, 1 reply; 7+ messages in thread
From: loïc maury @ 2015-04-23 12:52 UTC (permalink / raw)


Le jeudi 23 avril 2015 14:19:04 UTC+2, Dmitry A. Kazakov a écrit :
> On Thu, 23 Apr 2015 02:21:00 -0700 (PDT), loďc maury wrote:
> 
> > For a personal project, I want to create a packet analyzer.
> > Can I use Gnat.socket, for raw socket programming ? it is not clear
> > for me, and unfortunately I didn't found any answers in the ada groups.
> > 
> > I will use it under Windows.
> 
> The short answer is no, it would not go.
> 
> Windows does not support raw sockets (naturally GNAT.Sockets does not do
> either). Under Windows you will need a so-called NDIS driver to handle
> packets away of the network stack, and Ada bindings to.
> 
> I can recommend an inexpensive NDIS driver we are successfully using under
> Windows:
> 
>    http://www.rawether.net
> 
> We also have Windows bindings to it, but they are proprietary.
> 
> P.S. Under Linux you would use raw sockets. GNAT.Sockets does not support
> them, but it is relatively simple to adapt.
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

Hello Dmitry,

Thank you for the quick answer.

Maybe NDIS open source project exist, I will try to find one.

Best

Loic

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Questions about Gnat.sockets and raw socket
  2015-04-23 12:52   ` loïc maury
@ 2015-04-23 15:41     ` loïc maury
  2015-04-23 16:14       ` Dmitry A. Kazakov
  0 siblings, 1 reply; 7+ messages in thread
From: loïc maury @ 2015-04-23 15:41 UTC (permalink / raw)


Le jeudi 23 avril 2015 14:52:45 UTC+2, loïc maury a écrit :
> Le jeudi 23 avril 2015 14:19:04 UTC+2, Dmitry A. Kazakov a écrit :
> > On Thu, 23 Apr 2015 02:21:00 -0700 (PDT), loďc maury wrote:
> > 
> > > For a personal project, I want to create a packet analyzer.
> > > Can I use Gnat.socket, for raw socket programming ? it is not clear
> > > for me, and unfortunately I didn't found any answers in the ada groups.
> > > 
> > > I will use it under Windows.
> > 
> > The short answer is no, it would not go.
> > 
> > Windows does not support raw sockets (naturally GNAT.Sockets does not do
> > either). Under Windows you will need a so-called NDIS driver to handle
> > packets away of the network stack, and Ada bindings to.
> > 
> > I can recommend an inexpensive NDIS driver we are successfully using under
> > Windows:
> > 
> >    http://www.rawether.net
> > 
> > We also have Windows bindings to it, but they are proprietary.
> > 
> > P.S. Under Linux you would use raw sockets. GNAT.Sockets does not support
> > them, but it is relatively simple to adapt.
> > 
> > -- 
> > Regards,
> > Dmitry A. Kazakov
> > http://www.dmitry-kazakov.de
> 
> Hello Dmitry,
> 
> Thank you for the quick answer.
> 
> Maybe NDIS open source project exist, I will try to find one.
> 
> Best
> 
> Loic

Maybe I found a solution, with Winpcap, I can create a binding for this
library.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Questions about Gnat.sockets and raw socket
  2015-04-23 15:41     ` loïc maury
@ 2015-04-23 16:14       ` Dmitry A. Kazakov
  2015-04-23 17:32         ` Qun-Ying
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry A. Kazakov @ 2015-04-23 16:14 UTC (permalink / raw)


On Thu, 23 Apr 2015 08:41:50 -0700 (PDT), loïc maury wrote:

> Le jeudi 23 avril 2015 14:52:45 UTC+2, loïc maury a écrit :
>> Le jeudi 23 avril 2015 14:19:04 UTC+2, Dmitry A. Kazakov a écrit :
>>> On Thu, 23 Apr 2015 02:21:00 -0700 (PDT), loďc maury wrote:
>>> 
>>> > For a personal project, I want to create a packet analyzer.
>>> > Can I use Gnat.socket, for raw socket programming ? it is not clear
>>> > for me, and unfortunately I didn't found any answers in the ada groups.
>>> > 
>>> > I will use it under Windows.
>>> 
>>> The short answer is no, it would not go.
>>> 
>>> Windows does not support raw sockets (naturally GNAT.Sockets does not do
>>> either). Under Windows you will need a so-called NDIS driver to handle
>>> packets away of the network stack, and Ada bindings to.
>>> 
>>> I can recommend an inexpensive NDIS driver we are successfully using under
>>> Windows:
>>> 
>>>    http://www.rawether.net
>>> 
>>> We also have Windows bindings to it, but they are proprietary.
>>> 
>>> P.S. Under Linux you would use raw sockets. GNAT.Sockets does not support
>>> them, but it is relatively simple to adapt.
>>> 
>> Maybe NDIS open source project exist, I will try to find one.
>> 
> Maybe I found a solution, with Winpcap, I can create a binding for this
> library.

Winpcap is not free, only its run-time is. But you will also need the SDK,
which is five times as expensive as rawether, last time we checked.

If you have much spare time and a MSDN subscription (1K per annual) you can
take a sample NDIS from Windows DDK and use it as a starting point. 

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Questions about Gnat.sockets and raw socket
  2015-04-23 16:14       ` Dmitry A. Kazakov
@ 2015-04-23 17:32         ` Qun-Ying
  0 siblings, 0 replies; 7+ messages in thread
From: Qun-Ying @ 2015-04-23 17:32 UTC (permalink / raw)


Dmitry A. Kazakov wrote:
> On Thu, 23 Apr 2015 08:41:50 -0700 (PDT), loïc maury wrote:
>
> Winpcap is not free, only its run-time is. But you will also need the SDK,
> which is five times as expensive as rawether, last time we checked.
>
> If you have much spare time and a MSDN subscription (1K per annual) you can
> take a sample NDIS from Windows DDK and use it as a starting point.
>
I think you got the wrong information. Winpcap is free:
http://www.winpcap.org/misc/copyright.htm

And its developer's pack (SDK) is freely available:

http://www.winpcap.org/devel.htm


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Questions about Gnat.sockets and raw socket
  2015-04-23  9:21 Questions about Gnat.sockets and raw socket loïc maury
  2015-04-23 12:19 ` Dmitry A. Kazakov
@ 2015-04-28 10:21 ` loïc maury
  1 sibling, 0 replies; 7+ messages in thread
From: loïc maury @ 2015-04-28 10:21 UTC (permalink / raw)



Hello,

Finally I used WFP, but unfortunately, in native, it seem to be too complicated
for a binding in Ada.

Thank you

Best

Loic 


Le jeudi 23 avril 2015 11:21:01 UTC+2, loïc maury a écrit :
> Hello,
> 
> For a personal project, I want to create  a packet analyzer.
> 
> Can I use Gnat.socket, for raw socket programming ? it is not clear
> 
> for me, and unfortunately I didn't found any answers in the ada groups.
> 
> I will use it under Windows.
> 
> Thank you
> 
> Best
> 
> Loic

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-28 10:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-23  9:21 Questions about Gnat.sockets and raw socket loïc maury
2015-04-23 12:19 ` Dmitry A. Kazakov
2015-04-23 12:52   ` loïc maury
2015-04-23 15:41     ` loïc maury
2015-04-23 16:14       ` Dmitry A. Kazakov
2015-04-23 17:32         ` Qun-Ying
2015-04-28 10:21 ` loïc maury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox