From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Questions about Gnat.sockets and raw socket Date: Thu, 23 Apr 2015 14:19:13 +0200 Organization: cbb software GmbH Message-ID: <64xtlkgbv1qk.139l2vds2na5p.dlg@40tude.net> References: <67547c2b-9302-4bbc-9865-523772248e3b@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: enOx0b+nfqkc2k+TNpOejg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:25576 Date: 2015-04-23T14:19:13+02:00 List-Id: 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