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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.132.136 with SMTP id u130mr14268420ywf.11.1461515508879; Sun, 24 Apr 2016 09:31:48 -0700 (PDT) X-Received: by 10.182.102.73 with SMTP id fm9mr315956obb.9.1461515508839; Sun, 24 Apr 2016 09:31:48 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!10no6154806qgg.1!news-out.google.com!k10ni174igv.0!nntp.google.com!g8no5976549igr.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 24 Apr 2016 09:31:48 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:1205:c68c:9d90:696a:38cf:bbbd:d246; posting-account=Pm0FhgoAAAAiPscNT3etSZ15tHNZGXm_ NNTP-Posting-Host: 2a02:1205:c68c:9d90:696a:38cf:bbbd:d246 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <276b8c43-7280-48ad-94be-c8324c6ae326@googlegroups.com> Subject: Broadcasting UDP From: ahlan.marriott@gmail.com Injection-Date: Sun, 24 Apr 2016 16:31:48 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2374 X-Received-Body-CRC: 3750219559 Xref: news.eternal-september.org comp.lang.ada:30266 Date: 2016-04-24T09:31:48-07:00 List-Id: I asked this question sometime ago but I can no longer find the post. In any case it was never really resolved so let me try again. I am looking for a platform independent Ada solution on how to broadcast a UDP packet. I would be satisfied with a GNAT only solution, i.e. one that uses Gnat.Sockets and/or Gnat specific libraries. Attempting to broadcast to the limited broadcast address 255.255.255.255 has no effect (under Windows at least) To successfully broadcast one needs to use the subnet directed broadcast address. As I want to support PCs that have multiple ethernet adapters this means that I must iterate over the ethernet adapters, discover my ethernet address and subnet for each adapter, calculate the broadcast address and then send the UDP packet to that address. So far so good. My problem is that I don't know how to iterate over my adapters and obtain the address and subnet mask for each adapter using just Ada. Can anyone tell me how I can do this using Ada? The solution I currently employ is to bind to a windows API. However this is obviously not target independent. If there is no Ada way of iterating over the ethernet adapters then I will have to do a separate implementation for each platform. In which case I would be grateful if anyone could tell me how I can iterate my adapters under Linux and OSX. Best wishes, Ahlan